[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / lib / Analysis / plugins / CheckerOptionHandling / CheckerOptionHandling.cpp
blob32fba9c93752c6598ed703406c52dbab06e6e2ba
1 #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
2 #include "clang/StaticAnalyzer/Core/Checker.h"
3 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
4 #include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
6 using namespace clang;
7 using namespace ento;
9 namespace {
10 struct MyChecker : public Checker<check::BeginFunction> {
11 void checkBeginFunction(CheckerContext &Ctx) const {}
14 void registerMyChecker(CheckerManager &Mgr) {
15 MyChecker *Checker = Mgr.registerChecker<MyChecker>();
16 llvm::outs() << "Example option is set to "
17 << (Mgr.getAnalyzerOptions().getCheckerBooleanOption(
18 Checker, "ExampleOption")
19 ? "true"
20 : "false")
21 << '\n';
24 bool shouldRegisterMyChecker(const CheckerManager &mgr) { return true; }
26 } // end anonymous namespace
28 // Register plugin!
29 extern "C" void clang_registerCheckers(CheckerRegistry &registry) {
30 registry.addChecker(registerMyChecker, shouldRegisterMyChecker,
31 "example.MyChecker", "Example Description",
32 "example.mychecker.documentation.nonexistent.html",
33 /*isHidden*/false);
35 registry.addCheckerOption(/*OptionType*/ "bool",
36 /*CheckerFullName*/ "example.MyChecker",
37 /*OptionName*/ "ExampleOption",
38 /*DefaultValStr*/ "false",
39 /*Description*/ "This is an example checker opt.",
40 /*DevelopmentStage*/ "released");
43 extern "C" const char clang_analyzerAPIVersionString[] =
44 CLANG_ANALYZER_API_VERSION_STRING;