summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/ArgumentPromotion.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-02-01 20:37:16 +0000
committerDuncan Sands <baldrick@free.fr>2008-02-01 20:37:16 +0000
commit532d022794beabceae09c7fcc222a6e4e929c748 (patch)
tree9c8e2d8ab59bcac9bacac204bcd36fad3b60d7c0 /lib/Transforms/IPO/ArgumentPromotion.cpp
parent8e3425082079e83a43b1c60e921ce7db00f17ddc (diff)
downloadllvm-532d022794beabceae09c7fcc222a6e4e929c748.tar.gz
llvm-532d022794beabceae09c7fcc222a6e4e929c748.tar.bz2
llvm-532d022794beabceae09c7fcc222a6e4e929c748.tar.xz
Don't drop function/call return attributes like 'nounwind'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r--lib/Transforms/IPO/ArgumentPromotion.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 3ac1c7bb2b..4486677e63 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -404,6 +404,10 @@ Function *ArgPromotion::DoPromotion(Function *F,
ParamAttrsVector ParamAttrsVec;
const ParamAttrsList *PAL = F->getParamAttrs();
+ // Add any return attributes.
+ if (unsigned attrs = PAL ? PAL->getParamAttrs(0) : 0)
+ ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
+
unsigned ArgIndex = 1;
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E;
++I, ++ArgIndex) {
@@ -491,6 +495,10 @@ Function *ArgPromotion::DoPromotion(Function *F,
Instruction *Call = CS.getInstruction();
PAL = CS.getParamAttrs();
+ // Add any return attributes.
+ if (unsigned attrs = PAL ? PAL->getParamAttrs(0) : 0)
+ ParamAttrsVec.push_back(ParamAttrsWithIndex::get(0, attrs));
+
// Loop over the operands, inserting GEP and loads in the caller as
// appropriate.
CallSite::arg_iterator AI = CS.arg_begin();