MC: Lift SwitchSection() and Finish() into MCObjectStreamer.
[oota-llvm.git] / include / llvm / IntrinsicInst.h
index 5808938400c22244ef6c496c27dcefc7b44cf477..5b0e90f5cc07ad6cfe8b1017483b39b675d14774 100644 (file)
@@ -82,7 +82,7 @@ namespace llvm {
   ///
   class DbgDeclareInst : public DbgInfoIntrinsic {
   public:
-    Value *getAddress()  const { return getOperand(1); }
+    Value *getAddress() const;
     MDNode *getVariable() const { return cast<MDNode>(getOperand(2)); }
 
     // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -99,8 +99,12 @@ namespace llvm {
   ///
   class DbgValueInst : public DbgInfoIntrinsic {
   public:
-    Value *getValue() const;
-    Value *getOffset() const { return getOperand(2); }
+    const Value *getValue() const;
+    Value *getValue();
+    uint64_t getOffset() const {
+      return cast<ConstantInt>(
+                             const_cast<Value*>(getOperand(2)))->getZExtValue();
+    }
     MDNode *getVariable() const { return cast<MDNode>(getOperand(3)); }
 
     // Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -128,6 +132,13 @@ namespace llvm {
       return getAlignmentCst()->getZExtValue();
     }
 
+    ConstantInt *getVolatileCst() const {
+      return cast<ConstantInt>(const_cast<Value*>(getOperand(5)));
+    }
+    bool isVolatile() const {
+      return getVolatileCst()->getZExtValue() != 0;
+    }
+
     /// 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.
@@ -150,7 +161,11 @@ namespace llvm {
     void setAlignment(Constant* A) {
       setOperand(4, A);
     }
-    
+
+    void setVolatile(Constant* V) {
+      setOperand(5, V);
+    }
+
     const Type *getAlignmentType() const {
       return getOperand(4)->getType();
     }