diff options
author | Lang Hames <lhames@gmail.com> | 2016-03-25 17:33:32 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-03-25 17:33:32 +0000 |
commit | f9878c54ae64816b411a998b54191fd6de119780 (patch) | |
tree | 8933a165a267cf3912a87a1b577f8301eec3a628 /llvm/docs/tutorial/LangImpl7.rst | |
parent | 9e964f3728b148ac26bdb80ae0d1c00eff34fa7b (diff) | |
download | bcm5719-llvm-f9878c54ae64816b411a998b54191fd6de119780.tar.gz bcm5719-llvm-f9878c54ae64816b411a998b54191fd6de119780.zip |
[Kaleidoscope] Fix 'Error' name clashes.
llvm-svn: 264426
Diffstat (limited to 'llvm/docs/tutorial/LangImpl7.rst')
-rw-r--r-- | llvm/docs/tutorial/LangImpl7.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/docs/tutorial/LangImpl7.rst b/llvm/docs/tutorial/LangImpl7.rst index aa8d86c9424..5d536bf8572 100644 --- a/llvm/docs/tutorial/LangImpl7.rst +++ b/llvm/docs/tutorial/LangImpl7.rst @@ -359,7 +359,7 @@ from the stack slot: // Look this variable up in the function. Value *V = NamedValues[Name]; if (!V) - return ErrorV("Unknown variable name"); + return LogErrorV("Unknown variable name"); // Load the value. return Builder.CreateLoad(V, Name.c_str()); @@ -578,7 +578,7 @@ implement codegen for the assignment operator. This looks like: // Assignment requires the LHS to be an identifier. VariableExprAST *LHSE = dynamic_cast<VariableExprAST*>(LHS.get()); if (!LHSE) - return ErrorV("destination of '=' must be a variable"); + return LogErrorV("destination of '=' must be a variable"); Unlike the rest of the binary operators, our assignment operator doesn't follow the "emit LHS, emit RHS, do computation" model. As such, it is @@ -597,7 +597,7 @@ allowed. // Look up the name. Value *Variable = NamedValues[LHSE->getName()]; if (!Variable) - return ErrorV("Unknown variable name"); + return LogErrorV("Unknown variable name"); Builder.CreateStore(Val, Variable); return Val; @@ -703,7 +703,7 @@ do is add it as a primary expression: static std::unique_ptr<ExprAST> ParsePrimary() { switch (CurTok) { default: - return Error("unknown token when expecting an expression"); + return LogError("unknown token when expecting an expression"); case tok_identifier: return ParseIdentifierExpr(); case tok_number: @@ -732,7 +732,7 @@ Next we define ParseVarExpr: // At least one variable name is required. if (CurTok != tok_identifier) - return Error("expected identifier after var"); + return LogError("expected identifier after var"); The first part of this code parses the list of identifier/expr pairs into the local ``VarNames`` vector. @@ -759,7 +759,7 @@ into the local ``VarNames`` vector. getNextToken(); // eat the ','. if (CurTok != tok_identifier) - return Error("expected identifier list after var"); + return LogError("expected identifier list after var"); } Once all the variables are parsed, we then parse the body and create the @@ -769,7 +769,7 @@ AST node: // At this point, we have to have 'in'. if (CurTok != tok_in) - return Error("expected 'in' keyword after 'var'"); + return LogError("expected 'in' keyword after 'var'"); getNextToken(); // eat 'in'. auto Body = ParseExpression(); |