mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-02 17:58:26 +00:00
Don't mark a call as potentially throwing if the function it's calling has the
"nounwind" attribute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86897 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9089ba8e5e
commit
73b5551058
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user