[llvm] r203490 - IR: Slightly more verbose error in Verifier

Justin Bogner mail at justinbogner.com
Mon Mar 10 14:22:44 PDT 2014


Author: bogner
Date: Mon Mar 10 16:22:44 2014
New Revision: 203490

URL: http://llvm.org/viewvc/llvm-project?rev=203490&view=rev
Log:
IR: Slightly more verbose error in Verifier

Extend the error message generated by the Verifier when an intrinsic
name does not match the expected mangling to include the expected
name.  Simplifies debugging.

Patch by Philip Reames!

Modified:
    llvm/trunk/lib/IR/Verifier.cpp

Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=203490&r1=203489&r2=203490&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Mon Mar 10 16:22:44 2014
@@ -2239,8 +2239,10 @@ void Verifier::visitIntrinsicFunctionCal
   // know they are legal for the intrinsic!) get the intrinsic name through the
   // usual means.  This allows us to verify the mangling of argument types into
   // the name.
-  Assert1(Intrinsic::getName(ID, ArgTys) == IF->getName(),
-          "Intrinsic name not mangled correctly for type arguments!", IF);
+  const std::string ExpectedName = Intrinsic::getName(ID, ArgTys);
+  Assert1(ExpectedName == IF->getName(),
+          "Intrinsic name not mangled correctly for type arguments! "
+          "Should be: " + ExpectedName, IF);
 
   // If the intrinsic takes MDNode arguments, verify that they are either global
   // or are local to *this* function.





More information about the llvm-commits mailing list