forked from OSchip/llvm-project
Since the object is new'ed in the enterCFG function, now deleting in the exitCFG function instead of the destructor to ensure proper pairing. This allows reuse of the builder without creating a memory leak.
llvm-svn: 206471
This commit is contained in:
parent
664b1e2f9b
commit
ed5aced64e
|
@ -227,10 +227,6 @@ public:
|
||||||
SelfVar = new (Arena)til::Variable(til::Variable::VK_SFun);
|
SelfVar = new (Arena)til::Variable(til::Variable::VK_SFun);
|
||||||
}
|
}
|
||||||
|
|
||||||
~SExprBuilder() {
|
|
||||||
delete CallCtx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Translate a clang statement or expression to a TIL expression.
|
// Translate a clang statement or expression to a TIL expression.
|
||||||
// Also performs substitution of variables; Ctx provides the context.
|
// Also performs substitution of variables; Ctx provides the context.
|
||||||
// Dispatches on the type of S.
|
// Dispatches on the type of S.
|
||||||
|
|
|
@ -597,6 +597,7 @@ void SExprBuilder::exitCFG(const CFGBlock *Last) {
|
||||||
CurrentBlockID = 0;
|
CurrentBlockID = 0;
|
||||||
CurrentVarID = 0;
|
CurrentVarID = 0;
|
||||||
CurrentArgIndex = 0;
|
CurrentArgIndex = 0;
|
||||||
|
delete CallCtx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue