diff options
author | Duncan Sands <baldrick@free.fr> | 2008-02-01 20:37:16 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-02-01 20:37:16 +0000 |
commit | 9aa789fda3bc0ce46938e6afb5d71ac5e2df5298 (patch) | |
tree | 56bc0ac03983f086f1832fa870e4e9a2be612524 /llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | |
parent | edb5bc6f092b1de7807fb3433a58a16155fe7c85 (diff) | |
download | bcm5719-llvm-9aa789fda3bc0ce46938e6afb5d71ac5e2df5298.tar.gz bcm5719-llvm-9aa789fda3bc0ce46938e6afb5d71ac5e2df5298.zip |
Don't drop function/call return attributes like 'nounwind'.
llvm-svn: 46645
Diffstat (limited to 'llvm/lib/Transforms/IPO/ArgumentPromotion.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 3ac1c7bb2b2..4486677e630 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/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(); |