native
)
-set(LLVM_REQUIRES_RTTI 1)
-
-set(LLVM_BUILD_EXAMPLES OFF)
-
add_kaleidoscope_chapter(Kaleidoscope-Ch7
toy.cpp
)
LEVEL = ../../..
TOOLNAME = Kaleidoscope-Ch7
EXAMPLE_TOOL = 1
-REQUIRES_RTTI := 1
LINK_COMPONENTS := core mcjit native
// 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.
native
)
-set(LLVM_REQUIRES_RTTI 1)
-
-set(LLVM_BUILD_EXAMPLES OFF)
-
add_kaleidoscope_chapter(Kaleidoscope-Ch8
toy.cpp
)
LEVEL = ../../..
TOOLNAME = Kaleidoscope-Ch8
EXAMPLE_TOOL = 1
-REQUIRES_RTTI := 1
LINK_COMPONENTS := core mcjit native
// 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.