summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp')
-rw-r--r--llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
index 8cbd5d6f2f7..b4605bae4ed 100644
--- a/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
+++ b/llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
@@ -329,7 +329,7 @@ static std::unique_ptr<ExprAST> ParseExpression();
/// numberexpr ::= number
static std::unique_ptr<ExprAST> ParseNumberExpr() {
- auto Result = llvm::make_unique<NumberExprAST>(NumVal);
+ auto Result = std::make_unique<NumberExprAST>(NumVal);
getNextToken(); // consume the number
return std::move(Result);
}
@@ -356,7 +356,7 @@ static std::unique_ptr<ExprAST> ParseIdentifierExpr() {
getNextToken(); // eat identifier.
if (CurTok != '(') // Simple variable ref.
- return llvm::make_unique<VariableExprAST>(IdName);
+ return std::make_unique<VariableExprAST>(IdName);
// Call.
getNextToken(); // eat (
@@ -380,7 +380,7 @@ static std::unique_ptr<ExprAST> ParseIdentifierExpr() {
// Eat the ')'.
getNextToken();
- return llvm::make_unique<CallExprAST>(IdName, std::move(Args));
+ return std::make_unique<CallExprAST>(IdName, std::move(Args));
}
/// ifexpr ::= 'if' expression 'then' expression 'else' expression
@@ -409,7 +409,7 @@ static std::unique_ptr<ExprAST> ParseIfExpr() {
if (!Else)
return nullptr;
- return llvm::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
+ return std::make_unique<IfExprAST>(std::move(Cond), std::move(Then),
std::move(Else));
}
@@ -455,7 +455,7 @@ static std::unique_ptr<ExprAST> ParseForExpr() {
if (!Body)
return nullptr;
- return llvm::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
+ return std::make_unique<ForExprAST>(IdName, std::move(Start), std::move(End),
std::move(Step), std::move(Body));
}
@@ -504,7 +504,7 @@ static std::unique_ptr<ExprAST> ParseVarExpr() {
if (!Body)
return nullptr;
- return llvm::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
+ return std::make_unique<VarExprAST>(std::move(VarNames), std::move(Body));
}
/// primary
@@ -545,7 +545,7 @@ static std::unique_ptr<ExprAST> ParseUnary() {
int Opc = CurTok;
getNextToken();
if (auto Operand = ParseUnary())
- return llvm::make_unique<UnaryExprAST>(Opc, std::move(Operand));
+ return std::make_unique<UnaryExprAST>(Opc, std::move(Operand));
return nullptr;
}
@@ -582,7 +582,7 @@ static std::unique_ptr<ExprAST> ParseBinOpRHS(int ExprPrec,
// Merge LHS/RHS.
LHS =
- llvm::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
+ std::make_unique<BinaryExprAST>(BinOp, std::move(LHS), std::move(RHS));
}
}
@@ -659,7 +659,7 @@ static std::unique_ptr<PrototypeAST> ParsePrototype() {
if (Kind && ArgNames.size() != Kind)
return LogErrorP("Invalid number of operands for operator");
- return llvm::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
+ return std::make_unique<PrototypeAST>(FnName, ArgNames, Kind != 0,
BinaryPrecedence);
}
@@ -671,7 +671,7 @@ static std::unique_ptr<FunctionAST> ParseDefinition() {
return nullptr;
if (auto E = ParseExpression())
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
return nullptr;
}
@@ -679,9 +679,9 @@ static std::unique_ptr<FunctionAST> ParseDefinition() {
static std::unique_ptr<FunctionAST> ParseTopLevelExpr(unsigned ExprCount) {
if (auto E = ParseExpression()) {
// Make an anonymous proto.
- auto Proto = llvm::make_unique<PrototypeAST>
+ auto Proto = std::make_unique<PrototypeAST>
(("__anon_expr" + Twine(ExprCount)).str(), std::vector<std::string>());
- return llvm::make_unique<FunctionAST>(std::move(Proto), std::move(E));
+ return std::make_unique<FunctionAST>(std::move(Proto), std::move(E));
}
return nullptr;
}
@@ -1103,11 +1103,11 @@ Function *FunctionAST::codegen() {
static void InitializeModule() {
// Open a new module.
- TheModule = llvm::make_unique<Module>("my cool jit", *TheContext);
+ TheModule = std::make_unique<Module>("my cool jit", *TheContext);
TheModule->setDataLayout(TheJIT->getDataLayout());
// Create a new builder for the module.
- Builder = llvm::make_unique<IRBuilder<>>(*TheContext);
+ Builder = std::make_unique<IRBuilder<>>(*TheContext);
}
static void HandleDefinition() {
OpenPOWER on IntegriCloud