Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions clang-tools-extra/clang-tidy/ClangTidy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ namespace clang::tidy {

namespace {
#if CLANG_TIDY_ENABLE_STATIC_ANALYZER
#define ANALYZER_CHECK_NAME_PREFIX "clang-analyzer-"
static constexpr llvm::StringLiteral AnalyzerCheckNamePrefix =
"clang-analyzer-";
ANALYZER_CHECK_NAME_PREFIX;

class AnalyzerDiagnosticConsumer : public ento::PathDiagnosticConsumer {
public:
Expand Down Expand Up @@ -669,18 +670,19 @@ getAllChecksAndOptions(bool AllowEnablingAnalyzerAlphaCheckers) {
Buffer.append(AnalyzerCheck);
Result.Checks.insert(Buffer);
}
for (std::string OptionName : {

static constexpr llvm::StringLiteral OptionNames[] = {
#define GET_CHECKER_OPTIONS
#define CHECKER_OPTION(TYPE, CHECKER, OPTION_NAME, DESCRIPTION, DEFAULT, \
RELEASE, HIDDEN) \
Twine(AnalyzerCheckNamePrefix).concat(CHECKER ":" OPTION_NAME).str(),
ANALYZER_CHECK_NAME_PREFIX CHECKER ":" OPTION_NAME,

#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
#undef CHECKER_OPTION
#undef GET_CHECKER_OPTIONS
}) {
Result.Options.insert(OptionName);
}
};

Result.Options.insert_range(OptionNames);
#endif // CLANG_TIDY_ENABLE_STATIC_ANALYZER

Context.setOptionsCollector(&Result.Options);
Expand Down