diff --git a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp --- a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -416,7 +417,7 @@ return nullptr; return std::make_unique(std::move(Cond), std::move(Then), - std::move(Else)); + std::move(Else)); } /// forexpr ::= 'for' identifier '=' expr ',' expr (',' expr)? 'in' expression @@ -462,7 +463,7 @@ return nullptr; return std::make_unique(IdName, std::move(Start), std::move(End), - std::move(Step), std::move(Body)); + std::move(Step), std::move(Body)); } /// varexpr ::= 'var' identifier ('=' expression)? @@ -666,7 +667,7 @@ return LogErrorP("Invalid number of operands for operator"); return std::make_unique(FnName, ArgNames, Kind != 0, - BinaryPrecedence); + BinaryPrecedence); } /// definition ::= 'def' prototype expression @@ -686,7 +687,7 @@ if (auto E = ParseExpression()) { // Make an anonymous proto. auto Proto = std::make_unique("__anon_expr", - std::vector()); + std::vector()); return std::make_unique(std::move(Proto), std::move(E)); } return nullptr; @@ -1243,7 +1244,7 @@ auto Features = ""; TargetOptions opt; - auto RM = Optional(); + std::optional RM; auto TheTargetMachine = Target->createTargetMachine(TargetTriple, CPU, Features, opt, RM);