[analyzer] Optimize by not generating empty transitions in CheckerContext

Go not generate a new transition by addTransition methods if nothing changed.

llvm-svn: 143091
This commit is contained in:
Anna Zaks 2011-10-27 00:59:32 +00:00
parent 0ec04bf738
commit 71fe3b45ec
1 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,6 @@ public:
/// \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 @@ private:
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);