Add missing per-argument doesNotAccessMemory accessors. No functionality change
authorNick Lewycky <nicholas@mxc.ca>
Sun, 7 Jul 2013 08:29:51 +0000 (08:29 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sun, 7 Jul 2013 08:29:51 +0000 (08:29 +0000)
since it has no callers today.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185775 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Function.h

index cfb862d9b01b6568b0823eb9c989895826d9c225..455469d1fa0cfcfa22eb6017ec2b3f838cc612d7 100644 (file)
@@ -310,9 +310,16 @@ public:
     addAttribute(n, Attribute::NoCapture);
   }
 
+  bool doesNotAccessMemory(unsigned n) const {
+    return AttributeSets.hasAttribute(n, Attribute::ReadNone);
+  }
+  void setDoesNotAccessMemory(unsigned n) {
+    addAttribute(n, Attribute::ReadNone);
+  }
+
   bool onlyReadsMemory(unsigned n) const {
-    return AttributeSets.hasAttribute(n, Attribute::ReadOnly) ||
-           AttributeSets.hasAttribute(n, Attribute::ReadNone);
+    return doesNotAccessMemory(n) ||
+      AttributeSets.hasAttribute(n, Attribute::ReadOnly);
   }
   void setOnlyReadsMemory(unsigned n) {
     addAttribute(n, Attribute::ReadOnly);