summaryrefslogtreecommitdiff
path: root/include/llvm/iMemory.h
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-08-03 13:22:36 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-08-03 13:22:36 +0000
commit607bfadd8c586981eb395e7e8d5a352d262eadc1 (patch)
tree5fa37a5e4804c5a2d998a7c5a197789c886018f2 /include/llvm/iMemory.h
parent900fd63d12f60075e47cd1ef0a25a61d9c5eeaa7 (diff)
downloadllvm-607bfadd8c586981eb395e7e8d5a352d262eadc1.tar.gz
llvm-607bfadd8c586981eb395e7e8d5a352d262eadc1.tar.bz2
llvm-607bfadd8c586981eb395e7e8d5a352d262eadc1.tar.xz
Add MemAccessInst::getNumIndices().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/iMemory.h')
-rw-r--r--include/llvm/iMemory.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h
index 1820e3c6b2..3b4a18bed0 100644
--- a/include/llvm/iMemory.h
+++ b/include/llvm/iMemory.h
@@ -173,8 +173,12 @@ public:
virtual unsigned getFirstIndexOperandNumber() const = 0;
+ inline unsigned getNumIndices() const { // Note: always non-negative
+ return (getNumOperands() - getFirstIndexOperandNumber());
+ }
+
inline bool hasIndices() const {
- return getNumOperands() > getFirstIndexOperandNumber();
+ return getNumIndices() > 0;
}
// Methods for support type inquiry through isa, cast, and dyn_cast: