Lines Matching +full:case +full:- +full:sensitive

1 //===--- AnalysisConsumer.cpp - ASTConsumer for running Analyses ----------===//
8 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
68 //===----------------------------------------------------------------------===//
70 //===----------------------------------------------------------------------===//
117 SourceLocation WarnLoc = PD->getLocation().asLocation(); in FlushDiagnosticsImpl()
118 Diag.Report(WarnLoc, WarnID) << PD->getShortDescription() in FlushDiagnosticsImpl()
119 << PD->path.back()->getRanges(); in FlushDiagnosticsImpl()
124 PathPieces FlatPath = PD->path.flatten(/*ShouldFlattenMacros=*/true); in FlushDiagnosticsImpl()
128 SourceLocation NoteLoc = (*PI)->getLocation().asLocation(); in FlushDiagnosticsImpl()
129 Diag.Report(NoteLoc, NoteID) << (*PI)->getString() in FlushDiagnosticsImpl()
130 << (*PI)->getRanges(); in FlushDiagnosticsImpl()
137 //===----------------------------------------------------------------------===//
139 //===----------------------------------------------------------------------===//
166 /// Note, we pre-compute the local declarations at parse time as an
196 if (Opts->PrintStats) { in AnalysisConsumer()
203 if (Opts->PrintStats) in ~AnalysisConsumer()
208 if (Opts->AnalysisDiagOpt != PD_NONE) { in DigestAnalyzerOptions()
214 if (Opts->AnalysisDiagOpt == PD_TEXT) { in DigestAnalyzerOptions()
215 clangDiags->enablePaths(); in DigestAnalyzerOptions()
218 switch (Opts->AnalysisDiagOpt) { in DigestAnalyzerOptions()
221 case PD_##NAME: \ in DigestAnalyzerOptions()
230 switch (Opts->AnalysisStoreOpt) { in DigestAnalyzerOptions()
234 case NAME##Model: CreateStoreMgr = CREATEFN; break; in DigestAnalyzerOptions()
238 switch (Opts->AnalysisConstraintsOpt) { in DigestAnalyzerOptions()
242 case NAME##Model: CreateConstraintMgr = CREATEFN; break; in DigestAnalyzerOptions()
249 if (!Opts->AnalyzerDisplayProgress) in DisplayFunction()
252 SourceManager &SM = Mgr->getASTContext().getSourceManager(); in DisplayFunction()
253 PresumedLoc Loc = SM.getPresumedLoc(D->getLocation()); in DisplayFunction()
262 case ExprEngine::Inline_Minimal: in DisplayFunction()
265 case ExprEngine::Inline_Regular: in DisplayFunction()
284 Selector S = MD->getSelector(); in DisplayFunction()
301 /// (Doing this pre-processing avoids deserialization of data from PCH.)
317 /// \brief Run analyzes(syntax or path sensitive) on the given function.
318 /// \param Mode - determines if we are requesting syntax only or path
319 /// sensitive only analysis.
320 /// \param VisitedCallees - The output parameter, which is populated with the
341 checkerMgr->runCheckersOnASTDecl(D, *Mgr, *RecVisitorBR); in VisitDecl()
346 IdentifierInfo *II = FD->getIdentifier(); in VisitFunctionDecl()
347 if (II && II->getName().startswith("__inline")) in VisitFunctionDecl()
352 if (FD->isThisDeclarationADefinition() && in VisitFunctionDecl()
353 !FD->isDependentContext()) { in VisitFunctionDecl()
354 assert(RecVisitorMode == AM_Syntax || Mgr->shouldInlineCall() == false); in VisitFunctionDecl()
361 if (MD->isThisDeclarationADefinition()) { in VisitObjCMethodDecl()
362 assert(RecVisitorMode == AM_Syntax || Mgr->shouldInlineCall() == false); in VisitObjCMethodDecl()
369 if (BD->hasBody()) { in VisitBlockDecl()
370 assert(RecVisitorMode == AM_Syntax || Mgr->shouldInlineCall() == false); in VisitBlockDecl()
373 if (!BD->isDependentContext()) { in VisitBlockDecl()
394 //===----------------------------------------------------------------------===//
396 //===----------------------------------------------------------------------===//
426 // We want to re-analyse the functions as top level in the following cases: in shouldSkipFunction()
427 // - The 'init' methods should be reanalyzed because in shouldSkipFunction()
431 // - We want to reanalyze all ObjC methods as top level to report Retain in shouldSkipFunction()
450 if (ObjCM->getMethodFamily() != OMF_init) in getInliningModeForFunction()
481 Decl *D = N->getDecl(); in HandleDeclsCallGraph()
496 (Mgr->options.InliningMode == All ? nullptr : &VisitedCallees)); in HandleDeclsCallGraph()
515 if (Opts->DisableAllChecks) in HandleTranslationUnit()
519 if (TUTotalTimer) TUTotalTimer->startTimer(); in HandleTranslationUnit()
524 checkerMgr->runCheckersOnASTDecl(TU, *Mgr, BR); in HandleTranslationUnit()
526 // Run the AST-only checks using the order in which functions are defined. in HandleTranslationUnit()
528 // sensitive analyzes as well. in HandleTranslationUnit()
530 if (!Mgr->shouldInlineCall()) in HandleTranslationUnit()
545 if (Mgr->shouldInlineCall()) in HandleTranslationUnit()
549 checkerMgr->runCheckersOnEndOfTranslationUnit(TU, *Mgr, BR); in HandleTranslationUnit()
556 // side-effects in PathDiagnosticConsumer's destructor. This is required when in HandleTranslationUnit()
557 // used with option -disable-free. in HandleTranslationUnit()
560 if (TUTotalTimer) TUTotalTimer->stopTimer(); in HandleTranslationUnit()
573 return ID->getSelector().getAsString(); in getFunctionName()
576 IdentifierInfo *II = ND->getIdentifier(); in getFunctionName()
578 return II->getName(); in getFunctionName()
585 if (!Opts->AnalyzeSpecificFunction.empty() && in getModeForDecl()
586 getFunctionName(D) != Opts->AnalyzeSpecificFunction) in getModeForDecl()
589 // Unless -analyze-all is specified, treat decls differently depending on in getModeForDecl()
591 // - Main source file: run both path-sensitive and non-path-sensitive checks. in getModeForDecl()
592 // - Header files: run non-path-sensitive checks only. in getModeForDecl()
593 // - System headers: don't run any checks. in getModeForDecl()
594 SourceManager &SM = Ctx->getSourceManager(); in getModeForDecl()
595 const Stmt *Body = D->getBody(); in getModeForDecl()
596 SourceLocation SL = Body ? Body->getLocStart() : D->getLocation(); in getModeForDecl()
599 if (!Opts->AnalyzeAll && !SM.isWrittenInMainFile(SL)) { in getModeForDecl()
611 if (!D->hasBody()) in HandleCode()
618 CFG *DeclCFG = Mgr->getCFG(D); in HandleCode()
620 unsigned CFGSize = DeclCFG->size(); in HandleCode()
625 Mgr->ClearContexts(); in HandleCode()
629 checkerMgr->runCheckersOnASTBody(D, *Mgr, BR); in HandleCode()
630 if ((Mode & AM_Path) && checkerMgr->hasPathSensitiveCheckers()) { in HandleCode()
637 //===----------------------------------------------------------------------===//
638 // Path-sensitive checking.
639 //===----------------------------------------------------------------------===//
645 // FIXME: Inter-procedural analysis will need to handle invalid CFGs. in ActionExprEngine()
646 if (!Mgr->getCFG(D)) in ActionExprEngine()
650 if (!Mgr->getAnalysisDeclContext(D)->getAnalysis<RelaxedLiveVariables>()) in ActionExprEngine()
657 if (Mgr->options.visualizeExplodedGraphWithUbiGraph) { in ActionExprEngine()
663 Eng.ExecuteWorkList(Mgr->getAnalysisDeclContextManager().getStackFrame(D), in ActionExprEngine()
664 Mgr->options.getMaxNodesPerTopLevelFunction()); in ActionExprEngine()
671 if (Mgr->options.visualizeExplodedGraphWithGraphViz) in ActionExprEngine()
672 Eng.ViewGraph(Mgr->options.TrimGraph); in ActionExprEngine()
682 switch (Mgr->getLangOpts().getGC()) { in RunPathSensitiveChecks()
683 case LangOptions::NonGC: in RunPathSensitiveChecks()
687 case LangOptions::GCOnly: in RunPathSensitiveChecks()
691 case LangOptions::HybridGC: in RunPathSensitiveChecks()
698 //===----------------------------------------------------------------------===//
700 //===----------------------------------------------------------------------===//
704 // Disable the effects of '-Werror' when using the AnalysisConsumer. in CreateAnalysisConsumer()
708 bool hasModelPath = analyzerOpts->Config.count("model-path") > 0; in CreateAnalysisConsumer()
716 //===----------------------------------------------------------------------===//
718 //===----------------------------------------------------------------------===//
753 assert (Src != Dst && "Self-edges are not allowed."); in AddEdge()
764 SrcID = SrcI->second; in AddEdge()
776 DstID = DstI->second; in AddEdge()