diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-09-29 18:02:48 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-09-29 18:02:48 +0000 |
commit | cc9deb48019f7e5faf401070aa417b0ead871fd6 (patch) | |
tree | 06e64c09dde0052a10e50542c3840643e723a913 /llvm/examples/Kaleidoscope/Chapter8/toy.cpp | |
parent | 410a25aa7a093ee9f6de4d12e1f8aaa1cf9c0e81 (diff) | |
download | bcm5719-llvm-cc9deb48019f7e5faf401070aa417b0ead871fd6.tar.gz bcm5719-llvm-cc9deb48019f7e5faf401070aa417b0ead871fd6.zip |
Fix Clang-tidy modernize-use-nullptr warnings in examples and include directories; other minor cleanups.
Patch by Eugene Zelenko!
Differential Revision: http://reviews.llvm.org/D13172
llvm-svn: 248811
Diffstat (limited to 'llvm/examples/Kaleidoscope/Chapter8/toy.cpp')
-rw-r--r-- | llvm/examples/Kaleidoscope/Chapter8/toy.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp b/llvm/examples/Kaleidoscope/Chapter8/toy.cpp index b78d901db2d..d58dadf08bb 100644 --- a/llvm/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/llvm/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<ExprAST> Error(const char *Str) { fprintf(stderr, "Error: %s\n", Str); return nullptr; } + std::unique_ptr<PrototypeAST> 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()); } |