mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-18 13:34:04 +00:00
Return if we changed anything or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99695 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bfbd853958
commit
43de15f8a3
@ -86,7 +86,7 @@ namespace {
|
|||||||
/// CleanupSelectors - Any remaining eh.selector intrinsic calls which still
|
/// CleanupSelectors - Any remaining eh.selector intrinsic calls which still
|
||||||
/// use the ".llvm.eh.catch.all.value" call need to convert to using it's
|
/// use the ".llvm.eh.catch.all.value" call need to convert to using it's
|
||||||
/// initializer instead.
|
/// initializer instead.
|
||||||
void CleanupSelectors();
|
bool CleanupSelectors();
|
||||||
|
|
||||||
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow"
|
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow"
|
||||||
/// calls. The "unwind" part of these invokes jump to a landing pad within
|
/// calls. The "unwind" part of these invokes jump to a landing pad within
|
||||||
@ -220,7 +220,8 @@ DwarfEHPrepare::FindSelectorAndURoR(Instruction *Inst, bool &URoRInvoke,
|
|||||||
/// CleanupSelectors - Any remaining eh.selector intrinsic calls which still use
|
/// CleanupSelectors - Any remaining eh.selector intrinsic calls which still use
|
||||||
/// the ".llvm.eh.catch.all.value" call need to convert to using it's
|
/// the ".llvm.eh.catch.all.value" call need to convert to using it's
|
||||||
/// initializer instead.
|
/// initializer instead.
|
||||||
void DwarfEHPrepare::CleanupSelectors() {
|
bool DwarfEHPrepare::CleanupSelectors() {
|
||||||
|
bool Changed = false;
|
||||||
for (Value::use_iterator
|
for (Value::use_iterator
|
||||||
I = SelectorIntrinsic->use_begin(),
|
I = SelectorIntrinsic->use_begin(),
|
||||||
E = SelectorIntrinsic->use_end(); I != E; ++I) {
|
E = SelectorIntrinsic->use_end(); I != E; ++I) {
|
||||||
@ -232,7 +233,10 @@ void DwarfEHPrepare::CleanupSelectors() {
|
|||||||
GlobalVariable *GV = dyn_cast<GlobalVariable>(Sel->getOperand(OpIdx));
|
GlobalVariable *GV = dyn_cast<GlobalVariable>(Sel->getOperand(OpIdx));
|
||||||
if (GV != EHCatchAllValue) continue;
|
if (GV != EHCatchAllValue) continue;
|
||||||
Sel->setOperand(OpIdx, EHCatchAllValue->getInitializer());
|
Sel->setOperand(OpIdx, EHCatchAllValue->getInitializer());
|
||||||
|
Changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" calls. The
|
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" calls. The
|
||||||
@ -254,19 +258,13 @@ 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) {
|
if (!URoR) return CleanupSelectors();
|
||||||
CleanupSelectors();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ExceptionValueIntrinsic) {
|
if (!ExceptionValueIntrinsic) {
|
||||||
ExceptionValueIntrinsic =
|
ExceptionValueIntrinsic =
|
||||||
Intrinsic::getDeclaration(F->getParent(), Intrinsic::eh_exception);
|
Intrinsic::getDeclaration(F->getParent(), Intrinsic::eh_exception);
|
||||||
if (!ExceptionValueIntrinsic) {
|
if (!ExceptionValueIntrinsic) return CleanupSelectors();
|
||||||
CleanupSelectors();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
@ -337,7 +335,7 @@ bool DwarfEHPrepare::HandleURoRInvokes() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CleanupSelectors();
|
Changed |= CleanupSelectors();
|
||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user