minor cleanups. Add provisions for a new standard BLOCKINFO_BLOCK
[oota-llvm.git] / include / llvm / Instructions.h
index 0a61d120c25590fa67a0cf3e822c993230c4f9fa..146d1f50a645d0aede3f2ff7e934766f01a0e15a 100644 (file)
@@ -246,15 +246,16 @@ public:
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; }
+  void setVolatile(bool V) { 
+    SubclassData = (SubclassData & ~1) | ((V) ? 1 : 0); 
+  }
 
   virtual LoadInst *clone() const;
 
   /// getAlignment - Return the alignment of the access that is being performed
   ///
   unsigned getAlignment() const {
-    signed Log2AlignVal = ((SubclassData>>1)-1);
-    return ((Log2AlignVal < 0) ? 0 : 1<<Log2AlignVal);
+    return (1 << (SubclassData>>1)) >> 1;
   }
   
   void setAlignment(unsigned Align);
@@ -311,7 +312,9 @@ public:
 
   /// setVolatile - Specify whether this is a volatile load or not.
   ///
-  void setVolatile(bool V) { SubclassData = (SubclassData & ~1) | (V) ? 1 : 0; }
+  void setVolatile(bool V) { 
+    SubclassData = (SubclassData & ~1) | ((V) ? 1 : 0); 
+  }
 
   /// Transparently provide more efficient getOperand methods.
   Value *getOperand(unsigned i) const {
@@ -327,8 +330,7 @@ public:
   /// getAlignment - Return the alignment of the access that is being performed
   ///
   unsigned getAlignment() const {
-    signed Log2AlignVal = ((SubclassData>>1)-1);
-    return ((Log2AlignVal < 0) ? 0 : 1<<Log2AlignVal);
+    return (1 << (SubclassData>>1)) >> 1;
   }
   
   void setAlignment(unsigned Align);
@@ -439,6 +441,12 @@ public:
   /// zeros.  If so, the result pointer and the first operand have the same
   /// value, just potentially different types.
   bool hasAllZeroIndices() const;
+  
+  /// hasAllConstantIndices - Return true if all of the indices of this GEP are
+  /// constant integers.  If so, the result pointer and the first operand have
+  /// a constant offset between them.
+  bool hasAllConstantIndices() const;
+  
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const GetElementPtrInst *) { return true; }
@@ -777,7 +785,7 @@ public:
   /// Sets the parameter attributes for this CallInst. To construct a 
   /// ParamAttrsList, see ParameterAttributes.h
   /// @brief Set the parameter attributes.
-  void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; }
+  void setParamAttrs(ParamAttrsList *attrs);
 
   /// getCalledFunction - Return the function being called by this instruction
   /// if it is a direct call.  If it is a call through a function pointer,
@@ -1508,7 +1516,7 @@ public:
   /// Sets the parameter attributes for this InvokeInst. To construct a 
   /// ParamAttrsList, see ParameterAttributes.h
   /// @brief Set the parameter attributes.
-  void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; }
+  void setParamAttrs(ParamAttrsList *attrs);
 
   /// getCalledFunction - Return the function called, or null if this is an
   /// indirect function invocation.