[WinEH] Improve fatal error message about failed demotion

llvm-svn: 236626
This commit is contained in:
Reid Kleckner 2015-05-06 18:45:24 +00:00
parent f9f62b116f
commit d1b38c4b0b
1 changed files with 6 additions and 1 deletions

View File

@ -1732,7 +1732,12 @@ Value *WinEHFrameVariableMaterializer::materializeValueFor(Value *V) {
} }
if (isa<Instruction>(V) || isa<Argument>(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'; errs() << " " << *V << '\n';
report_fatal_error("WinEHPrepare failed to demote instruction"); report_fatal_error("WinEHPrepare failed to demote instruction");
} }