14 #include <llvm/IR/IRBuilder.h> 15 #include <llvm/IR/Module.h> 25 std::vector<Expr *> _exprs_then;
26 std::vector<Expr *> _exprs_else;
28 IfExpr(std::vector<Expr *> exprs_then) : _exprs_then(exprs_then) {}
31 void set_else(std::vector<Expr *> exprs_else) { _exprs_else = exprs_else; }
39 void code_gen(llvm::Module *M, llvm::IRBuilder<> &B,
40 llvm::BasicBlock *BreakBB);
Abstract class in which all expressions in Brain implement from.
Definition: Expr.h:62
void ast_code_gen()
Method for the reverse code generation from the AST. It prints out to the stdout the token itself...
Definition: IfExpr.cpp:124
void debug_description(int level)
Prints debug information when Brain's compiler has the active flags: -v | -emit-ast.
Definition: IfExpr.cpp:78
ExpressionType expression_category()
Returns the category of the expression given by the caller.
Definition: IfExpr.cpp:148
void code_gen(llvm::Module *M, llvm::IRBuilder<> &B, llvm::BasicBlock *BreakBB)
Generates the IR (Intermediate Representation) code to be executed by llvm.
Definition: IfExpr.cpp:11
Class that represents the if operator in Brain.
Definition: IfExpr.h:22