plug a little memleak in verifyFunction()

# first commit to llvm, so whatch out :)

llvm-svn: 55631
This commit is contained in:
Nuno Lopes 2008-09-02 11:30:10 +00:00
parent d63db4063a
commit 99341f2d9d
1 changed files with 3 additions and 1 deletions

View File

@ -1512,10 +1512,12 @@ bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) {
Function &F = const_cast<Function&>(f);
assert(!F.isDeclaration() && "Cannot verify external functions");
FunctionPassManager FPM(new ExistingModuleProvider(F.getParent()));
ExistingModuleProvider MP(F.getParent());
FunctionPassManager FPM(&MP);
Verifier *V = new Verifier(action);
FPM.add(V);
FPM.run(F);
MP.releaseModule();
return V->Broken;
}