diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-05-06 17:41:54 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-05-06 17:41:54 +0000 |
| commit | 06cf33fbea70f2672e814d82ad9005b9f9e6c6e8 (patch) | |
| tree | 49b97516fcbd1921645bf26a225aa311b114aa23 /llvm/lib/IR/Function.cpp | |
| parent | e7f46558a46878901072dc5cb452f3c2bd0ac181 (diff) | |
| download | bcm5719-llvm-06cf33fbea70f2672e814d82ad9005b9f9e6c6e8.tar.gz bcm5719-llvm-06cf33fbea70f2672e814d82ad9005b9f9e6c6e8.zip | |
Add missing dereferenceable_or_null getters
Summary: Add missing dereferenceable_or_null getters required for
http://reviews.llvm.org/D9253 change. Separated from the D9253 review.
Patch by Artur Pilipenko!
Reviewers: sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9499
llvm-svn: 236615
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
| -rw-r--r-- | llvm/lib/IR/Function.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index ced989ab11d..aea4bf52701 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -117,6 +117,12 @@ uint64_t Argument::getDereferenceableBytes() const { return getParent()->getDereferenceableBytes(getArgNo()+1); } +uint64_t Argument::getDereferenceableOrNullBytes() const { + assert(getType()->isPointerTy() && + "Only pointers have dereferenceable bytes"); + return getParent()->getDereferenceableOrNullBytes(getArgNo()+1); +} + /// hasNestAttr - Return true if this argument has the nest attribute on /// it in its containing function. bool Argument::hasNestAttr() const { |

