From 00157f3ae8298ae81c017abc65760fb3fa604f8a Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 6 May 2015 18:45:24 +0000 Subject: [PATCH] [WinEH] Improve fatal error message about failed demotion git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236626 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/WinEHPrepare.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/WinEHPrepare.cpp b/lib/CodeGen/WinEHPrepare.cpp index 2c72a556f75..f9497a3d989 100644 --- a/lib/CodeGen/WinEHPrepare.cpp +++ b/lib/CodeGen/WinEHPrepare.cpp @@ -1732,7 +1732,12 @@ Value *WinEHFrameVariableMaterializer::materializeValueFor(Value *V) { } if (isa(V) || isa(V)) { - errs() << "Failed to demote instruction used in exception handler:\n"; + Function *Parent = isa(V) + ? cast(V)->getParent()->getParent() + : cast(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"); } -- 2.34.1