summaryrefslogtreecommitdiff
path: root/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-07-06 00:29:58 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-07-06 00:29:58 +0000
commitdc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed (patch)
tree1838b5d8368383a083fad1cdca2fe777528e5a69 /lib/IR/Attributes.cpp
parent202eb7b18e220205ec86a03ddf18f2066c70ab15 (diff)
downloadllvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.gz
llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.bz2
llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.xz
Extend 'readonly' and 'readnone' to work on function arguments as well as
functions. Make the function attributes pass add it to known library functions and when it can deduce it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Attributes.cpp')
-rw-r--r--lib/IR/Attributes.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/IR/Attributes.cpp b/lib/IR/Attributes.cpp
index 2160ea2464..59da815663 100644
--- a/lib/IR/Attributes.cpp
+++ b/lib/IR/Attributes.cpp
@@ -1157,6 +1157,8 @@ AttributeSet AttributeFuncs::typeIncompatible(Type *Ty, uint64_t Index) {
.addAttribute(Attribute::Nest)
.addAttribute(Attribute::NoAlias)
.addAttribute(Attribute::NoCapture)
+ .addAttribute(Attribute::ReadNone)
+ .addAttribute(Attribute::ReadOnly)
.addAttribute(Attribute::StructRet);
return AttributeSet::get(Ty->getContext(), Index, Incompatible);