Add some constantness to BranchProbabilityInfo and BlockFrequnencyInfo.
[oota-llvm.git] / include / llvm / IntrinsicInst.h
index 0c69e0786f5c131ea7fe949c2579865dcb68bba6..42862011ac7a87a28e35194a7c55cecb43d36f33 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 {
@@ -139,6 +139,10 @@ namespace llvm {
       return !getVolatileCst()->isZero();
     }
 
+    unsigned getDestAddressSpace() 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.
@@ -166,7 +170,7 @@ namespace llvm {
       setArgOperand(4, V);
     }
 
-    const Type *getAlignmentType() const {
+    Type *getAlignmentType() const {
       return getArgOperand(3)->getType();
     }
 
@@ -223,6 +227,10 @@ namespace llvm {
     /// value is guaranteed to be a pointer.
     Value *getSource() const { return getRawSource()->stripPointerCasts(); }
 
+    unsigned getSourceAddressSpace() const {
+      return cast<PointerType>(getRawSource()->getType())->getAddressSpace();
+    }
+
     void setSource(Value *Ptr) {
       assert(getRawSource()->getType() == Ptr->getType() &&
              "setSource called with pointer of wrong type!");
@@ -269,37 +277,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));