aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-18 19:51:01 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-18 19:51:01 +0000
commit0ac86f0821a2ba7ae09793fee4451bef99e9b2f3 (patch)
tree93ed75ed88b0bd2498554aa0a361dd06d92e8ca0 /lib/CodeGen/CGCall.cpp
parent214399ebd73545dde02b4a45872e7ca9e1d9e742 (diff)
PR3835: Interaction with ABI structure passing can inhibit
readnone/readonly attributes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 9e52cbb79c..fd33b50e79 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1467,6 +1467,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
llvm::Attribute::StructRet |
llvm::Attribute::NoAlias));
++Index;
+ // sret disables readnone and readonly
+ FuncAttrs &= ~(llvm::Attribute::ReadOnly |
+ llvm::Attribute::ReadNone);
break;
case ABIArgInfo::Ignore:
@@ -1493,6 +1496,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
Attributes |= llvm::Attribute::ByVal;
Attributes |=
llvm::Attribute::constructAlignmentFromInt(AI.getIndirectAlign());
+ // byval disables readnone and readonly.
+ FuncAttrs &= ~(llvm::Attribute::ReadOnly |
+ llvm::Attribute::ReadNone);
break;
case ABIArgInfo::Direct: