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:
parent
6e87be5234
commit
aab3135993
@ -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
|
||||
)
|
||||
|
@ -9,7 +9,6 @@
|
||||
LEVEL = ../../..
|
||||
TOOLNAME = Kaleidoscope-Ch7
|
||||
EXAMPLE_TOOL = 1
|
||||
REQUIRES_RTTI := 1
|
||||
|
||||
LINK_COMPONENTS := core mcjit native
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -9,7 +9,6 @@
|
||||
LEVEL = ../../..
|
||||
TOOLNAME = Kaleidoscope-Ch8
|
||||
EXAMPLE_TOOL = 1
|
||||
REQUIRES_RTTI := 1
|
||||
|
||||
LINK_COMPONENTS := core mcjit native
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user