diff options
| author | Duncan Sands <baldrick@free.fr> | 2007-12-19 21:13:37 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2007-12-19 21:13:37 +0000 |
| commit | aa31b92508bf121b5a58be4cd794f16225f07f2d (patch) | |
| tree | ebdbd951790a83af69a87d51cc4e71b049da6458 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp | |
| parent | a246e09aa019e2048063dfd28765cf46417fc7f1 (diff) | |
| download | bcm5719-llvm-aa31b92508bf121b5a58be4cd794f16225f07f2d.tar.gz bcm5719-llvm-aa31b92508bf121b5a58be4cd794f16225f07f2d.zip | |
When inlining through an 'nounwind' call, mark inlined
calls 'nounwind'. It is important for correct C++
exception handling that nounwind markings do not get
lost, so this transformation is actually needed for
correctness.
llvm-svn: 45218
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 166b4844403..d7c492383f8 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -8026,16 +8026,9 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { } } - if (isa<InlineAsm>(Callee) && !CS.paramHasAttr(0, ParamAttr::NoUnwind)) { + if (isa<InlineAsm>(Callee) && !CS.doesNotThrow()) { // Inline asm calls cannot throw - mark them 'nounwind'. - const ParamAttrsList *PAL = CS.getParamAttrs(); - uint16_t RAttributes = PAL ? PAL->getParamAttrs(0) : 0; - RAttributes |= ParamAttr::NoUnwind; - - ParamAttrsVector modVec; - modVec.push_back(ParamAttrsWithIndex::get(0, RAttributes)); - PAL = ParamAttrsList::getModified(PAL, modVec); - CS.setParamAttrs(PAL); + CS.setDoesNotThrow(); Changed = true; } |

