From 607bfadd8c586981eb395e7e8d5a352d262eadc1 Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Sat, 3 Aug 2002 13:22:36 +0000 Subject: [PATCH] Add MemAccessInst::getNumIndices(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3234 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/iMemory.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h index 1820e3c6b21..3b4a18bed0a 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: