Skip to content
Snippets Groups Projects
Commit df95d146 authored by Anna Zaks's avatar Anna Zaks
Browse files

[analyzer] Optimize by not generating empty transitions in CheckerContext

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143091 91177308-0d34-0410-b5e6-96231b3b80d8
parent 4d2ae4a7
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment