60 changes: 33 additions & 27 deletions llvm/docs/tutorial/LangImpl5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ To represent the new expression we add a new AST node for it:

/// IfExprAST - Expression class for if/then/else.
class IfExprAST : public ExprAST {
ExprAST *Cond, *Then, *Else;
std::unique<ExprAST> Cond, Then, Else;
public:
IfExprAST(ExprAST *cond, ExprAST *then, ExprAST *_else)
: Cond(cond), Then(then), Else(_else) {}
IfExprAST(std::unique_ptr<ExprAST> Cond, std::unique_ptr<ExprAST> Then,
std::unique_ptr<ExprAST> Else)
: Cond(std::move(Cond)), Then(std::move(Then)), Else(std::move(Else)) {}
virtual Value *Codegen();
};
Expand All @@ -109,36 +110,37 @@ First we define a new parsing function:
.. code-block:: c++

/// ifexpr ::= 'if' expression 'then' expression 'else' expression
static ExprAST *ParseIfExpr() {
static std::unique_ptr<ExprAST> ParseIfExpr() {
getNextToken(); // eat the if.

// condition.
ExprAST *Cond = ParseExpression();
if (!Cond) return 0;
auto Cond = ParseExpression();
if (!Cond) return nullptr;

if (CurTok != tok_then)
return Error("expected then");
getNextToken(); // eat the then

ExprAST *Then = ParseExpression();
if (Then == 0) return 0;
auto Then = ParseExpression();
if (Then) return nullptr;

if (CurTok != tok_else)
return Error("expected else");

getNextToken();

ExprAST *Else = ParseExpression();
if (!Else) return 0;
auto Else = ParseExpression();
if (!Else) return nullptr;

return new IfExprAST(Cond, Then, Else);
return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}

Next we hook it up as a primary expression:

.. code-block:: c++

static ExprAST *ParsePrimary() {
static std::unique_ptr<ExprAST> ParsePrimary() {
switch (CurTok) {
default: return Error("unknown token when expecting an expression");
case tok_identifier: return ParseIdentifierExpr();
Expand Down Expand Up @@ -269,7 +271,7 @@ for ``IfExprAST``:

Value *IfExprAST::Codegen() {
Value *CondV = Cond->Codegen();
if (CondV == 0) return 0;
if (!CondV) return nullptr;
// Convert condition to a bool by comparing equal to 0.0.
CondV = Builder.CreateFCmpONE(CondV,
Expand Down Expand Up @@ -464,11 +466,13 @@ variable name and the constituent expressions in the node.
/// ForExprAST - Expression class for for/in.
class ForExprAST : public ExprAST {
std::string VarName;
ExprAST *Start, *End, *Step, *Body;
std::unique_ptr<ExprAST> Start, End, Step, Body;
public:
ForExprAST(const std::string &varname, ExprAST *start, ExprAST *end,
ExprAST *step, ExprAST *body)
: VarName(varname), Start(start), End(end), Step(step), Body(body) {}
ForExprAST(const std::string &VarName, std::unique_ptr<ExprAST> Start,
std::unique_ptr<ExprAST> End, std::unique_ptr<ExprAST> Step,
std::unique_ptr<ExprAST> Body)
: VarName(VarName), Start(std::move(Start)), End(std::move(End)),
Step(std::move(Step)), Body(std::move(Body)) {}
virtual Value *Codegen();
};
Expand All @@ -483,7 +487,7 @@ value to null in the AST node:
.. code-block:: c++

/// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression
static ExprAST *ParseForExpr() {
static std::unique_ptr<ExprAST> ParseForExpr() {
getNextToken(); // eat the for.

if (CurTok != tok_identifier)
Expand All @@ -497,31 +501,33 @@ value to null in the AST node:
getNextToken(); // eat '='.


ExprAST *Start = ParseExpression();
if (Start == 0) return 0;
auto Start = ParseExpression();
if (!Start) return nullptr;
if (CurTok != ',')
return Error("expected ',' after for start value");
getNextToken();

ExprAST *End = ParseExpression();
if (End == 0) return 0;
auto End = ParseExpression();
if (!End) return nullptr;

// The step value is optional.
ExprAST *Step = 0;
std::unique_ptr<ExprAST> Step;
if (CurTok == ',') {
getNextToken();
Step = ParseExpression();
if (Step == 0) return 0;
if (!Step) return nullptr;
}

if (CurTok != tok_in)
return Error("expected 'in' after for");
getNextToken(); // eat 'in'.

ExprAST *Body = ParseExpression();
if (Body == 0) return 0;
auto Body = ParseExpression();
if (!Body) return nullptr;

return new ForExprAST(IdName, Start, End, Step, Body);
return llvm::make_unique<ForExprAST>(IdName, std::move(Start),
std::move(End), std::move(Step),
std::move(Body));
}

LLVM IR for the 'for' Loop
Expand Down
49 changes: 26 additions & 23 deletions llvm/docs/tutorial/LangImpl6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,16 @@ this:
class PrototypeAST {
std::string Name;
std::vector<std::string> Args;
bool isOperator;
bool IsOperator;
unsigned Precedence; // Precedence if a binary op.
public:
PrototypeAST(const std::string &name, const std::vector<std::string> &args,
bool isoperator = false, unsigned prec = 0)
: Name(name), Args(args), isOperator(isoperator), Precedence(prec) {}
PrototypeAST(const std::string &name, std::vector<std::string> Args,
bool IsOperator = false, unsigned Prec = 0)
: Name(name), Args(std::move(Args)), IsOperator(IsOperator),
Precedence(Prec) {}

bool isUnaryOp() const { return isOperator && Args.size() == 1; }
bool isBinaryOp() const { return isOperator && Args.size() == 2; }
bool isUnaryOp() const { return IsOperator && Args.size() == 1; }
bool isBinaryOp() const { return IsOperator && Args.size() == 2; }

char getOperatorName() const {
assert(isUnaryOp() || isBinaryOp());
Expand All @@ -161,7 +162,7 @@ user-defined operator, we need to parse it:
/// prototype
/// ::= id '(' id* ')'
/// ::= binary LETTER number? (id, id)
static PrototypeAST *ParsePrototype() {
static std::unique_ptr<PrototypeAST> ParsePrototype() {
std::string FnName;

unsigned Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
Expand Down Expand Up @@ -210,7 +211,8 @@ user-defined operator, we need to parse it:
if (Kind && ArgNames.size() != Kind)
return ErrorP("Invalid number of operands for operator");

return new PrototypeAST(FnName, ArgNames, Kind != 0, BinaryPrecedence);
return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames),
Kind != 0, BinaryPrecedence);
}

This is all fairly straightforward parsing code, and we have already
Expand Down Expand Up @@ -305,10 +307,10 @@ that, we need an AST node:
/// UnaryExprAST - Expression class for a unary operator.
class UnaryExprAST : public ExprAST {
char Opcode;
ExprAST *Operand;
std::unique_ptr<ExprAST> Operand;
public:
UnaryExprAST(char opcode, ExprAST *operand)
: Opcode(opcode), Operand(operand) {}
UnaryExprAST(char Opcode, std::unique_ptr<ExprAST> Operand)
: Opcode(Opcode), Operand(std::move(Operand)) {}
virtual Value *Codegen();
};
Expand All @@ -322,17 +324,17 @@ simple: we'll add a new function to do it:
/// unary
/// ::= primary
/// ::= '!' unary
static ExprAST *ParseUnary() {
static std::unique_ptr<ExprAST> ParseUnary() {
// If the current token is not an operator, it must be a primary expr.
if (!isascii(CurTok) || CurTok == '(' || CurTok == ',')
return ParsePrimary();

// If this is a unary operator, read it.
int Opc = CurTok;
getNextToken();
if (ExprAST *Operand = ParseUnary())
return new UnaryExprAST(Opc, Operand);
return 0;
if (auto Operand = ParseUnary())
return llvm::unique_ptr<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}

The grammar we add is pretty straightforward here. If we see a unary
Expand All @@ -350,21 +352,22 @@ call ParseUnary instead:

/// binoprhs
/// ::= ('+' unary)*
static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
static std::unique_ptr<ExprAST> ParseBinOpRHS(int ExprPrec,
std::unique_ptr<ExprAST> LHS) {
...
// Parse the unary expression after the binary operator.
ExprAST *RHS = ParseUnary();
if (!RHS) return 0;
auto RHS = ParseUnary();
if (!RHS) return nullptr;
...
}
/// expression
/// ::= unary binoprhs
///
static ExprAST *ParseExpression() {
ExprAST *LHS = ParseUnary();
if (!LHS) return 0;
static std::unique_ptr<ExprAST> ParseExpression() {
auto LHS = ParseUnary();
if (!LHS) return nullptr;

return ParseBinOpRHS(0, LHS);
return ParseBinOpRHS(0, std::move(LHS));
}

With these two simple changes, we are now able to parse unary operators
Expand All @@ -378,7 +381,7 @@ operator code above with:
/// ::= id '(' id* ')'
/// ::= binary LETTER number? (id, id)
/// ::= unary LETTER (id)
static PrototypeAST *ParsePrototype() {
static std::unique_ptr<PrototypeAST> ParsePrototype() {
std::string FnName;

unsigned Kind = 0; // 0 = identifier, 1 = unary, 2 = binary.
Expand Down
33 changes: 17 additions & 16 deletions llvm/docs/tutorial/LangImpl7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ implement codegen for the assignment operator. This looks like:
// 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);
VariableExprAST *LHSE = dynamic_cast<VariableExprAST*>(LHS.get());
if (!LHSE)
return ErrorV("destination of '=' must be a variable");

Expand Down Expand Up @@ -663,12 +663,12 @@ var/in, it looks like this:

/// VarExprAST - Expression class for var/in
class VarExprAST : public ExprAST {
std::vector<std::pair<std::string, ExprAST*> > VarNames;
ExprAST *Body;
std::vector<std::pair<std::string, std::unique_ptr<ExprAST>>> VarNames;
std::unique_ptr<ExprAST> Body;
public:
VarExprAST(const std::vector<std::pair<std::string, ExprAST*> > &varnames,
ExprAST *body)
: VarNames(varnames), Body(body) {}
VarExprAST(std::vector<std::pair<std::string, std::unique_ptr<ExprAST>>> VarNames,
std::unique_ptr<ExprAST> body)
: VarNames(std::move(VarNames)), Body(std::move(Body)) {}

virtual Value *Codegen();
};
Expand All @@ -690,7 +690,7 @@ do is add it as a primary expression:
/// ::= ifexpr
/// ::= forexpr
/// ::= varexpr
static ExprAST *ParsePrimary() {
static std::unique_ptr<ExprAST> ParsePrimary() {
switch (CurTok) {
default: return Error("unknown token when expecting an expression");
case tok_identifier: return ParseIdentifierExpr();
Expand All @@ -708,10 +708,10 @@ Next we define ParseVarExpr:

/// varexpr ::= 'var' identifier ('=' expression)?
// (',' identifier ('=' expression)?)* 'in' expression
static ExprAST *ParseVarExpr() {
static std::unique_ptr<ExprAST> ParseVarExpr() {
getNextToken(); // eat the var.

std::vector<std::pair<std::string, ExprAST*> > VarNames;
std::vector<std::pair<std::string, std::unique_ptr<ExprAST>>> VarNames;

// At least one variable name is required.
if (CurTok != tok_identifier)
Expand All @@ -727,15 +727,15 @@ into the local ``VarNames`` vector.
getNextToken(); // eat identifier.

// Read the optional initializer.
ExprAST *Init = 0;
std::unique_ptr<ExprAST> Init;
if (CurTok == '=') {
getNextToken(); // eat the '='.

Init = ParseExpression();
if (Init == 0) return 0;
if (!Init) return nullptr;
}

VarNames.push_back(std::make_pair(Name, Init));
VarNames.push_back(std::make_pair(Name, std::move(Init)));

// End of var list, exit loop.
if (CurTok != ',') break;
Expand All @@ -755,10 +755,11 @@ AST node:
return Error("expected 'in' keyword after 'var'");
getNextToken(); // eat 'in'.

ExprAST *Body = ParseExpression();
if (Body == 0) return 0;
auto Body = ParseExpression();
if (!Body) return nullptr;

return new VarExprAST(VarNames, Body);
return llvm::make_unique<VarExprAST>(std::move(VarNames),
std::move(Body));
}

Now that we can parse and represent the code, we need to support
Expand All @@ -774,7 +775,7 @@ emission of LLVM IR for it. This code starts out with:
// Register all variables and emit their initializer.
for (unsigned i = 0, e = VarNames.size(); i != e; ++i) {
const std::string &VarName = VarNames[i].first;
ExprAST *Init = VarNames[i].second;
ExprAST *Init = VarNames[i].second.get();
Basically it loops over all the variables, installing them one at a
time. For each variable we put into the symbol table, we remember the
Expand Down
13 changes: 7 additions & 6 deletions llvm/docs/tutorial/LangImpl8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ statement be our "main":

.. code-block:: udiff
- PrototypeAST *Proto = new PrototypeAST("", std::vector<std::string>());
+ PrototypeAST *Proto = new PrototypeAST("main", std::vector<std::string>());
- auto Proto = llvm::make_unique<PrototypeAST>("", std::vector<std::string>());
+ auto Proto = llvm::make_unique<PrototypeAST>("main", std::vector<std::string>());
just with the simple change of giving it a name.

Expand Down Expand Up @@ -108,12 +108,12 @@ code is that the llvm IR goes to standard error:
@@ -1108,17 +1108,8 @@ static void HandleExtern() {
static void HandleTopLevelExpression() {
// Evaluate a top-level expression into an anonymous function.
if (FunctionAST *F = ParseTopLevelExpr()) {
- if (Function *LF = F->Codegen()) {
if (auto FnAST = ParseTopLevelExpr()) {
- if (auto *FnIR = FnAST->Codegen()) {
- // We're just doing this to make sure it executes.
- TheExecutionEngine->finalizeObject();
- // JIT the function, returning a function pointer.
- void *FPtr = TheExecutionEngine->getPointerToFunction(LF);
- void *FPtr = TheExecutionEngine->getPointerToFunction(FnIR);
-
- // Cast it to the right type (takes no arguments, returns a double) so we
- // can call it as a native function.
Expand Down Expand Up @@ -318,7 +318,8 @@ that we pass down through when we create a new expression:

.. code-block:: c++

LHS = new BinaryExprAST(BinLoc, BinOp, LHS, RHS);
LHS = llvm::make_unique<BinaryExprAST>(BinLoc, BinOp, std::move(LHS),
std::move(RHS));

giving us locations for each of our expressions and variables.

Expand Down
117 changes: 66 additions & 51 deletions llvm/examples/Kaleidoscope/Chapter2/toy.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "llvm/ADT/STLExtras.h"
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <string>
#include <vector>
Expand Down Expand Up @@ -85,29 +85,31 @@ class ExprAST {
/// NumberExprAST - Expression class for numeric literals like "1.0".
class NumberExprAST : public ExprAST {
public:
NumberExprAST(double val) {}
NumberExprAST(double Val) {}
};

/// VariableExprAST - Expression class for referencing a variable, like "a".
class VariableExprAST : public ExprAST {
std::string Name;
public:
VariableExprAST(const std::string &name) : Name(name) {}
VariableExprAST(const std::string &Name) : Name(Name) {}
};

/// BinaryExprAST - Expression class for a binary operator.
class BinaryExprAST : public ExprAST {
public:
BinaryExprAST(char op, ExprAST *lhs, ExprAST *rhs) {}
BinaryExprAST(char Op, std::unique_ptr<ExprAST> LHS,
std::unique_ptr<ExprAST> RHS) {}
};

/// CallExprAST - Expression class for function calls.
class CallExprAST : public ExprAST {
std::string Callee;
std::vector<ExprAST*> Args;
std::vector<std::unique_ptr<ExprAST>> Args;
public:
CallExprAST(const std::string &callee, std::vector<ExprAST*> &args)
: Callee(callee), Args(args) {}
CallExprAST(const std::string &Callee,
std::vector<std::unique_ptr<ExprAST>> Args)
: Callee(Callee), Args(std::move(Args)) {}
};

/// PrototypeAST - This class represents the "prototype" for a function,
Expand All @@ -117,15 +119,16 @@ class PrototypeAST {
std::string Name;
std::vector<std::string> Args;
public:
PrototypeAST(const std::string &name, const std::vector<std::string> &args)
: Name(name), Args(args) {}
PrototypeAST(const std::string &Name, std::vector<std::string> Args)
: Name(Name), Args(std::move(Args)) {}

};

/// FunctionAST - This class represents a function definition itself.
class FunctionAST {
public:
FunctionAST(PrototypeAST *proto, ExprAST *body) {}
FunctionAST(std::unique_ptr<PrototypeAST> Proto,
std::unique_ptr<ExprAST> Body) {}
};
} // end anonymous namespace

Expand Down Expand Up @@ -157,30 +160,37 @@ static int GetTokPrecedence() {
}

/// Error* - These are little helper functions for error handling.
ExprAST *Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str);return 0;}
PrototypeAST *ErrorP(const char *Str) { Error(Str); return 0; }
std::unique_ptr<ExprAST> Error(const char *Str) {
fprintf(stderr, "Error: %s\n", Str);
return nullptr;
}
std::unique_ptr<PrototypeAST> ErrorP(const char *Str) {
Error(Str);
return nullptr;
}

static ExprAST *ParseExpression();
static std::unique_ptr<ExprAST> ParseExpression();

/// identifierexpr
/// ::= identifier
/// ::= identifier '(' expression* ')'
static ExprAST *ParseIdentifierExpr() {
static std::unique_ptr<ExprAST> ParseIdentifierExpr() {
std::string IdName = IdentifierStr;

getNextToken(); // eat identifier.

if (CurTok != '(') // Simple variable ref.
return new VariableExprAST(IdName);
return llvm::make_unique<VariableExprAST>(IdName);

// Call.
getNextToken(); // eat (
std::vector<ExprAST*> Args;
std::vector<std::unique_ptr<ExprAST>> Args;
if (CurTok != ')') {
while (1) {
ExprAST *Arg = ParseExpression();
if (!Arg) return 0;
Args.push_back(Arg);
if (auto Arg = ParseExpression())
Args.push_back(std::move(Arg));
else
return nullptr;

if (CurTok == ')') break;

Expand All @@ -193,21 +203,22 @@ static ExprAST *ParseIdentifierExpr() {
// Eat the ')'.
getNextToken();

return new CallExprAST(IdName, Args);
return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
}

/// numberexpr ::= number
static ExprAST *ParseNumberExpr() {
ExprAST *Result = new NumberExprAST(NumVal);
static std::unique_ptr<ExprAST> ParseNumberExpr() {
auto Result = llvm::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return Result;
return std::move(Result);
}

/// parenexpr ::= '(' expression ')'
static ExprAST *ParseParenExpr() {
static std::unique_ptr<ExprAST> ParseParenExpr() {
getNextToken(); // eat (.
ExprAST *V = ParseExpression();
if (!V) return 0;
auto V = ParseExpression();
if (!V)
return nullptr;

if (CurTok != ')')
return Error("expected ')'");
Expand All @@ -219,7 +230,7 @@ static ExprAST *ParseParenExpr() {
/// ::= identifierexpr
/// ::= numberexpr
/// ::= parenexpr
static ExprAST *ParsePrimary() {
static std::unique_ptr<ExprAST> ParsePrimary() {
switch (CurTok) {
default: return Error("unknown token when expecting an expression");
case tok_identifier: return ParseIdentifierExpr();
Expand All @@ -230,7 +241,8 @@ static ExprAST *ParsePrimary() {

/// binoprhs
/// ::= ('+' primary)*
static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
static std::unique_ptr<ExprAST> ParseBinOpRHS(int ExprPrec,
std::unique_ptr<ExprAST> LHS) {
// If this is a binop, find its precedence.
while (1) {
int TokPrec = GetTokPrecedence();
Expand All @@ -245,35 +257,36 @@ static ExprAST *ParseBinOpRHS(int ExprPrec, ExprAST *LHS) {
getNextToken(); // eat binop

// Parse the primary expression after the binary operator.
ExprAST *RHS = ParsePrimary();
if (!RHS) return 0;
auto RHS = ParsePrimary();
if (!RHS) return nullptr;

// If BinOp binds less tightly with RHS than the operator after RHS, let
// the pending operator take RHS as its LHS.
int NextPrec = GetTokPrecedence();
if (TokPrec < NextPrec) {
RHS = ParseBinOpRHS(TokPrec+1, RHS);
if (RHS == 0) return 0;
RHS = ParseBinOpRHS(TokPrec+1, std::move(RHS));
if (!RHS) return nullptr;
}

// Merge LHS/RHS.
LHS = new BinaryExprAST(BinOp, LHS, RHS);
LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
std::move(RHS));
}
}

/// expression
/// ::= primary binoprhs
///
static ExprAST *ParseExpression() {
ExprAST *LHS = ParsePrimary();
if (!LHS) return 0;
static std::unique_ptr<ExprAST> ParseExpression() {
auto LHS = ParsePrimary();
if (!LHS) return nullptr;

return ParseBinOpRHS(0, LHS);
return ParseBinOpRHS(0, std::move(LHS));
}

/// prototype
/// ::= id '(' id* ')'
static PrototypeAST *ParsePrototype() {
static std::unique_ptr<PrototypeAST> ParsePrototype() {
if (CurTok != tok_identifier)
return ErrorP("Expected function name in prototype");

Expand All @@ -292,32 +305,34 @@ static PrototypeAST *ParsePrototype() {
// success.
getNextToken(); // eat ')'.

return new PrototypeAST(FnName, ArgNames);
return llvm::make_unique<PrototypeAST>(std::move(FnName),
std::move(ArgNames));
}

/// definition ::= 'def' prototype expression
static FunctionAST *ParseDefinition() {
static std::unique_ptr<FunctionAST> ParseDefinition() {
getNextToken(); // eat def.
PrototypeAST *Proto = ParsePrototype();
if (Proto == 0) return 0;
auto Proto = ParsePrototype();
if (!Proto) return nullptr;

if (ExprAST *E = ParseExpression())
return new FunctionAST(Proto, E);
return 0;
if (auto E = ParseExpression())
return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}

/// toplevelexpr ::= expression
static FunctionAST *ParseTopLevelExpr() {
if (ExprAST *E = ParseExpression()) {
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
PrototypeAST *Proto = new PrototypeAST("", std::vector<std::string>());
return new FunctionAST(Proto, E);
auto Proto = llvm::make_unique<PrototypeAST>("",
std::vector<std::string>());
return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return 0;
return nullptr;
}

/// external ::= 'extern' prototype
static PrototypeAST *ParseExtern() {
static std::unique_ptr<PrototypeAST> ParseExtern() {
getNextToken(); // eat extern.
return ParsePrototype();
}
Expand Down
173 changes: 97 additions & 76 deletions llvm/examples/Kaleidoscope/Chapter3/toy.cpp

Large diffs are not rendered by default.

180 changes: 90 additions & 90 deletions llvm/examples/Kaleidoscope/Chapter4/toy.cpp

Large diffs are not rendered by default.

270 changes: 136 additions & 134 deletions llvm/examples/Kaleidoscope/Chapter5/toy.cpp

Large diffs are not rendered by default.

294 changes: 148 additions & 146 deletions llvm/examples/Kaleidoscope/Chapter6/toy.cpp

Large diffs are not rendered by default.

347 changes: 173 additions & 174 deletions llvm/examples/Kaleidoscope/Chapter7/toy.cpp

Large diffs are not rendered by default.

356 changes: 177 additions & 179 deletions llvm/examples/Kaleidoscope/Chapter8/toy.cpp

Large diffs are not rendered by default.