Add MachineFunction::verify() to call the machine code verifier directly.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 13 Nov 2009 21:56:09 +0000 (21:56 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 13 Nov 2009 21:56:09 +0000 (21:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88706 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineFunction.h
lib/CodeGen/MachineVerifier.cpp

index e836e2ef15b87d8790bbc473f49de53c598b4006..d05d994f0ccfbc3374bdad526a2f8d750b784b96 100644 (file)
@@ -232,6 +232,10 @@ public:
   ///
   void dump() const;
 
+  /// verify - Run the current MachineFunction through the machine code
+  /// verifier, useful for debugger use.
+  void verify() const;
+
   // Provide accessors for the MachineBasicBlock list...
   typedef BasicBlockListType::iterator iterator;
   typedef BasicBlockListType::const_iterator const_iterator;
index c056d1c7e5afef7b4d7c9227b4d12f9f115a3029..be9f68f6a725ae504576f3521b91bfe17263a177 100644 (file)
@@ -175,6 +175,10 @@ FunctionPass *llvm::createMachineVerifierPass(bool allowPhysDoubleDefs) {
   return new MachineVerifier(allowPhysDoubleDefs);
 }
 
+void MachineFunction::verify() const {
+  MachineVerifier().runOnMachineFunction(const_cast<MachineFunction&>(*this));
+}
+
 bool MachineVerifier::runOnMachineFunction(MachineFunction &MF) {
   raw_ostream *OutFile = 0;
   if (OutFileName) {