Add a print method to MachineFunctionProperties for better error messages

This makes check failures much easier to understand.
Make it empty (but leave it in the class) for NDEBUG builds.

Differential Revision: http://reviews.llvm.org/D18529

llvm-svn: 264780
diff --git a/llvm/lib/CodeGen/MachineFunctionPass.cpp b/llvm/lib/CodeGen/MachineFunctionPass.cpp
index bd0b11a..f6cb36e 100644
--- a/llvm/lib/CodeGen/MachineFunctionPass.cpp
+++ b/llvm/lib/CodeGen/MachineFunctionPass.cpp
@@ -44,8 +44,18 @@
   MachineFunction &MF = getAnalysis<MachineFunctionAnalysis>().getMF();
   MachineFunctionProperties &MFProps = MF.getProperties();
 
-  assert(MFProps.verifyRequiredProperties(RequiredProperties) &&
-         "Properties required by the pass are not met by the function");
+#ifndef NDEBUG
+  if (!MFProps.verifyRequiredProperties(RequiredProperties)) {
+    errs() << "MachineFunctionProperties required by " << getPassName()
+           << " pass are not met by function " << F.getName() << ".\n"
+           << "Required properties: ";
+    RequiredProperties.print(errs());
+    errs() << "\nCurrent properties: ";
+    MFProps.print(errs());
+    errs() << "\n";
+    llvm_unreachable("MachineFunctionProperties check failed");
+  }
+#endif
 
   bool RV = runOnMachineFunction(MF);