コード例 #1
0
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);
}
コード例 #2
0
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>();
}
コード例 #3
0
ファイル: CheckObjCDealloc.cpp プロジェクト: Bekenn/clang
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>();
}
コード例 #4
0
ファイル: GTestChecker.cpp プロジェクト: kraj/clang
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>();
}
コード例 #5
0
ファイル: CheckerRegistry.cpp プロジェクト: adevress/root-1
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);
  }
}
コード例 #6
0
void ento::registerMoveChecker(CheckerManager &mgr) {
  MoveChecker *chk = mgr.registerChecker<MoveChecker>();
  chk->setAggressiveness(
      mgr.getAnalyzerOptions().getCheckerStringOption("WarnOn", "", chk));
}
コード例 #7
0
void ento::registerNSAutoreleasePoolChecker(CheckerManager &mgr) {
  if (mgr.getLangOpts().getGC() != LangOptions::NonGC)
    mgr.registerChecker<NSAutoreleasePoolChecker>();
}
コード例 #8
0
void ento::registerObjCSuperDeallocChecker(CheckerManager &Mgr) {
  const LangOptions &LangOpts = Mgr.getLangOpts();
  if (LangOpts.getGC() == LangOptions::GCOnly || LangOpts.ObjCAutoRefCount)
    return;
  Mgr.registerChecker<ObjCSuperDeallocChecker>();
}
コード例 #9
0
void ento::registerObjCAtSyncChecker(CheckerManager &mgr) {
  if (mgr.getLangOptions().ObjC2)
    mgr.registerChecker<ObjCAtSyncChecker>();
}
コード例 #10
0
void ento::registerNumberObjectConversionChecker(CheckerManager &Mgr) {
  NumberObjectConversionChecker *Chk =
      Mgr.registerChecker<NumberObjectConversionChecker>();
  Chk->Pedantic =
      Mgr.getAnalyzerOptions().getCheckerBooleanOption("Pedantic", false, Chk);
}
コード例 #11
0
ファイル: MoveChecker.cpp プロジェクト: ingowald/llvm-project
void ento::registerMoveChecker(CheckerManager &mgr) {
  MoveChecker *chk = mgr.registerChecker<MoveChecker>();
  chk->setAggressiveness(
      mgr.getAnalyzerOptions().getCheckerStringOption(chk, "WarnOn",
                                                      "KnownsAndLocals"), mgr);
}
コード例 #12
0
void ento::registerTrustNonnullChecker(CheckerManager &Mgr) {
  Mgr.registerChecker<TrustNonnullChecker>(Mgr.getASTContext());
}