[llvm-commits] [llvm] r80503 - /llvm/trunk/include/llvm/Instructions.h
Chris Lattner
sabre at nondot.org
Sun Aug 30 12:45:21 PDT 2009
Author: lattner
Date: Sun Aug 30 14:45:21 2009
New Revision: 80503
URL: http://llvm.org/viewvc/llvm-project?rev=80503&view=rev
Log:
add a "getPointerAddressSpace" helper method to LoadInst and StoreInst.
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=80503&r1=80502&r2=80503&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Sun Aug 30 14:45:21 2009
@@ -277,6 +277,11 @@
const Value *getPointerOperand() const { return getOperand(0); }
static unsigned getPointerOperandIndex() { return 0U; }
+ unsigned getPointerAddressSpace() const {
+ return cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
+ }
+
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const LoadInst *) { return true; }
static inline bool classof(const Instruction *I) {
@@ -341,6 +346,10 @@
const Value *getPointerOperand() const { return getOperand(1); }
static unsigned getPointerOperandIndex() { return 1U; }
+ unsigned getPointerAddressSpace() const {
+ return cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
+ }
+
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const StoreInst *) { return true; }
static inline bool classof(const Instruction *I) {
More information about the llvm-commits
mailing list