PTX: Add intrinsics to list of built-in intrinsics, which allows them to be
[oota-llvm.git] / include / llvm / IntrinsicInst.h
index 48f2da9b76c6dcf3d6dbfbf7f18a7c5fe92229f8..74c30fbddd725d045359ea86dec21e7d1fb7b27c 100644 (file)
@@ -55,7 +55,7 @@ namespace llvm {
       return isa<CallInst>(V) && classof(cast<CallInst>(V));
     }
   };
-
+  
   /// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
   ///
   class DbgInfoIntrinsic : public IntrinsicInst {
@@ -103,7 +103,7 @@ namespace llvm {
     Value *getValue();
     uint64_t getOffset() const {
       return cast<ConstantInt>(
-                             const_cast<Value*>(getArgOperand(1)))->getZExtValue();
+                          const_cast<Value*>(getArgOperand(1)))->getZExtValue();
     }
     MDNode *getVariable() const { return cast<MDNode>(getArgOperand(2)); }
 
@@ -139,6 +139,10 @@ namespace llvm {
       return !getVolatileCst()->isZero();
     }
 
+    unsigned getAddressSpace() const {
+      return cast<PointerType>(getRawDest()->getType())->getAddressSpace();
+    }
+
     /// getDest - This is just like getRawDest, but it strips off any cast
     /// instructions that feed it, giving the original input.  The returned
     /// value is guaranteed to be a pointer.
@@ -269,37 +273,28 @@ namespace llvm {
     }
   };
 
-  /// EHSelectorInst - This represents the llvm.eh.selector instruction.
+  /// EHExceptionInst - This represents the llvm.eh.exception instruction.
   ///
-  class EHSelectorInst : public IntrinsicInst {
+  class EHExceptionInst : public IntrinsicInst {
   public:
     // Methods for support type inquiry through isa, cast, and dyn_cast:
-    static inline bool classof(const EHSelectorInst *) { return true; }
+    static inline bool classof(const EHExceptionInst *) { return true; }
     static inline bool classof(const IntrinsicInst *I) {
-      return I->getIntrinsicID() == Intrinsic::eh_selector;
+      return I->getIntrinsicID() == Intrinsic::eh_exception;
     }
     static inline bool classof(const Value *V) {
       return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
     }
   };
 
-  /// MemoryUseIntrinsic - This is the common base class for the memory use
-  /// marker intrinsics.
+  /// EHSelectorInst - This represents the llvm.eh.selector instruction.
   ///
-  class MemoryUseIntrinsic : public IntrinsicInst {
+  class EHSelectorInst : public IntrinsicInst {
   public:
-
     // Methods for support type inquiry through isa, cast, and dyn_cast:
-    static inline bool classof(const MemoryUseIntrinsic *) { return true; }
+    static inline bool classof(const EHSelectorInst *) { return true; }
     static inline bool classof(const IntrinsicInst *I) {
-      switch (I->getIntrinsicID()) {
-      case Intrinsic::lifetime_start:
-      case Intrinsic::lifetime_end:
-      case Intrinsic::invariant_start:
-      case Intrinsic::invariant_end:
-        return true;
-      default: return false;
-      }
+      return I->getIntrinsicID() == Intrinsic::eh_selector;
     }
     static inline bool classof(const Value *V) {
       return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));