Extend 'readonly' and 'readnone' to work on function arguments as well as
[oota-llvm.git] / lib / IR / Attributes.cpp
index 2160ea24641cffaa01c4af19fc62df8716abd976..59da815663dadc98cdf21605964754671c60e89e 100644 (file)
@@ -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);