[llvm] r236626 - [WinEH] Improve fatal error message about failed demotion

Reid Kleckner reid at kleckner.net
Wed May 6 11:45:24 PDT 2015


Author: rnk
Date: Wed May  6 13:45:24 2015
New Revision: 236626

URL: http://llvm.org/viewvc/llvm-project?rev=236626&view=rev
Log:
[WinEH] Improve fatal error message about failed demotion

Modified:
    llvm/trunk/lib/CodeGen/WinEHPrepare.cpp

Modified: llvm/trunk/lib/CodeGen/WinEHPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/WinEHPrepare.cpp?rev=236626&r1=236625&r2=236626&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/WinEHPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/WinEHPrepare.cpp Wed May  6 13:45:24 2015
@@ -1732,7 +1732,12 @@ Value *WinEHFrameVariableMaterializer::m
   }
 
   if (isa<Instruction>(V) || isa<Argument>(V)) {
-    errs() << "Failed to demote instruction used in exception handler:\n";
+    Function *Parent = isa<Instruction>(V)
+                           ? cast<Instruction>(V)->getParent()->getParent()
+                           : cast<Argument>(V)->getParent();
+    errs()
+        << "Failed to demote instruction used in exception handler of function "
+        << GlobalValue::getRealLinkageName(Parent->getName()) << ":\n";
     errs() << "  " << *V << '\n';
     report_fatal_error("WinEHPrepare failed to demote instruction");
   }





More information about the llvm-commits mailing list