void ento::registerUninitializedObjectChecker(CheckerManager &Mgr) { auto Chk = Mgr.registerChecker<UninitializedObjectChecker>(); Chk->IsPedantic = Mgr.getAnalyzerOptions().getBooleanOption( "Pedantic", /*DefaultVal*/ false, Chk); Chk->ShouldConvertNotesToWarnings = Mgr.getAnalyzerOptions().getBooleanOption( "NotesAsWarnings", /*DefaultVal*/ false, Chk); Chk->CheckPointeeInitialization = Mgr.getAnalyzerOptions().getBooleanOption( "CheckPointeeInitialization", /*DefaultVal*/ false, Chk); }
void ento::registerCastSizeChecker(CheckerManager &mgr) { // PR31226: C++ is more complicated than what this checker currently supports. // There are derived-to-base casts, there are different rules for 0-size // structures, no flexible arrays, etc. // FIXME: Disabled on C++ for now. if (!mgr.getLangOpts().CPlusPlus) mgr.registerChecker<CastSizeChecker>(); }
void ento::registerObjCDeallocChecker(CheckerManager &Mgr) { const LangOptions &LangOpts = Mgr.getLangOpts(); // These checker only makes sense under MRR. if (LangOpts.getGC() == LangOptions::GCOnly || LangOpts.ObjCAutoRefCount) return; Mgr.registerChecker<ObjCDeallocChecker>(); }
void ento::registerGTestChecker(CheckerManager &Mgr) { const LangOptions &LangOpts = Mgr.getLangOpts(); // gtest is a C++ API so there is no sense running the checker // if not compiling for C++. if (!LangOpts.CPlusPlus) return; Mgr.registerChecker<GTestChecker>(); }
void CheckerRegistry::initializeManager(CheckerManager &checkerMgr, SmallVectorImpl<CheckerOptInfo> &opts) const { // Sort checkers for efficient collection. std::sort(Checkers.begin(), Checkers.end(), checkerNameLT); // Collect checkers enabled by the options. CheckerInfoSet enabledCheckers; for (SmallVectorImpl<CheckerOptInfo>::iterator i = opts.begin(), e = opts.end(); i != e; ++i) { collectCheckers(Checkers, Packages, *i, enabledCheckers); } // Initialize the CheckerManager with all enabled checkers. for (CheckerInfoSet::iterator i = enabledCheckers.begin(), e = enabledCheckers.end(); i != e; ++i) { checkerMgr.setCurrentCheckName(CheckName((*i)->FullName)); (*i)->Initialize(checkerMgr); } }
void ento::registerMoveChecker(CheckerManager &mgr) { MoveChecker *chk = mgr.registerChecker<MoveChecker>(); chk->setAggressiveness( mgr.getAnalyzerOptions().getCheckerStringOption("WarnOn", "", chk)); }
void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) { if (mgr.getLangOpts().getGC() != LangOptions::NonGC) mgr.registerChecker<NSAutoreleasePoolChecker>(); }
void ento::registerObjCSuperDeallocChecker(CheckerManager &Mgr) { const LangOptions &LangOpts = Mgr.getLangOpts(); if (LangOpts.getGC() == LangOptions::GCOnly || LangOpts.ObjCAutoRefCount) return; Mgr.registerChecker<ObjCSuperDeallocChecker>(); }
void ento::registerObjCAtSyncChecker(CheckerManager &mgr) { if (mgr.getLangOptions().ObjC2) mgr.registerChecker<ObjCAtSyncChecker>(); }
void ento::registerNumberObjectConversionChecker(CheckerManager &Mgr) { NumberObjectConversionChecker *Chk = Mgr.registerChecker<NumberObjectConversionChecker>(); Chk->Pedantic = Mgr.getAnalyzerOptions().getCheckerBooleanOption("Pedantic", false, Chk); }
void ento::registerMoveChecker(CheckerManager &mgr) { MoveChecker *chk = mgr.registerChecker<MoveChecker>(); chk->setAggressiveness( mgr.getAnalyzerOptions().getCheckerStringOption(chk, "WarnOn", "KnownsAndLocals"), mgr); }
void ento::registerTrustNonnullChecker(CheckerManager &Mgr) { Mgr.registerChecker<TrustNonnullChecker>(Mgr.getASTContext()); }