diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-11-12 20:51:53 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-11-12 20:51:53 +0000 |
commit | e3ae25b3d8dc23844ffebe38a9d6af2c2072504d (patch) | |
tree | ae20f6f6518995a68c54cf5e610ca9b9690281f6 /llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | |
parent | 1fbe0544509ff3a4b9edcd2e0fb8fbab6ce1f5b1 (diff) | |
download | bcm5719-llvm-e3ae25b3d8dc23844ffebe38a9d6af2c2072504d.tar.gz bcm5719-llvm-e3ae25b3d8dc23844ffebe38a9d6af2c2072504d.zip |
If there's more than one function operand to a call instruction, be conservative
and don't assume that the call doesn't throw. It would be nice if there were a
way to determine which is the callee and which is a parameter. In practice, the
architecture we care about normally only have one operand for a call instruction
(x86 and arm).
llvm-svn: 87023
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp index 693dcc2466d..1ef34b96e0e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -494,14 +494,25 @@ ComputeCallSiteTable(SmallVectorImpl<CallSiteEntry> &CallSites, // Don't mark a call as potentially throwing if the function it's // calling is marked "nounwind". bool DoesNotThrow = false; + bool SawFunc = 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 (SawFunc) { + // Be conservative. If we have more than one function operand + // for this call, then we can't make the assumption that it's + // the callee and not a parameter to the call. + // + // FIXME: Determine if there's a way to say that `F' is the + // callee or parameter. + DoesNotThrow = false; + break; + } if (F->doesNotThrow()) { + SawFunc = true; DoesNotThrow = true; - break; } } } |