diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-07-06 00:29:58 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-07-06 00:29:58 +0000 |
commit | dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed (patch) | |
tree | 1838b5d8368383a083fad1cdca2fe777528e5a69 /include/llvm/Support | |
parent | 202eb7b18e220205ec86a03ddf18f2066c70ab15 (diff) | |
download | external_llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.zip external_llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.gz external_llvm-dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed.tar.bz2 |
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 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/CallSite.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index 961c38e..2a1c5ca 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -257,6 +257,15 @@ public: return paramHasAttr(ArgNo + 1, Attribute::ByVal); } + bool doesNotAccessMemory(unsigned ArgNo) const { + return paramHasAttr(ArgNo + 1, Attribute::ReadNone); + } + + bool onlyReadsMemory(unsigned ArgNo) const { + return paramHasAttr(ArgNo + 1, Attribute::ReadOnly) || + paramHasAttr(ArgNo + 1, Attribute::ReadNone); + } + /// hasArgument - Returns true if this CallSite passes the given Value* as an /// argument to the called function. bool hasArgument(const Value *Arg) const { |