aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-16 20:21:15 +0000
committerChris Lattner <sabre@nondot.org>2003-11-16 20:21:15 +0000
commit8b70b78ba489b090d9866e6a4084ab1e8613b527 (patch)
treec3e137b779b119b92587950176b457381132b18f /include/llvm/Constants.h
parentf3b2410bc4c098c0f27f689c797a539d6ef8a09e (diff)
downloadexternal_llvm-8b70b78ba489b090d9866e6a4084ab1e8613b527.tar.gz
external_llvm-8b70b78ba489b090d9866e6a4084ab1e8613b527.tar.bz2
external_llvm-8b70b78ba489b090d9866e6a4084ab1e8613b527.zip
Fixes for PR114: Thanks to Reid Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index 5d65b2f0c7..06f1308fdf 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -301,7 +301,7 @@ public:
/// which reduces the amount of casting needed in parts of the compiler.
///
inline const ArrayType *getType() const {
- return (ArrayType*)Value::getType();
+ return reinterpret_cast<const ArrayType*>(Value::getType());
}
/// getAsString - If the sub-element type of this array is either sbyte or
@@ -354,7 +354,7 @@ public:
/// getType() specialization - Reduce amount of casting...
inline const StructType *getType() const {
- return (StructType*)Value::getType();
+ return reinterpret_cast<const StructType*>(Value::getType());
}
/// getValues - Return a vector of the component constants that make up this
@@ -394,10 +394,11 @@ public:
class ConstantPointer : public Constant {
ConstantPointer(const ConstantPointer &); // DO NOT IMPLEMENT
protected:
- inline ConstantPointer(const PointerType *T) : Constant((const Type*)T) {}
+ inline ConstantPointer(const PointerType *T)
+ : Constant(reinterpret_cast<const Type*>(T)) { }
public:
inline const PointerType *getType() const {
- return (PointerType*)Value::getType();
+ return reinterpret_cast<const PointerType*>(Value::getType());
}
/// isNullValue - Return true if this is the value that would be returned by