1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[Kaleidoscope] Remove RTTI use from chapters 7 and 8.

llvm-svn: 235541
This commit is contained in:
Lang Hames 2015-04-22 20:41:34 +00:00
parent 6e87be5234
commit aab3135993
6 changed files with 8 additions and 12 deletions

View File

@ -11,10 +11,6 @@ set(LLVM_LINK_COMPONENTS
native
)
set(LLVM_REQUIRES_RTTI 1)
set(LLVM_BUILD_EXAMPLES OFF)
add_kaleidoscope_chapter(Kaleidoscope-Ch7
toy.cpp
)

View File

@ -9,7 +9,6 @@
LEVEL = ../../..
TOOLNAME = Kaleidoscope-Ch7
EXAMPLE_TOOL = 1
REQUIRES_RTTI := 1
LINK_COMPONENTS := core mcjit native

View File

@ -713,7 +713,10 @@ 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 = dynamic_cast<VariableExprAST *>(LHS);
// 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);
if (!LHSE)
return ErrorV("destination of '=' must be a variable");
// Codegen the RHS.

View File

@ -7,10 +7,6 @@ set(LLVM_LINK_COMPONENTS
native
)
set(LLVM_REQUIRES_RTTI 1)
set(LLVM_BUILD_EXAMPLES OFF)
add_kaleidoscope_chapter(Kaleidoscope-Ch8
toy.cpp
)

View File

@ -9,7 +9,6 @@
LEVEL = ../../..
TOOLNAME = Kaleidoscope-Ch8
EXAMPLE_TOOL = 1
REQUIRES_RTTI := 1
LINK_COMPONENTS := core mcjit native

View File

@ -908,7 +908,10 @@ 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 = dynamic_cast<VariableExprAST *>(LHS);
// 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);
if (!LHSE)
return ErrorV("destination of '=' must be a variable");
// Codegen the RHS.