/// 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);
/// 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 {
/// 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);
/// 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; }
/// 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,
/// 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.