[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
This commit is contained in:
Reid Kleckner 2015-05-06 18:45:24 +00:00
parent 94c39f6914
commit 00157f3ae8

View File

@ -1732,7 +1732,12 @@ Value *WinEHFrameVariableMaterializer::materializeValueFor(Value *V) {
}
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");
}