Skip to content

Commit 6f1c9ae

Browse files
committed
[clang-tidy][NFC] Do more work at compile time
1 parent 50facad commit 6f1c9ae

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -669,18 +669,19 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) {
669669
Buffer.append(AnalyzerCheck);
670670
Result.Checks.insert(Buffer);
671671
}
672-
for (std::string OptionName : {
672+
673+
static constexpr llvm::StringLiteral OptionNames[] = {
673674
#define GET_CHECKER_OPTIONS
674675
#define CHECKER_OPTION(TYPE, CHECKER, OPTION_NAME, DESCRIPTION, DEFAULT, \
675676
RELEASE, HIDDEN) \
676-
Twine(AnalyzerCheckNamePrefix).concat(CHECKER ":" OPTION_NAME).str(),
677+
"clang-analyzer-" CHECKER ":" OPTION_NAME,
677678

678679
#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
679680
#undef CHECKER_OPTION
680681
#undef GET_CHECKER_OPTIONS
681-
}) {
682-
Result.Options.insert(OptionName);
683-
}
682+
};
683+
684+
Result.Options.insert_range(OptionNames);
684685
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER
685686

686687
Context.setOptionsCollector(&Result.Options);

0 commit comments

Comments
 (0)