Wrap long lines
[oota-llvm.git] / include / llvm / IntrinsicInst.h
index 911ae1031fc785e4e0d055497190f8ba01faac3c..e82663debcc209913aa560d5b950d8ca124b60ba 100644 (file)
@@ -42,6 +42,57 @@ 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.
   ///