diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-08-30 19:26:43 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-08-30 19:26:43 +0000 |
commit | 255d4d4226b24036ceb11228fbb74286e58620f7 (patch) | |
tree | d667f680eb74d887a063dc4f7695bb0732619d2e /lib/StaticAnalyzer/Core/ExprEngine.cpp | |
parent | 5705a40c7ec62f1a903bf26e1e6a7f91b5b98ba3 (diff) |
Store const& to AnalyzerOptions in AnalysisManager instead of copying
individual flags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngine.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 6603b6ca5d..5f52724ab9 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -70,12 +70,12 @@ ExprEngine::ExprEngine(AnalysisManager &mgr, bool gcEnabled, currStmt(NULL), currStmtIdx(0), currBldrCtx(0), NSExceptionII(NULL), NSExceptionInstanceRaiseSelectors(NULL), RaiseSel(GetNullarySelector("raise", getContext())), - ObjCGCEnabled(gcEnabled), BR(mgr, *this) { - - if (mgr.shouldEagerlyTrimExplodedGraph()) { - // Enable eager node reclaimation when constructing the ExplodedGraph. - G.enableNodeReclamation(); - } + ObjCGCEnabled(gcEnabled), BR(mgr, *this) +{ + if (mgr.options.eagerlyTrimExplodedGraph) { + // Enable eager node reclaimation when constructing the ExplodedGraph. + G.enableNodeReclamation(); + } } ExprEngine::~ExprEngine() { @@ -228,7 +228,7 @@ static bool shouldRemoveDeadBindings(AnalysisManager &AMgr, const LocationContext *LC) { // Are we never purging state values? - if (AMgr.getPurgeMode() == PurgeNone) + if (AMgr.options.AnalysisPurgeOpt == PurgeNone) return false; // Is this the beginning of a basic block? @@ -704,7 +704,7 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred, Bldr.takeNodes(Pred); - if (AMgr.shouldEagerlyAssume() && + if (AMgr.options.EagerlyAssume && (B->isRelationalOp() || B->isEqualityOp())) { ExplodedNodeSet Tmp; VisitBinaryOperator(cast<BinaryOperator>(S), Pred, Tmp); @@ -924,7 +924,7 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred, case Stmt::UnaryOperatorClass: { Bldr.takeNodes(Pred); const UnaryOperator *U = cast<UnaryOperator>(S); - if (AMgr.shouldEagerlyAssume() && (U->getOpcode() == UO_LNot)) { + if (AMgr.options.EagerlyAssume && (U->getOpcode() == UO_LNot)) { ExplodedNodeSet Tmp; VisitUnaryOperator(U, Pred, Tmp); evalEagerlyAssume(Dst, Tmp, U); @@ -1024,7 +1024,7 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L, // FIXME: Refactor this into a checker. ExplodedNode *pred = nodeBuilder.getContext().getPred(); - if (nodeBuilder.getContext().blockCount() >= AMgr.getMaxVisit()) { + if (nodeBuilder.getContext().blockCount() >= AMgr.options.MaxLoop) { static SimpleProgramPointTag tag("ExprEngine : Block count exceeded"); const ExplodedNode *Sink = nodeBuilder.generateSink(pred->getState(), pred, &tag); @@ -1042,7 +1042,8 @@ 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.NoRetryExhausted && replayWithoutInlining(pred, CalleeLC))) + if ((!AMgr.options.NoRetryExhausted && + replayWithoutInlining(pred, CalleeLC))) return; NumMaxBlockCountReachedInInlined++; } else |