[Kaleidoscope] Fix incorrect use of reinterpret_cast.
authorLang Hames <lhames@gmail.com>
Wed, 22 Apr 2015 20:58:34 +0000 (20:58 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 22 Apr 2015 20:58:34 +0000 (20:58 +0000)
Thanks to Dave Blaikie for catching this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235543 91177308-0d34-0410-b5e6-96231b3b80d8

examples/Kaleidoscope/Chapter7/toy.cpp
examples/Kaleidoscope/Chapter8/toy.cpp
examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
examples/Kaleidoscope/MCJIT/cached/toy.cpp
examples/Kaleidoscope/MCJIT/complete/toy.cpp
examples/Kaleidoscope/MCJIT/initial/toy.cpp
examples/Kaleidoscope/MCJIT/lazy/toy.cpp

index acf21f898f83ede74764b42dc13fac6a9378ef97..b1a41fa01b76b7c3276ea83877beb7da34a27ad7 100644 (file)
@@ -716,7 +716,7 @@ Value *BinaryExprAST::Codegen() {
     // This assume we're building without RTTI because LLVM builds that way by
     // default.  If you build LLVM with RTTI this can be changed to a
     // dynamic_cast for automatic error checking.
-    VariableExprAST *LHSE = reinterpret_cast<VariableExprAST *>(LHS);
+    VariableExprAST *LHSE = static_cast<VariableExprAST *>(LHS);
     if (!LHSE)
       return ErrorV("destination of '=' must be a variable");
     // Codegen the RHS.
index 6ab0eaeca30ea647a63e09d74baf218d4d6864e7..a565e52e2eb414c898c7b1b02a0a42239905c56a 100644 (file)
@@ -911,7 +911,7 @@ Value *BinaryExprAST::Codegen() {
     // This assume we're building without RTTI because LLVM builds that way by
     // default.  If you build LLVM with RTTI this can be changed to a
     // dynamic_cast for automatic error checking.
-    VariableExprAST *LHSE = reinterpret_cast<VariableExprAST *>(LHS);
+    VariableExprAST *LHSE = static_cast<VariableExprAST *>(LHS);
     if (!LHSE)
       return ErrorV("destination of '=' must be a variable");
     // Codegen the RHS.
index 7f5ed137cece386b00e5e44e35000b62272bfce1..77b7f001095af3088ffb085211deb0f3b4722828 100644 (file)
@@ -672,7 +672,7 @@ Value *BinaryExprAST::Codegen() {
     // For now, I'm building without RTTI because LLVM builds that way by
     // default and so we need to build that way to use the command line supprt.
     // If you build LLVM with RTTI this can be changed back to a dynamic_cast.
-    VariableExprAST *LHSE = reinterpret_cast<VariableExprAST*>(LHS);
+    VariableExprAST *LHSE = static_cast<VariableExprAST*>(LHS);
     if (!LHSE)
       return ErrorV("destination of '=' must be a variable");
     // Codegen the RHS.
index f598ca41f0fe9c1b1d16031f3dccc6c6ff3c5c18..cc12abcc43169e503b5bfc39b14223e475aa3196 100644 (file)
@@ -1039,7 +1039,7 @@ Value *BinaryExprAST::Codegen() {
   // Special case '=' because we don't want to emit the LHS as an expression.
   if (Op == '=') {
     // Assignment requires the LHS to be an identifier.
-    VariableExprAST *LHSE = reinterpret_cast<VariableExprAST*>(LHS);
+    VariableExprAST *LHSE = static_cast<VariableExprAST*>(LHS);
     if (!LHSE)
       return ErrorV("destination of '=' must be a variable");
     // Codegen the RHS.
index 5294bb71ee19b955a54b4b24ea8ae2efc93fb3be..c78ec35fa0b3d1823054e9fc2c511460a1afbc46 100644 (file)
@@ -1113,7 +1113,7 @@ Value *BinaryExprAST::Codegen() {
     // This assume we're building without RTTI because LLVM builds that way by
     // default.  If you build LLVM with RTTI this can be changed to a
     // dynamic_cast for automatic error checking.
-    VariableExprAST *LHSE = reinterpret_cast<VariableExprAST*>(LHS);
+    VariableExprAST *LHSE = static_cast<VariableExprAST*>(LHS);
     if (!LHSE)
       return ErrorV("destination of '=' must be a variable");
     // Codegen the RHS.
index dd35358753d04f5eef09a2fea4823b97df195a71..9455946087d139e74f46e1255958da187c92cf63 100644 (file)
@@ -897,7 +897,7 @@ Value *BinaryExprAST::Codegen() {
   // Special case '=' because we don't want to emit the LHS as an expression.
   if (Op == '=') {
     // Assignment requires the LHS to be an identifier.
-    VariableExprAST *LHSE = reinterpret_cast<VariableExprAST*>(LHS);
+    VariableExprAST *LHSE = static_cast<VariableExprAST*>(LHS);
     if (!LHSE)
       return ErrorV("destination of '=' must be a variable");
     // Codegen the RHS.
index fe7fb61969791e6d14ab93ca0f4e0abf7b22999b..14d758cfa79090c1c42fca909cb5c8ed661e8c3b 100644 (file)
@@ -937,7 +937,7 @@ Value *BinaryExprAST::Codegen() {
   // Special case '=' because we don't want to emit the LHS as an expression.
   if (Op == '=') {
     // Assignment requires the LHS to be an identifier.
-    VariableExprAST *LHSE = reinterpret_cast<VariableExprAST*>(LHS);
+    VariableExprAST *LHSE = static_cast<VariableExprAST*>(LHS);
     if (!LHSE)
       return ErrorV("destination of '=' must be a variable");
     // Codegen the RHS.