diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-14 03:16:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-14 03:16:15 +0000 |
commit | 2eff85941f1262ed607b19a95475bdabe5ecf4f1 (patch) | |
tree | 9bdf3f4f0c6bcc5639d465b0f4ed24a3e67704dd /lib | |
parent | fc448061945ffdfc021107d758890a339778520b (diff) | |
download | external_llvm-2eff85941f1262ed607b19a95475bdabe5ecf4f1.zip external_llvm-2eff85941f1262ed607b19a95475bdabe5ecf4f1.tar.gz external_llvm-2eff85941f1262ed607b19a95475bdabe5ecf4f1.tar.bz2 |
verifyFunction has been broken for a long time now. Fix it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12377 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 1e3c3c7..768bf4d 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -44,6 +44,7 @@ #include "llvm/Constants.h" #include "llvm/Pass.h" #include "llvm/Module.h" +#include "llvm/ModuleProvider.h" #include "llvm/DerivedTypes.h" #include "llvm/Instructions.h" #include "llvm/Intrinsics.h" @@ -619,19 +620,14 @@ FunctionPass *llvm::createVerifierPass() { // verifyFunction - Create bool llvm::verifyFunction(const Function &f) { - Function &F = (Function&)f; + Function &F = const_cast<Function&>(f); assert(!F.isExternal() && "Cannot verify external functions"); - - DominatorSet DS; - DS.doInitialization(*F.getParent()); - DS.runOnFunction(F); - - Verifier V(DS); - V.runOnFunction(F); - - DS.doFinalization(*F.getParent()); - - return V.Broken; + + FunctionPassManager FPM(new ExistingModuleProvider(F.getParent())); + Verifier *V = new Verifier(); + FPM.add(V); + FPM.run(F); + return V->Broken; } /// verifyModule - Check a module for errors, printing messages on stderr. |