[llvm] r185775 - Add missing per-argument doesNotAccessMemory accessors. No functionality change
Nick Lewycky
nicholas at mxc.ca
Sun Jul 7 01:29:52 PDT 2013
Author: nicholas
Date: Sun Jul 7 03:29:51 2013
New Revision: 185775
URL: http://llvm.org/viewvc/llvm-project?rev=185775&view=rev
Log:
Add missing per-argument doesNotAccessMemory accessors. No functionality change
since it has no callers today.
Modified:
llvm/trunk/include/llvm/IR/Function.h
Modified: llvm/trunk/include/llvm/IR/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Function.h?rev=185775&r1=185774&r2=185775&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Function.h (original)
+++ llvm/trunk/include/llvm/IR/Function.h Sun Jul 7 03:29:51 2013
@@ -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);
More information about the llvm-commits
mailing list