diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-06-29 21:58:54 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-06-29 21:58:54 +0000 |
commit | 090d62e7cc53dddb451a120d3d10dd84a296e465 (patch) | |
tree | f3f87af215fe54ffc6891f24bfdbaa1a345c8e67 /clang | |
parent | c728518bfefd2bff34a198a8fe7de9e80a5cb1f1 (diff) | |
download | bcm5719-llvm-090d62e7cc53dddb451a120d3d10dd84a296e465.tar.gz bcm5719-llvm-090d62e7cc53dddb451a120d3d10dd84a296e465.zip |
Tweaker Checker::VisitEndAnalysis to have 'hasWorkRemaining' also
be true if some paths were aborted because they exceeded
the maximum loop unrolling count.
llvm-svn: 107209
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Checker/PathSensitive/GRCoreEngine.h | 10 | ||||
-rw-r--r-- | clang/lib/Checker/GRCoreEngine.cpp | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/clang/include/clang/Checker/PathSensitive/GRCoreEngine.h b/clang/include/clang/Checker/PathSensitive/GRCoreEngine.h index 2d8afeeb0da..936f18b97b5 100644 --- a/clang/include/clang/Checker/PathSensitive/GRCoreEngine.h +++ b/clang/include/clang/Checker/PathSensitive/GRCoreEngine.h @@ -57,6 +57,10 @@ class GRCoreEngine { /// These are used to record for key nodes in the ExplodedGraph the /// number of times different CFGBlocks have been visited along a path. GRBlockCounter::Factory BCounterFactory; + + /// A flag that indicates whether paths were halted because + /// ProcessBlockEntrace returned false. + bool BlockAborted; void GenerateNode(const ProgramPoint& Loc, const GRState* State, ExplodedNode* Pred); @@ -108,14 +112,16 @@ public: GRCoreEngine(ASTContext& ctx, GRSubEngine& subengine) : SubEngine(subengine), G(new ExplodedGraph(ctx)), WList(GRWorkList::MakeBFS()), - BCounterFactory(G->getAllocator()) {} + BCounterFactory(G->getAllocator()), + BlockAborted(false) {} /// Construct a GRCoreEngine object to analyze the provided CFG and to /// use the provided worklist object to execute the worklist algorithm. /// The GRCoreEngine object assumes ownership of 'wlist'. GRCoreEngine(ASTContext& ctx, GRWorkList* wlist, GRSubEngine& subengine) : SubEngine(subengine), G(new ExplodedGraph(ctx)), WList(wlist), - BCounterFactory(G->getAllocator()) {} + BCounterFactory(G->getAllocator()), + BlockAborted(false) {} ~GRCoreEngine() { delete WList; diff --git a/clang/lib/Checker/GRCoreEngine.cpp b/clang/lib/Checker/GRCoreEngine.cpp index 36f330303c3..a816186a307 100644 --- a/clang/lib/Checker/GRCoreEngine.cpp +++ b/clang/lib/Checker/GRCoreEngine.cpp @@ -221,7 +221,7 @@ bool GRCoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps) { } } - SubEngine.ProcessEndWorklist(WList->hasWork()); + SubEngine.ProcessEndWorklist(WList->hasWork() || BlockAborted); return WList->hasWork(); } @@ -258,7 +258,10 @@ void GRCoreEngine::HandleBlockEdge(const BlockEdge& L, ExplodedNode* Pred) { // FIXME: Should we allow ProcessBlockEntrance to also manipulate state? if (ProcessBlockEntrance(Blk, Pred, WList->getBlockCounter())) - GenerateNode(BlockEntrance(Blk, Pred->getLocationContext()), Pred->State, Pred); + GenerateNode(BlockEntrance(Blk, Pred->getLocationContext()), + Pred->State, Pred); + else + BlockAborted = true; } void GRCoreEngine::HandleBlockEntrance(const BlockEntrance& L, |