aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/DwarfEHPrepare.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-03-27 01:22:38 +0000
committerBill Wendling <isanbard@gmail.com>2010-03-27 01:22:38 +0000
commit43de15f8a356293dd1b1c4dd321f90802fff5ce3 (patch)
tree0203c3ed5955e30ef494e37601fee6b4bad6de65 /lib/CodeGen/DwarfEHPrepare.cpp
parentbfbd853958518981dc7a614a388bf93e1895d2b5 (diff)
Return if we changed anything or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99695 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfEHPrepare.cpp')
-rw-r--r--lib/CodeGen/DwarfEHPrepare.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp
index 1285fc8a34..5da3171518 100644
--- a/lib/CodeGen/DwarfEHPrepare.cpp
+++ b/lib/CodeGen/DwarfEHPrepare.cpp
@@ -86,7 +86,7 @@ namespace {
/// CleanupSelectors - Any remaining eh.selector intrinsic calls which still
/// use the ".llvm.eh.catch.all.value" call need to convert to using it's
/// initializer instead.
- void CleanupSelectors();
+ bool CleanupSelectors();
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow"
/// 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
/// the ".llvm.eh.catch.all.value" call need to convert to using it's
/// initializer instead.
-void DwarfEHPrepare::CleanupSelectors() {
+bool DwarfEHPrepare::CleanupSelectors() {
+ bool Changed = false;
for (Value::use_iterator
I = SelectorIntrinsic->use_begin(),
E = SelectorIntrinsic->use_end(); I != E; ++I) {
@@ -232,7 +233,10 @@ void DwarfEHPrepare::CleanupSelectors() {
GlobalVariable *GV = dyn_cast<GlobalVariable>(Sel->getOperand(OpIdx));
if (GV != EHCatchAllValue) continue;
Sel->setOperand(OpIdx, EHCatchAllValue->getInitializer());
+ Changed = true;
}
+
+ return Changed;
}
/// HandleURoRInvokes - Handle invokes of "_Unwind_Resume_or_Rethrow" calls. The
@@ -254,19 +258,13 @@ bool DwarfEHPrepare::HandleURoRInvokes() {
if (!URoR) {
URoR = F->getParent()->getFunction("_Unwind_Resume_or_Rethrow");
- if (!URoR) {
- CleanupSelectors();
- return false;
- }
+ if (!URoR) return CleanupSelectors();
}
if (!ExceptionValueIntrinsic) {
ExceptionValueIntrinsic =
Intrinsic::getDeclaration(F->getParent(), Intrinsic::eh_exception);
- if (!ExceptionValueIntrinsic) {
- CleanupSelectors();
- return false;
- }
+ if (!ExceptionValueIntrinsic) return CleanupSelectors();
}
bool Changed = false;
@@ -337,7 +335,7 @@ bool DwarfEHPrepare::HandleURoRInvokes() {
}
}
- CleanupSelectors();
+ Changed |= CleanupSelectors();
return Changed;
}