Skip to content

Commit 5213c57

Browse files
authored
[clang-tidy][NFC] run clang-format over clang-tidy checks and tool code. (#143324)
1 parent 13b1803 commit 5213c57

File tree

52 files changed

+161
-172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+161
-172
lines changed

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ ClangTidyASTConsumerFactory::createASTConsumer(
419419

420420
std::unique_ptr<ClangTidyProfiling> Profiling;
421421
if (Context.getEnableProfiling()) {
422-
Profiling = std::make_unique<ClangTidyProfiling>(
423-
Context.getProfileStorageParams());
422+
Profiling =
423+
std::make_unique<ClangTidyProfiling>(Context.getProfileStorageParams());
424424
FinderOptions.CheckProfiling.emplace(Profiling->Records);
425425
}
426426

@@ -432,8 +432,8 @@ ClangTidyASTConsumerFactory::createASTConsumer(
432432

433433
if (Context.canEnableModuleHeadersParsing() &&
434434
Context.getLangOpts().Modules && OverlayFS != nullptr) {
435-
auto ModuleExpander = std::make_unique<ExpandModularHeadersPPCallbacks>(
436-
&Compiler, OverlayFS);
435+
auto ModuleExpander =
436+
std::make_unique<ExpandModularHeadersPPCallbacks>(&Compiler, OverlayFS);
437437
ModuleExpanderPP = ModuleExpander->getPreprocessor();
438438
PP->addPPCallbacks(std::move(ModuleExpander));
439439
}
@@ -497,7 +497,7 @@ getCheckNames(const ClangTidyOptions &Options,
497497
bool AllowEnablingAnalyzerAlphaCheckers) {
498498
clang::tidy::ClangTidyContext Context(
499499
std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
500-
Options),
500+
Options),
501501
AllowEnablingAnalyzerAlphaCheckers);
502502
ClangTidyASTConsumerFactory Factory(Context);
503503
return Factory.getCheckNames();
@@ -508,7 +508,7 @@ getCheckOptions(const ClangTidyOptions &Options,
508508
bool AllowEnablingAnalyzerAlphaCheckers) {
509509
clang::tidy::ClangTidyContext Context(
510510
std::make_unique<DefaultOptionsProvider>(ClangTidyGlobalOptions(),
511-
Options),
511+
Options),
512512
AllowEnablingAnalyzerAlphaCheckers);
513513
ClangTidyDiagnosticConsumer DiagConsumer(Context);
514514
auto DiagOpts = std::make_unique<DiagnosticOptions>();

clang-tools-extra/clang-tidy/ClangTidyCheck.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ void ClangTidyCheck::OptionsView::store<bool>(
530530
ClangTidyOptions::OptionMap &Options, StringRef LocalName,
531531
bool Value) const;
532532

533-
534533
} // namespace tidy
535534
} // namespace clang
536535

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,10 @@ class ClangTidyContext {
217217
using DiagLevelAndFormatString = std::pair<DiagnosticIDs::Level, std::string>;
218218
DiagLevelAndFormatString getDiagLevelAndFormatString(unsigned DiagnosticID,
219219
SourceLocation Loc) {
220-
return {
221-
static_cast<DiagnosticIDs::Level>(
222-
DiagEngine->getDiagnosticLevel(DiagnosticID, Loc)),
223-
std::string(
224-
DiagEngine->getDiagnosticIDs()->getDescription(DiagnosticID))};
220+
return {static_cast<DiagnosticIDs::Level>(
221+
DiagEngine->getDiagnosticLevel(DiagnosticID, Loc)),
222+
std::string(
223+
DiagEngine->getDiagnosticIDs()->getDescription(DiagnosticID))};
225224
}
226225

227226
void setOptionsCollector(llvm::StringSet<> *Collector) {

clang-tools-extra/clang-tidy/ClangTidyOptions.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ struct NOptionMap {
7070
NOptionMap(IO &, const ClangTidyOptions::OptionMap &OptionMap) {
7171
Options.reserve(OptionMap.size());
7272
for (const auto &KeyValue : OptionMap)
73-
Options.emplace_back(std::string(KeyValue.getKey()), KeyValue.getValue().Value);
73+
Options.emplace_back(std::string(KeyValue.getKey()),
74+
KeyValue.getValue().Value);
7475
}
7576
ClangTidyOptions::OptionMap denormalize(IO &) {
7677
ClangTidyOptions::OptionMap Map;

clang-tools-extra/clang-tidy/ClangTidyOptions.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ class FileOptionsBaseProvider : public DefaultOptionsProvider {
204204
protected:
205205
// A pair of configuration file base name and a function parsing
206206
// configuration from text in the corresponding format.
207-
using ConfigFileHandler = std::pair<std::string, std::function<llvm::ErrorOr<ClangTidyOptions> (llvm::MemoryBufferRef)>>;
207+
using ConfigFileHandler =
208+
std::pair<std::string, std::function<llvm::ErrorOr<ClangTidyOptions>(
209+
llvm::MemoryBufferRef)>>;
208210

209211
/// Configuration file handlers listed in the order of priority.
210212
///

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class ExpandModularHeadersPPCallbacks::FileRecorder {
4949
FilesToRecord.erase(File);
5050
}
5151

52-
/// Makes sure we have contents for all the files we were interested in. Ideally
53-
/// `FilesToRecord` should be empty.
52+
/// Makes sure we have contents for all the files we were interested in.
53+
/// Ideally `FilesToRecord` should be empty.
5454
void checkAllFilesRecorded() {
5555
LLVM_DEBUG({
5656
for (auto FileEntry : FilesToRecord)

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ namespace tooling {
3535
/// including the contents of the modular headers and all their transitive
3636
/// includes.
3737
///
38-
/// This allows existing tools based on PPCallbacks to retain their functionality
39-
/// when running with C++ modules enabled. This only works in the backwards
40-
/// compatible modules mode, i.e. when code can still be parsed in non-modular
41-
/// way.
38+
/// This allows existing tools based on PPCallbacks to retain their
39+
/// functionality when running with C++ modules enabled. This only works in the
40+
/// backwards compatible modules mode, i.e. when code can still be parsed in
41+
/// non-modular way.
4242
class ExpandModularHeadersPPCallbacks : public PPCallbacks {
4343
public:
4444
ExpandModularHeadersPPCallbacks(

clang-tools-extra/clang-tidy/concurrency/ConcurrencyTidyModule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class ConcurrencyModule : public ClangTidyModule {
2727

2828
} // namespace concurrency
2929

30-
// Register the ConcurrencyTidyModule using this statically initialized variable.
30+
// Register the ConcurrencyTidyModule using this statically initialized
31+
// variable.
3132
static ClangTidyModuleRegistry::Add<concurrency::ConcurrencyModule>
3233
X("concurrency-module", "Adds concurrency checks.");
3334

clang-tools-extra/clang-tidy/hicpp/ExceptionBaseclassCheck.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
namespace clang::tidy::hicpp {
1515

16-
/// Check for thrown exceptions and enforce they are all derived from std::exception.
16+
/// Check for thrown exceptions and enforce they are all derived from
17+
/// std::exception.
1718
///
1819
/// For the user-facing documentation see:
1920
/// http://clang.llvm.org/extra/clang-tidy/checks/hicpp/exception-baseclass.html

clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void MultiwayPathsCoveredCheck::check(const MatchFinder::MatchResult &Result) {
113113
}
114114
// Warns for degenerated 'switch' statements that neither define a case nor
115115
// a default label.
116-
// FIXME: Evaluate, if emitting a fix-it to simplify that statement is
116+
// FIXME: Evaluate, if emitting a fix-it to simplify that statement is
117117
// reasonable.
118118
if (!SwitchHasDefault && SwitchCaseCount == 0) {
119119
diag(Switch->getBeginLoc(),

0 commit comments

Comments
 (0)