Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { | ||||
CheckFactories.registerCheck<UseTrailingReturnTypeCheck>( | CheckFactories.registerCheck<UseTrailingReturnTypeCheck>( | ||||
"modernize-use-trailing-return-type"); | "modernize-use-trailing-return-type"); | ||||
CheckFactories.registerCheck<UseTransparentFunctorsCheck>( | CheckFactories.registerCheck<UseTransparentFunctorsCheck>( | ||||
"modernize-use-transparent-functors"); | "modernize-use-transparent-functors"); | ||||
CheckFactories.registerCheck<UseUncaughtExceptionsCheck>( | CheckFactories.registerCheck<UseUncaughtExceptionsCheck>( | ||||
"modernize-use-uncaught-exceptions"); | "modernize-use-uncaught-exceptions"); | ||||
CheckFactories.registerCheck<UseUsingCheck>("modernize-use-using"); | CheckFactories.registerCheck<UseUsingCheck>("modernize-use-using"); | ||||
} | } | ||||
ClangTidyOptions getModuleOptions() override { | |||||
ClangTidyOptions Options; | |||||
auto &Opts = Options.CheckOptions; | |||||
// For types whose size in bytes is above this threshold, we prefer taking a | |||||
// const-reference than making a copy. | |||||
Opts["modernize-loop-convert.MaxCopySize"] = "16"; | |||||
Opts["modernize-loop-convert.MinConfidence"] = "reasonable"; | |||||
Opts["modernize-loop-convert.NamingStyle"] = "CamelCase"; | |||||
Opts["modernize-pass-by-value.IncludeStyle"] = "llvm"; // Also: "google". | |||||
Opts["modernize-replace-auto-ptr.IncludeStyle"] = "llvm"; // Also: "google". | |||||
// Comma-separated list of macros that behave like NULL. | |||||
Opts["modernize-use-nullptr.NullMacros"] = "NULL"; | |||||
return Options; | |||||
} | |||||
}; | }; | ||||
// Register the ModernizeTidyModule using this statically initialized variable. | // Register the ModernizeTidyModule using this statically initialized variable. | ||||
static ClangTidyModuleRegistry::Add<ModernizeModule> X("modernize-module", | static ClangTidyModuleRegistry::Add<ModernizeModule> X("modernize-module", | ||||
"Add modernize checks."); | "Add modernize checks."); | ||||
} // namespace modernize | } // namespace modernize | ||||
// This anchor is used to force the linker to link in the generated object file | // This anchor is used to force the linker to link in the generated object file | ||||
// and thus register the ModernizeModule. | // and thus register the ModernizeModule. | ||||
volatile int ModernizeModuleAnchorSource = 0; | volatile int ModernizeModuleAnchorSource = 0; | ||||
} // namespace clang::tidy | } // namespace clang::tidy |