Author: zaks
Date: Wed Oct 26 19:59:32 2011
New Revision: 143091
URL: http://llvm.org/viewvc/llvm-project?rev=143091&view=rev
Log:
[analyzer] Optimize by not generating empty transitions in CheckerContext
Go not generate a new transition by addTransition methods if nothing changed.
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h?rev=143091&r1=143090&r2=143091&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
(original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
Wed Oct 26 19:59:32 2011
@@ -110,7 +110,6 @@
/// \brief Generates a default transition (containing checker tag but no
/// checker state changes).
- // TODO: Can we remove this one? We always generate autotransitions.
ExplodedNode *addTransition() {
return addTransition(getState());
}
@@ -148,6 +147,9 @@
ExplodedNode *P = 0,
const ProgramPointTag *Tag = 0) {
assert(State);
+ if (State == Pred->getState() && !Tag && !MarkAsSink)
+ return Pred;
+
ExplodedNode *node = NB.generateNode(Tag ? Location.withTag(Tag) :
Location,
State,
P ? P : Pred, MarkAsSink);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits