From: Rafael Espindola Date: Wed, 13 Nov 2013 13:44:11 +0000 (+0000) Subject: Don't call doFinalization from verifyFunction. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7af43e0ad01a5f85f9066b69faba990a72f89536;p=llvm Don't call doFinalization from verifyFunction. verifyFunction needs to call doInitialization to collect metadata and avoid crashing when verifying debug info in a function. But it should not call doFinalization since that is where the verifier will check declarations, variables and aliases, which is not desirable when one only wants to verify a function. A possible cleanup would be to split the class into a ModuleVerifier and FunctionVerifier. Issue reported by Ilia Filippov. Patch by Michael Kruse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194574 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index 4255cd2553b..1bb3e3423d4 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -2402,7 +2402,6 @@ bool llvm::verifyFunction(const Function &f, VerifierFailureAction action) { FPM.add(V); FPM.doInitialization(); FPM.run(F); - FPM.doFinalization(); return V->Broken; }