diff options
Diffstat (limited to 'llvm/examples/Kaleidoscope/Chapter5/toy.cpp')
-rw-r--r-- | llvm/examples/Kaleidoscope/Chapter5/toy.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp b/llvm/examples/Kaleidoscope/Chapter5/toy.cpp index 534c8e529e4..3eeb1c14a36 100644 --- a/llvm/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter5/toy.cpp @@ -278,7 +278,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); } @@ -305,7 +305,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 ( @@ -329,7 +329,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 @@ -358,7 +358,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)); } @@ -404,7 +404,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)); } @@ -464,7 +464,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)); } } @@ -500,7 +500,7 @@ static std::unique_ptr<PrototypeAST> ParsePrototype() { // success. getNextToken(); // eat ')'. - return llvm::make_unique<PrototypeAST>(FnName, std::move(ArgNames)); + return std::make_unique<PrototypeAST>(FnName, std::move(ArgNames)); } /// definition ::= 'def' prototype expression @@ -511,7 +511,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; } @@ -519,9 +519,9 @@ static std::unique_ptr<FunctionAST> ParseDefinition() { static std::unique_ptr<FunctionAST> ParseTopLevelExpr() { if (auto E = ParseExpression()) { // Make an anonymous proto. - auto Proto = llvm::make_unique<PrototypeAST>("__anon_expr", + auto Proto = std::make_unique<PrototypeAST>("__anon_expr", 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; } @@ -824,11 +824,11 @@ Function *FunctionAST::codegen() { static void InitializeModuleAndPassManager() { // 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->getTargetMachine().createDataLayout()); // Create a new pass manager attached to it. - TheFPM = llvm::make_unique<legacy::FunctionPassManager>(TheModule.get()); + TheFPM = std::make_unique<legacy::FunctionPassManager>(TheModule.get()); // Do simple "peephole" optimizations and bit-twiddling optzns. TheFPM->add(createInstructionCombiningPass()); @@ -963,7 +963,7 @@ int main() { fprintf(stderr, "ready> "); getNextToken(); - TheJIT = llvm::make_unique<KaleidoscopeJIT>(); + TheJIT = std::make_unique<KaleidoscopeJIT>(); InitializeModuleAndPassManager(); |