Remember to clear the maximal sets between functions.

Thanks to Nicholas for valgrinding this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37646 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2007-06-19 04:32:55 +00:00
parent 086f5f350b
commit 6cae7409b1

View File

@ -297,6 +297,8 @@ ValueTable::Expression ValueTable::create_expression(CmpInst* C) {
void ValueTable::clear() {
valueNumbering.clear();
expressionNumbering.clear();
maximalExpressions.clear();
maximalValues.clear();
nextValueNumber = 1;
}
@ -306,10 +308,9 @@ namespace {
bool runOnFunction(Function &F);
public:
static char ID; // Pass identification, replacement for typeid
GVNPRE() : FunctionPass((intptr_t)&ID) { nextValueNumber = 1; }
GVNPRE() : FunctionPass((intptr_t)&ID) { }
private:
uint32_t nextValueNumber;
ValueTable VN;
std::vector<Instruction*> createdExpressions;