diff options
-rw-r--r-- | include/clang/Driver/CC1Options.td | 4 | ||||
-rw-r--r-- | include/clang/Frontend/AnalyzerOptions.h | 4 | ||||
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h | 8 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 6 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Core/AnalysisManager.cpp | 6 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngine.cpp | 2 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 2 | ||||
-rw-r--r-- | test/Analysis/coverage.c | 2 |
8 files changed, 17 insertions, 17 deletions
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 956f2a65ce..18caca6df1 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -99,8 +99,8 @@ def analyzer_inlining_mode : Separate<"-analyzer-inlining-mode">, HelpText<"Specify the function selection heuristic used during inlining">; def analyzer_inlining_mode_EQ : Joined<"-analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>; -def analyzer_retry_exhausted : Flag<"-analyzer-retry-exhausted">, - HelpText<"Re-analyze paths leading to exhausted nodes with a different strategy for better code coverage">; +def analyzer_disable_retry_exhausted : Flag<"-analyzer-disable-retry-exhausted">, + HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">; def analyzer_max_nodes : Separate<"-analyzer-max-nodes">, HelpText<"The maximum number of nodes the analyzer can generate (150000 default, 0 = no limit)">; diff --git a/include/clang/Frontend/AnalyzerOptions.h b/include/clang/Frontend/AnalyzerOptions.h index f152f63968..847bfbd64b 100644 --- a/include/clang/Frontend/AnalyzerOptions.h +++ b/include/clang/Frontend/AnalyzerOptions.h @@ -99,7 +99,7 @@ public: unsigned CFGAddInitializers : 1; unsigned EagerlyTrimEGraph : 1; unsigned PrintStats : 1; - unsigned RetryExhausted : 1; + unsigned NoRetryExhausted : 1; unsigned InlineMaxStackDepth; unsigned InlineMaxFunctionSize; AnalysisInliningMode InliningMode; @@ -124,7 +124,7 @@ public: CFGAddInitializers = 0; EagerlyTrimEGraph = 0; PrintStats = 0; - RetryExhausted = 0; + NoRetryExhausted = 0; // Cap the stack depth at 4 calls (5 stack frames, base + 4 calls). InlineMaxStackDepth = 5; InlineMaxFunctionSize = 200; diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h b/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h index b77e069041..be4c649133 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h @@ -91,9 +91,9 @@ public: /// \brief The mode of function selection used during inlining. AnalysisInliningMode InliningMode; - /// \brief Re-analyze paths leading to exhausted nodes with a different - /// strategy for better code coverage. - bool RetryExhausted; + /// \brief Do not re-analyze paths leading to exhausted nodes with a different + /// strategy. We get better code coverage when retry is enabled. + bool NoRetryExhausted; public: AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags, @@ -112,7 +112,7 @@ public: unsigned inlineMaxStack, unsigned inlineMaxFunctionSize, AnalysisInliningMode inliningMode, - bool retry); + bool NoRetry); /// Construct a clone of the given AnalysisManager with the given ASTContext /// and DiagnosticsEngine. diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 48b8049cd0..6e36242be2 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -167,8 +167,8 @@ static void AnalyzerOptsToArgs(const AnalyzerOptions &Opts, ToArgsList &Res) { Res.push_back("-analyzer-viz-egraph-graphviz"); if (Opts.VisualizeEGUbi) Res.push_back("-analyzer-viz-egraph-ubigraph"); - if (Opts.RetryExhausted) - Res.push_back("-analyzer-retry-exhausted"); + if (Opts.NoRetryExhausted) + Res.push_back("-analyzer-disable-retry-exhausted"); for (unsigned i = 0, e = Opts.CheckersControlList.size(); i != e; ++i) { const std::pair<std::string, bool> &opt = Opts.CheckersControlList[i]; @@ -1016,7 +1016,7 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args, Opts.ShowCheckerHelp = Args.hasArg(OPT_analyzer_checker_help); Opts.VisualizeEGDot = Args.hasArg(OPT_analyzer_viz_egraph_graphviz); Opts.VisualizeEGUbi = Args.hasArg(OPT_analyzer_viz_egraph_ubigraph); - Opts.RetryExhausted = Args.hasArg(OPT_analyzer_retry_exhausted); + Opts.NoRetryExhausted = Args.hasArg(OPT_analyzer_disable_retry_exhausted); Opts.AnalyzeAll = Args.hasArg(OPT_analyzer_opt_analyze_headers); Opts.AnalyzerDisplayProgress = Args.hasArg(OPT_analyzer_display_progress); Opts.AnalyzeNestedBlocks = diff --git a/lib/StaticAnalyzer/Core/AnalysisManager.cpp b/lib/StaticAnalyzer/Core/AnalysisManager.cpp index 057a5d490a..82ac8bda02 100644 --- a/lib/StaticAnalyzer/Core/AnalysisManager.cpp +++ b/lib/StaticAnalyzer/Core/AnalysisManager.cpp @@ -34,7 +34,7 @@ AnalysisManager::AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags, unsigned inlineMaxStack, unsigned inlineMaxFunctionSize, AnalysisInliningMode IMode, - bool retry) + bool NoRetry) : AnaCtxMgr(useUnoptimizedCFG, addImplicitDtors, addInitializers), Ctx(ctx), Diags(diags), LangOpts(lang), PD(pd), CreateStoreMgr(storemgr), CreateConstraintMgr(constraintmgr), @@ -47,7 +47,7 @@ AnalysisManager::AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags, InlineMaxStackDepth(inlineMaxStack), InlineMaxFunctionSize(inlineMaxFunctionSize), InliningMode(IMode), - RetryExhausted(retry) + NoRetryExhausted(NoRetry) { AnaCtxMgr.getCFGBuildOptions().setAllAlwaysAdd(); } @@ -76,7 +76,7 @@ AnalysisManager::AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags, InlineMaxStackDepth(ParentAM.InlineMaxStackDepth), InlineMaxFunctionSize(ParentAM.InlineMaxFunctionSize), InliningMode(ParentAM.InliningMode), - RetryExhausted(ParentAM.RetryExhausted) + NoRetryExhausted(ParentAM.NoRetryExhausted) { AnaCtxMgr.getCFGBuildOptions().setAllAlwaysAdd(); } diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index a53ffd4eb5..fc2a756eb3 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -1053,7 +1053,7 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L, // no-inlining policy in the state and enqueuing the new work item on // the list. Replay should almost never fail. Use the stats to catch it // if it does. - if ((AMgr.RetryExhausted && replayWithoutInlining(pred, CalleeLC))) + if ((!AMgr.NoRetryExhausted && replayWithoutInlining(pred, CalleeLC))) return; NumMaxBlockCountReachedInInlined++; } else diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 3665955d61..b1d2f31df0 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -204,7 +204,7 @@ public: Opts.InlineMaxStackDepth, Opts.InlineMaxFunctionSize, Opts.InliningMode, - Opts.RetryExhausted)); + Opts.NoRetryExhausted)); } virtual void HandleTranslationUnit(ASTContext &C); diff --git a/test/Analysis/coverage.c b/test/Analysis/coverage.c index 2e85b7f61d..73d78da186 100644 --- a/test/Analysis/coverage.c +++ b/test/Analysis/coverage.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -analyzer-max-loop 4 -analyzer-retry-exhausted -verify %s +// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc -analyzer-store=region -analyzer-max-loop 4 -verify %s #include "system-header-simulator.h" typedef __typeof(sizeof(int)) size_t; |