[llvm-commits] [llvm] r61978 - /llvm/trunk/include/llvm/Instructions.h
Chris Lattner
sabre at nondot.org
Thu Jan 8 21:27:41 PST 2009
Author: lattner
Date: Thu Jan 8 23:27:40 2009
New Revision: 61978
URL: http://llvm.org/viewvc/llvm-project?rev=61978&view=rev
Log:
add a helper method.
Modified:
llvm/trunk/include/llvm/Instructions.h
Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=61978&r1=61977&r2=61978&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Thu Jan 8 23:27:40 2009
@@ -531,6 +531,13 @@
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;
More information about the llvm-commits
mailing list