diff options
author | Peter Szecsi <szepet95@gmail.com> | 2017-07-20 07:35:11 +0000 |
---|---|---|
committer | Peter Szecsi <szepet95@gmail.com> | 2017-07-20 07:35:11 +0000 |
commit | 58a8b6b4af16bb59ef94038c6aff48745c4266d4 (patch) | |
tree | 43bc7c62714536fc48b294831665429a7bb98285 /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | |
parent | 33225ef314503cfc0aa744a3199c86e9887e9eec (diff) | |
download | bcm5719-llvm-58a8b6b4af16bb59ef94038c6aff48745c4266d4.tar.gz bcm5719-llvm-58a8b6b4af16bb59ef94038c6aff48745c4266d4.zip |
Revert "[StaticAnalyzer] Completely unrolling specific loops with known bound option"
Revert r308561 and r308558.
Clang-ppc64be-linux seems to crash while running the test cases.
llvm-svn: 308592
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 409fe173e26..eee5400fe17 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -17,7 +17,6 @@ #include "PrettyStackTraceLocationContext.h" #include "clang/AST/CharUnits.h" #include "clang/AST/ParentMap.h" -#include "clang/Analysis/CFGStmtMap.h" #include "clang/AST/StmtCXX.h" #include "clang/AST/StmtObjC.h" #include "clang/Basic/Builtins.h" @@ -28,7 +27,6 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h" -#include "clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/SaveAndRestore.h" #include "llvm/Support/raw_ostream.h" @@ -1499,27 +1497,6 @@ void ExprEngine::processCFGBlockEntrance(const BlockEdge &L, NodeBuilderWithSinks &nodeBuilder, ExplodedNode *Pred) { PrettyStackTraceLocationContext CrashInfo(Pred->getLocationContext()); - // If we reach a loop which has a known bound (and meets - // other constraints) then consider completely unrolling it. - if (AMgr.options.shouldUnrollLoops()) { - const CFGBlock *ActualBlock = nodeBuilder.getContext().getBlock(); - const Stmt *Term = ActualBlock->getTerminator(); - if (Term && shouldCompletelyUnroll(Term, AMgr.getASTContext())) { - ProgramStateRef UnrolledState = - markLoopAsUnrolled(Term, Pred->getState(), - Pred->getLocationContext() - ->getAnalysisDeclContext() - ->getCFGStmtMap()); - if (UnrolledState != Pred->getState()) - nodeBuilder.generateNode(UnrolledState, Pred); - return; - } - - if (isUnrolledLoopBlock(ActualBlock, Pred)) - return; - if (ActualBlock->empty()) - return; - } // If this block is terminated by a loop and it has already been visited the // maximum number of times, widen the loop. @@ -1687,6 +1664,7 @@ void ExprEngine::processBranch(const Stmt *Condition, const Stmt *Term, const LocationContext *LCtx = Pred->getLocationContext(); PrettyStackTraceLocationContext StackCrashInfo(LCtx); currBldrCtx = &BldCtx; + // Check for NULL conditions; e.g. "for(;;)" if (!Condition) { BranchNodeBuilder NullCondBldr(Pred, Dst, BldCtx, DstT, DstF); |