Fix memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38469 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2007-07-09 20:52:39 +00:00
parent 93f81e2822
commit b42295df4d
2 changed files with 8 additions and 5 deletions

View File

@ -130,8 +130,14 @@ public:
}
// Access AnalysisResolver
inline void setResolver(AnalysisResolver *AR) { Resolver = AR; }
inline AnalysisResolver *getResolver() { return Resolver; }
inline void setResolver(AnalysisResolver *AR) {
assert (!Resolver && "Resolver is already set");
Resolver = AR;
}
inline AnalysisResolver *getResolver() {
assert (Resolver && "Resolver is not set");
return Resolver;
}
/// getAnalysisUsage - This function should be overriden by passes that need
/// analysis information to do their job. If a pass specifies that it uses a

View File

@ -1380,9 +1380,6 @@ void PMStack::push(Pass *P) {
PM->setTopLevelManager(TPM);
}
AnalysisResolver *AR = new AnalysisResolver(*Top);
P->setResolver(AR);
S.push_back(PM);
}