forked from OSchip/llvm-project
[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:
parent
0ec04bf738
commit
71fe3b45ec
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue