martong created this revision. martong added reviewers: NoQ, steakhal. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a project: All. martong requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Since D113753 <https://reviews.llvm.org/D113753>, we simplify the symbols right at the beginning of evalBinOpNN. Since D114938 <https://reviews.llvm.org/D114938>, we do the simplification until a fix-point is reached. These changes renders the two workarounds introduced in D47155 <https://reviews.llvm.org/D47155> and in D51252 <https://reviews.llvm.org/D51252> superfluous. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D126560 Files: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp Index: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -1190,7 +1190,6 @@ const llvm::APSInt *SimpleSValBuilder::getKnownValue(ProgramStateRef state, SVal V) { - V = simplifySVal(state, V); if (V.isUnknownOrUndef()) return nullptr; @@ -1376,14 +1375,6 @@ SVal VisitSVal(SVal V) { return V; } }; - // A crude way of preventing this function from calling itself from evalBinOp. - static bool isReentering = false; - if (isReentering) - return V; - - isReentering = true; SVal SimplifiedV = Simplifier(State).Visit(V); - isReentering = false; - return SimplifiedV; }
Index: clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp =================================================================== --- clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -1190,7 +1190,6 @@ const llvm::APSInt *SimpleSValBuilder::getKnownValue(ProgramStateRef state, SVal V) { - V = simplifySVal(state, V); if (V.isUnknownOrUndef()) return nullptr; @@ -1376,14 +1375,6 @@ SVal VisitSVal(SVal V) { return V; } }; - // A crude way of preventing this function from calling itself from evalBinOp. - static bool isReentering = false; - if (isReentering) - return V; - - isReentering = true; SVal SimplifiedV = Simplifier(State).Visit(V); - isReentering = false; - return SimplifiedV; }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits