Casting.h: Automatically handle isa<Base>(Derived).
[oota-llvm.git] / include / llvm / Operator.h
index 6cc82310fe28d720bcb9b38a7a9557ce3383f5a4..61ac163d4a153fd79318375cf06fd3d98e98d166 100644 (file)
@@ -16,6 +16,7 @@
 #define LLVM_OPERATOR_H
 
 #include "llvm/Constants.h"
+#include "llvm/DerivedTypes.h"
 #include "llvm/Instruction.h"
 #include "llvm/Type.h"
 
@@ -79,7 +80,7 @@ public:
   };
 
 private:
-  ~OverflowingBinaryOperator() LLVM_DELETED_FUNCTION;
+  ~OverflowingBinaryOperator(); // DO NOT IMPLEMENT
 
   friend class BinaryOperator;
   friend class ConstantExpr;
@@ -133,7 +134,7 @@ public:
   };
   
 private:
-  ~PossiblyExactOperator() LLVM_DELETED_FUNCTION;
+  ~PossiblyExactOperator(); // DO NOT IMPLEMENT
 
   friend class BinaryOperator;
   friend class ConstantExpr;
@@ -170,7 +171,7 @@ public:
 /// information about relaxed accuracy requirements attached to them.
 class FPMathOperator : public Operator {
 private:
-  ~FPMathOperator() LLVM_DELETED_FUNCTION;
+  ~FPMathOperator(); // DO NOT IMPLEMENT
 
 public:
 
@@ -290,6 +291,12 @@ public:
     return getPointerOperand()->getType();
   }
 
+  /// getPointerAddressSpace - Method to return the address space of the
+  /// pointer operand.
+  unsigned getPointerAddressSpace() const {
+    return cast<PointerType>(getPointerOperandType())->getAddressSpace();
+  }
+
   unsigned getNumIndices() const {  // Note: always non-negative
     return getNumOperands() - 1;
   }