git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236626
91177308-0d34-0410-b5e6-
96231b3b80d8
}
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");
}