Remove this file as there are no LLVM users of it any more.
[oota-llvm.git] / include / llvm / IntrinsicInst.h
index b422901615128efe656d619b7e0fd5ada814decd..e82663debcc209913aa560d5b950d8ca124b60ba 100644 (file)
@@ -42,15 +42,66 @@ namespace llvm {
     static Value *StripPointerCasts(Value *Ptr);
   };
 
+  /// DbgInfoIntrinsic - This is the common base class for debug info intrinsics
+  ///
+  struct DbgInfoIntrinsic : public IntrinsicInst {
+
+    Value *getChain() const { return const_cast<Value*>(getOperand(1)); }
+
+    // Methods for support type inquiry through isa, cast, and dyn_cast:
+    static inline bool classof(const DbgInfoIntrinsic *) { return true; }
+    static inline bool classof(const CallInst *I) {
+      if (const Function *CF = I->getCalledFunction())
+        switch (CF->getIntrinsicID()) {
+       case Intrinsic::dbg_stoppoint:    
+       case Intrinsic::dbg_region_start: 
+       case Intrinsic::dbg_region_end:   
+       case Intrinsic::dbg_func_start:   
+       case Intrinsic::dbg_declare:      
+          return true;
+        default: break;
+        }
+      return false;
+    }
+    static inline bool classof(const Value *V) {
+      return isa<CallInst>(V) && classof(cast<CallInst>(V));
+    }
+  };
+
+
+  /// DbgStopPointInst - This represent llvm.dbg.stoppoint instructions.
+  ///
+  struct DbgStopPointInst : public DbgInfoIntrinsic {
+
+    unsigned getLineNo() const {
+      return cast<ConstantInt>(getOperand(2))->getRawValue();
+    }
+    unsigned getColNo() const {
+      return cast<ConstantInt>(getOperand(3))->getRawValue();
+    }
+    Value *getContext() const { return const_cast<Value*>(getOperand(4)); }
+
+   
+    // Methods for support type inquiry through isa, cast, and dyn_cast:
+    static inline bool classof(const DbgStopPointInst *) { return true; }
+    static inline bool classof(const CallInst *I) {
+      if (const Function *CF = I->getCalledFunction())
+        return CF->getIntrinsicID() == Intrinsic::dbg_stoppoint;
+      return false;
+    }
+    static inline bool classof(const Value *V) {
+      return isa<CallInst>(V) && classof(cast<CallInst>(V));
+    }
+  };
 
   /// MemIntrinsic - This is the common base class for memset/memcpy/memmove.
   ///
   struct MemIntrinsic : public IntrinsicInst {
-    Value *getRawDest() const { return const_cast<Value*>(getOperand(0)); }
+    Value *getRawDest() const { return const_cast<Value*>(getOperand(1)); }
 
-    Value *getLength() const { return const_cast<Value*>(getOperand(2)); }
+    Value *getLength() const { return const_cast<Value*>(getOperand(3)); }
     ConstantInt *getAlignment() const {
-      return cast<ConstantInt>(const_cast<Value*>(getOperand(3)));
+      return cast<ConstantInt>(const_cast<Value*>(getOperand(4)));
     }
 
     /// getDest - This is just like getRawDest, but it strips off any cast
@@ -63,18 +114,18 @@ namespace llvm {
     void setDest(Value *Ptr) {
       assert(getRawDest()->getType() == Ptr->getType() &&
              "setDest called with pointer of wrong type!");
-      setOperand(0, Ptr);
+      setOperand(1, Ptr);
     }
 
     void setLength(Value *L) {
       assert(getLength()->getType() == L->getType() &&
              "setLength called with value of wrong type!");
-      setOperand(2, L);
+      setOperand(3, L);
     }
     void setAlignment(ConstantInt *A) {
       assert(getAlignment()->getType() == A->getType() &&
              "setAlignment called with value of wrong type!");
-      setOperand(3, A);
+      setOperand(4, A);
     }
 
     // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -101,7 +152,7 @@ namespace llvm {
   struct MemCpyInst : public MemIntrinsic {
     /// get* - Return the arguments to the instruction.
     ///
-    Value *getRawSource() const { return const_cast<Value*>(getOperand(1)); }
+    Value *getRawSource() const { return const_cast<Value*>(getOperand(2)); }
 
     /// getSource - This is just like getRawSource, but it strips off any cast
     /// instructions that feed it, giving the original input.  The returned
@@ -112,7 +163,7 @@ namespace llvm {
     void setSource(Value *Ptr) {
       assert(getRawSource()->getType() == Ptr->getType() &&
              "setSource called with pointer of wrong type!");
-      setOperand(1, Ptr);
+      setOperand(2, Ptr);
     }
 
     // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -136,7 +187,7 @@ namespace llvm {
   struct MemMoveInst : public MemIntrinsic {
     /// get* - Return the arguments to the instruction.
     ///
-    Value *getRawSource() const { return const_cast<Value*>(getOperand(1)); }
+    Value *getRawSource() const { return const_cast<Value*>(getOperand(2)); }
 
     /// getSource - This is just like getRawSource, but it strips off any cast
     /// instructions that feed it, giving the original input.  The returned
@@ -146,7 +197,7 @@ namespace llvm {
     void setSource(Value *Ptr) {
       assert(getRawSource()->getType() == Ptr->getType() &&
              "setSource called with pointer of wrong type!");
-      setOperand(1, Ptr);
+      setOperand(2, Ptr);
     }
 
     // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -170,12 +221,12 @@ namespace llvm {
   struct MemSetInst : public MemIntrinsic {
     /// get* - Return the arguments to the instruction.
     ///
-    Value *getValue() const { return const_cast<Value*>(getOperand(1)); }
+    Value *getValue() const { return const_cast<Value*>(getOperand(2)); }
 
     void setValue(Value *Val) {
       assert(getValue()->getType() == Val->getType() &&
              "setSource called with pointer of wrong type!");
-      setOperand(1, Val);
+      setOperand(2, Val);
     }
 
     // Methods for support type inquiry through isa, cast, and dyn_cast: