This may be an ARM target, so check for _Unwind_SjLj_Resume.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117643 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2010-10-29 07:46:01 +00:00
parent b087c8490f
commit 49ad731adf

View File

@ -43,7 +43,7 @@ namespace {
// The eh.selector intrinsic. // The eh.selector intrinsic.
Function *SelectorIntrinsic; Function *SelectorIntrinsic;
// _Unwind_Resume_or_Rethrow call. // _Unwind_Resume_or_Rethrow or _Unwind_SjLj_Resume call.
Constant *URoR; Constant *URoR;
// The EH language-specific catch-all type. // The EH language-specific catch-all type.
@ -82,11 +82,11 @@ namespace {
/// FindAllURoRInvokes - Find all URoR invokes in the function. /// FindAllURoRInvokes - Find all URoR invokes in the function.
void FindAllURoRInvokes(SmallPtrSet<InvokeInst*, 32> &URoRInvokes); void FindAllURoRInvokes(SmallPtrSet<InvokeInst*, 32> &URoRInvokes);
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" /// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" or
/// calls. The "unwind" part of these invokes jump to a landing pad within /// "_Unwind_SjLj_Resume" calls. The "unwind" part of these invokes jump to
/// the current function. This is a candidate to merge the selector /// a landing pad within the current function. This is a candidate to merge
/// associated with the URoR invoke with the one from the URoR's landing /// the selector associated with the URoR invoke with the one from the
/// pad. /// URoR's landing pad.
bool HandleURoRInvokes(); bool HandleURoRInvokes();
/// FindSelectorAndURoR - Find the eh.selector call and URoR call associated /// FindSelectorAndURoR - Find the eh.selector call and URoR call associated
@ -226,10 +226,11 @@ DwarfEHPrepare::FindSelectorAndURoR(Instruction *Inst, bool &URoRInvoke,
return Changed; return Changed;
} }
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" calls. The /// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" or
/// "unwind" part of these invokes jump to a landing pad within the current /// "_Unwind_SjLj_Resume" calls. The "unwind" part of these invokes jump to a
/// function. This is a candidate to merge the selector associated with the URoR /// landing pad within the current function. This is a candidate to merge the
/// invoke with the one from the URoR's landing pad. /// selector associated with the URoR invoke with the one from the URoR's
/// landing pad.
bool DwarfEHPrepare::HandleURoRInvokes() { bool DwarfEHPrepare::HandleURoRInvokes() {
if (!EHCatchAllValue) { if (!EHCatchAllValue) {
EHCatchAllValue = EHCatchAllValue =
@ -249,8 +250,11 @@ bool DwarfEHPrepare::HandleURoRInvokes() {
if (!URoR) { if (!URoR) {
URoR = F->getParent()->getFunction("_Unwind_Resume_or_Rethrow"); URoR = F->getParent()->getFunction("_Unwind_Resume_or_Rethrow");
if (!URoR) {
URoR = F->getParent()->getFunction("_Unwind_SjLj_Resume");
if (!URoR) return CleanupSelectors(CatchAllSels); if (!URoR) return CleanupSelectors(CatchAllSels);
} }
}
SmallPtrSet<InvokeInst*, 32> URoRInvokes; SmallPtrSet<InvokeInst*, 32> URoRInvokes;
FindAllURoRInvokes(URoRInvokes); FindAllURoRInvokes(URoRInvokes);