diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-09 05:27:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-09 05:27:40 +0000 |
commit | 3bc6ced4c0c5685620990cf07cc6a7615cc253bc (patch) | |
tree | 76e478b87f31851ea977410180454bb372cc587e /include | |
parent | 6688d75114f8adbfdc9a337bfa4eb3a046eb946d (diff) | |
download | external_llvm-3bc6ced4c0c5685620990cf07cc6a7615cc253bc.zip external_llvm-3bc6ced4c0c5685620990cf07cc6a7615cc253bc.tar.gz external_llvm-3bc6ced4c0c5685620990cf07cc6a7615cc253bc.tar.bz2 |
add a helper method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Instructions.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 237c1a8..841cf9c 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -531,6 +531,13 @@ public: static unsigned getPointerOperandIndex() { return 0U; // get index for modifying correct operand } + + /// getPointerOperandType - Method to return the pointer operand as a + /// PointerType. + const PointerType *getPointerOperandType() const { + return reinterpret_cast<const PointerType*>(getPointerOperand()->getType()); + } + unsigned getNumIndices() const { // Note: always non-negative return getNumOperands() - 1; |