diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h index ad258f9aca4d..2f29f5459468 100644 --- a/llvm/include/llvm/IR/Constants.h +++ b/llvm/include/llvm/IR/Constants.h @@ -26,6 +26,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/IR/Constant.h" #include "llvm/IR/OperandTraits.h" +#include "llvm/IR/DerivedTypes.h" namespace llvm { @@ -138,7 +139,7 @@ public: /// which reduces the amount of casting needed in parts of the compiler. /// inline IntegerType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } /// This static method returns true if the type Ty is big enough to @@ -354,7 +355,7 @@ public: /// which reduces the amount of casting needed in parts of the compiler. /// inline ArrayType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } virtual void destroyConstant(); @@ -412,7 +413,7 @@ public: /// getType() specialization - Reduce amount of casting... /// inline StructType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } virtual void destroyConstant(); @@ -455,7 +456,7 @@ public: /// which reduces the amount of casting needed in parts of the compiler. /// inline VectorType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } /// getSplatValue - If this is a splat constant, meaning that all of the @@ -486,7 +487,7 @@ class ConstantPointerNull : public Constant { ConstantPointerNull(const ConstantPointerNull &) LLVM_DELETED_FUNCTION; protected: explicit ConstantPointerNull(PointerType *T) - : Constant(reinterpret_cast(T), + : Constant(T, Value::ConstantPointerNullVal, 0, 0) {} protected: @@ -504,7 +505,7 @@ public: /// which reduces the amount of casting needed in parts of the compiler. /// inline PointerType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } /// Methods for support type inquiry through isa, cast, and dyn_cast: @@ -580,7 +581,7 @@ public: /// SequentialType, which reduces the amount of casting needed in parts of the /// compiler. inline SequentialType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } /// getElementType - Return the element type of the array/vector. @@ -679,7 +680,7 @@ public: /// which reduces the amount of casting needed in parts of the compiler. /// inline ArrayType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } /// Methods for support type inquiry through isa, cast, and dyn_cast: @@ -732,7 +733,7 @@ public: /// which reduces the amount of casting needed in parts of the compiler. /// inline VectorType *getType() const { - return reinterpret_cast(Value::getType()); + return cast(Value::getType()); } /// Methods for support type inquiry through isa, cast, and dyn_cast: