llvm.org GIT mirror llvm / fd49146
[Kaleidoscope] Remove RTTI use from chapters 7 and 8. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235541 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 4 years ago
6 changed file(s) with 8 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
1010 native
1111 )
1212
13 set(LLVM_REQUIRES_RTTI 1)
14
15 set(LLVM_BUILD_EXAMPLES OFF)
16
1713 add_kaleidoscope_chapter(Kaleidoscope-Ch7
1814 toy.cpp
1915 )
88 LEVEL = ../../..
99 TOOLNAME = Kaleidoscope-Ch7
1010 EXAMPLE_TOOL = 1
11 REQUIRES_RTTI := 1
1211
1312 LINK_COMPONENTS := core mcjit native
1413
712712 // Special case '=' because we don't want to emit the LHS as an expression.
713713 if (Op == '=') {
714714 // Assignment requires the LHS to be an identifier.
715 VariableExprAST *LHSE = dynamic_cast(LHS);
715 // This assume we're building without RTTI because LLVM builds that way by
716 // default. If you build LLVM with RTTI this can be changed to a
717 // dynamic_cast for automatic error checking.
718 VariableExprAST *LHSE = reinterpret_cast(LHS);
716719 if (!LHSE)
717720 return ErrorV("destination of '=' must be a variable");
718721 // Codegen the RHS.
66 native
77 )
88
9 set(LLVM_REQUIRES_RTTI 1)
10
11 set(LLVM_BUILD_EXAMPLES OFF)
12
139 add_kaleidoscope_chapter(Kaleidoscope-Ch8
1410 toy.cpp
1511 )
88 LEVEL = ../../..
99 TOOLNAME = Kaleidoscope-Ch8
1010 EXAMPLE_TOOL = 1
11 REQUIRES_RTTI := 1
1211
1312 LINK_COMPONENTS := core mcjit native
1413
907907 // Special case '=' because we don't want to emit the LHS as an expression.
908908 if (Op == '=') {
909909 // Assignment requires the LHS to be an identifier.
910 VariableExprAST *LHSE = dynamic_cast(LHS);
910 // This assume we're building without RTTI because LLVM builds that way by
911 // default. If you build LLVM with RTTI this can be changed to a
912 // dynamic_cast for automatic error checking.
913 VariableExprAST *LHSE = reinterpret_cast(LHS);
911914 if (!LHSE)
912915 return ErrorV("destination of '=' must be a variable");
913916 // Codegen the RHS.