X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=examples%2FKaleidoscope%2FChapter4%2Ftoy.cpp;h=4f77ec862b1b9df0281e0afd77ea4edf34858cbe;hb=d16725c31fbb40fcbf0cdf68b2b417ba445c5140;hp=c102784b531d292698d199c6664aad6043e469d4;hpb=51c7ae83c68d7ef04f4ed56326effbc4c406fb10;p=oota-llvm.git diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp index c102784b531..4f77ec862b1 100644 --- a/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/examples/Kaleidoscope/Chapter4/toy.cpp @@ -1,5 +1,4 @@ #include "llvm/ADT/STLExtras.h" -#include "llvm/Analysis/BasicAliasAnalysis.h" #include "llvm/Analysis/Passes.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/LLVMContext.h" @@ -66,7 +65,7 @@ static int gettok() { LastChar = getchar(); } while (isdigit(LastChar) || LastChar == '.'); - NumVal = strtod(NumStr.c_str(), 0); + NumVal = strtod(NumStr.c_str(), nullptr); return tok_number; } @@ -201,6 +200,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; @@ -534,8 +534,6 @@ static void InitializeModuleAndPassManager() { // Create a new pass manager attached to it. TheFPM = llvm::make_unique(TheModule.get()); - // Provide basic AliasAnalysis support for GVN. - TheFPM->add(createBasicAliasAnalysisPass()); // Do simple "peephole" optimizations and bit-twiddling optzns. TheFPM->add(createInstructionCombiningPass()); // Reassociate expressions.