Welcome to part 4 of the "Implementing a language with LLVM" tutorial.
In order to generate LLVM IR, we want some simple setup to get started. First, we define virtual codegen methods in each AST class:
/// ExprAST - Base class for all expression nodes. class ExprAST { public: virtual ~ExprAST() {} virtual Value *Codegen() = 0; }; /// NumberExprAST - Expression class for numeric literals like "1.0". class NumberExprAST : public ExprAST { double Val; public: explicit NumberExprAST(double val) : Val(val) {} virtual Value *Codegen(); }; ...