X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=examples%2FKaleidoscope%2FChapter8%2Ftoy.cpp;h=d58dadf08bb6e7e5809a8900920c0ac2296bc668;hb=d16725c31fbb40fcbf0cdf68b2b417ba445c5140;hp=b78d901db2d5fb5525b88dc88994b4074b35b87a;hpb=23662fba704e684f24d3114bb399c80d5c0afbd9;p=oota-llvm.git diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp index b78d901db2d..d58dadf08bb 100644 --- a/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/examples/Kaleidoscope/Chapter8/toy.cpp @@ -163,7 +163,7 @@ static int gettok() { LastChar = advance(); } while (isdigit(LastChar) || LastChar == '.'); - NumVal = strtod(NumStr.c_str(), 0); + NumVal = strtod(NumStr.c_str(), nullptr); return tok_number; } @@ -431,6 +431,7 @@ std::unique_ptr Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str); return nullptr; } + std::unique_ptr ErrorP(const char *Str) { Error(Str); return nullptr; @@ -886,7 +887,7 @@ static AllocaInst *CreateEntryBlockAlloca(Function *TheFunction, const std::string &VarName) { IRBuilder<> TmpB(&TheFunction->getEntryBlock(), TheFunction->getEntryBlock().begin()); - return TmpB.CreateAlloca(Type::getDoubleTy(getGlobalContext()), 0, + return TmpB.CreateAlloca(Type::getDoubleTy(getGlobalContext()), nullptr, VarName.c_str()); }