summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/PruneEH.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-19 21:13:37 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-19 21:13:37 +0000
commitaa31b92508bf121b5a58be4cd794f16225f07f2d (patch)
treeebdbd951790a83af69a87d51cc4e71b049da6458 /llvm/lib/Transforms/IPO/PruneEH.cpp
parenta246e09aa019e2048063dfd28765cf46417fc7f1 (diff)
downloadbcm5719-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/IPO/PruneEH.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/PruneEH.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/PruneEH.cpp b/llvm/lib/Transforms/IPO/PruneEH.cpp
index 69bb1f67c74..529f98e504b 100644
--- a/llvm/lib/Transforms/IPO/PruneEH.cpp
+++ b/llvm/lib/Transforms/IPO/PruneEH.cpp
@@ -122,17 +122,15 @@ bool PruneEH::runOnSCC(const std::vector<CallGraphNode *> &SCC) {
// If the SCC doesn't unwind or doesn't throw, note this fact.
if (!SCCMightUnwind || !SCCMightReturn)
for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
- const ParamAttrsList *PAL = SCC[i]->getFunction()->getParamAttrs();
- uint16_t RAttributes = PAL ? PAL->getParamAttrs(0) : 0;
+ uint16_t NewAttributes = ParamAttr::None;
if (!SCCMightUnwind)
- RAttributes |= ParamAttr::NoUnwind;
+ NewAttributes |= ParamAttr::NoUnwind;
if (!SCCMightReturn)
- RAttributes |= ParamAttr::NoReturn;
+ NewAttributes |= ParamAttr::NoReturn;
- ParamAttrsVector modVec;
- modVec.push_back(ParamAttrsWithIndex::get(0, RAttributes));
- PAL = ParamAttrsList::getModified(PAL, modVec);
+ const ParamAttrsList *PAL = SCC[i]->getFunction()->getParamAttrs();
+ PAL = ParamAttrsList::includeAttrs(PAL, 0, NewAttributes);
SCC[i]->getFunction()->setParamAttrs(PAL);
}
OpenPOWER on IntegriCloud