[llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Mar 13 21:17:02 PST 2004
Changes in directory llvm/lib/VMCore:
Verifier.cpp updated: 1.86 -> 1.87
---
Log message:
verifyFunction has been broken for a long time now. Fix it.
---
Diffs of the changes: (+8 -12)
Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.86 llvm/lib/VMCore/Verifier.cpp:1.87
--- llvm/lib/VMCore/Verifier.cpp:1.86 Fri Mar 12 18:24:00 2004
+++ llvm/lib/VMCore/Verifier.cpp Sat Mar 13 21:16:15 2004
@@ -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 @@
// 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.
More information about the llvm-commits
mailing list