IR: Slightly more verbose error in Verifier
authorJustin Bogner <mail@justinbogner.com>
Mon, 10 Mar 2014 21:22:44 +0000 (21:22 +0000)
committerJustin Bogner <mail@justinbogner.com>
Mon, 10 Mar 2014 21:22:44 +0000 (21:22 +0000)
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!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203490 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Verifier.cpp

index f49cca5a3e3d030b941083f8ea182e0316f7ec23..158601226ab346a4eb588be69a47d63594caf287 100644 (file)
@@ -2239,8 +2239,10 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
   // 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.