Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Fix: wrong namespace used #24

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions docs/tutorial/LangImpl2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ be generated with calls like this:

.. code-block:: c++

auto LHS = llvm::make_unique<VariableExprAST>("x");
auto RHS = llvm::make_unique<VariableExprAST>("y");
auto LHS = helper::make_unique<VariableExprAST>("x");
auto RHS = helper::make_unique<VariableExprAST>("y");
auto Result = std::make_unique<BinaryExprAST>('+', std::move(LHS),
std::move(RHS));

Expand Down Expand Up @@ -206,7 +206,7 @@ which parses that production. For numeric literals, we have:

/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
auto Result = llvm::make_unique<NumberExprAST>(NumVal);
auto Result = helper::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
Expand Down Expand Up @@ -272,7 +272,7 @@ function calls:
getNextToken(); // eat identifier.

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

// Call.
getNextToken(); // eat (
Expand All @@ -296,7 +296,7 @@ function calls:
// Eat the ')'.
getNextToken();

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

This routine follows the same style as the other routines. (It expects
Expand Down Expand Up @@ -499,7 +499,7 @@ then continue parsing:
}

// Merge LHS/RHS.
LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
LHS = helper::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
std::move(RHS));
} // loop around to the top of the while loop.
}
Expand Down Expand Up @@ -529,7 +529,7 @@ above two blocks duplicated for context):
return nullptr;
}
// Merge LHS/RHS.
LHS = llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
LHS = helper::make_unique<BinaryExprAST>(BinOp, std::move(LHS),
std::move(RHS));
} // loop around to the top of the while loop.
}
Expand Down Expand Up @@ -589,7 +589,7 @@ expressions):
// success.
getNextToken(); // eat ')'.

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

Given this, a function definition is very simple, just a prototype plus
Expand All @@ -604,7 +604,7 @@ an expression to implement the body:
if (!Proto) return nullptr;

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

Expand All @@ -630,8 +630,8 @@ nullary (zero argument) functions for them:
static std::unique_ptr<FunctionAST> ParseTopLevelExpr() {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
auto Proto = llvm::make_unique<PrototypeAST>("", std::vector<std::string>());
return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
auto Proto = helper::make_unique<PrototypeAST>("", std::vector<std::string>());
return helper::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
Expand Down