summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-11-11 23:17:02 +0000
committerBill Wendling <isanbard@gmail.com>2009-11-11 23:17:02 +0000
commit7a6b11e70762d02a7526790a54fd205ae3f420ba (patch)
tree572af9187a4822ffc735ff9aa1f262381f42eaf3
parent92ebab90fef301cca9d8e4455c41beaa23b5e5d0 (diff)
downloadbcm5719-llvm-7a6b11e70762d02a7526790a54fd205ae3f420ba.tar.gz
bcm5719-llvm-7a6b11e70762d02a7526790a54fd205ae3f420ba.zip
Don't mark a call as potentially throwing if the function it's calling has the
"nounwind" attribute. llvm-svn: 86897
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index b07c95bb599..693dcc2466d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -490,7 +490,27 @@ ComputeCallSiteTable(SmallVectorImpl<CallSiteEntry> &CallSites,
for (MachineBasicBlock::const_iterator MI = I->begin(), E = I->end();
MI != E; ++MI) {
if (!MI->isLabel()) {
- SawPotentiallyThrowing |= MI->getDesc().isCall();
+ if (MI->getDesc().isCall()) {
+ // Don't mark a call as potentially throwing if the function it's
+ // calling is marked "nounwind".
+ bool DoesNotThrow = false;
+ for (unsigned OI = 0, OE = MI->getNumOperands(); OI != OE; ++OI) {
+ const MachineOperand &MO = MI->getOperand(OI);
+
+ if (MO.isGlobal()) {
+ if (Function *F = dyn_cast<Function>(MO.getGlobal())) {
+ if (F->doesNotThrow()) {
+ DoesNotThrow = true;
+ break;
+ }
+ }
+ }
+ }
+
+ if (!DoesNotThrow)
+ SawPotentiallyThrowing = true;
+ }
+
continue;
}
OpenPOWER on IntegriCloud