LastChar = advance();
} while (isdigit(LastChar) || LastChar == '.');
- NumVal = strtod(NumStr.c_str(), 0);
+ NumVal = strtod(NumStr.c_str(), nullptr);
return tok_number;
}
fprintf(stderr, "Error: %s\n", Str);
return nullptr;
}
+
std::unique_ptr<PrototypeAST> ErrorP(const char *Str) {
Error(Str);
return nullptr;
for (unsigned i = 0, e = NumArgs; i != e; ++i)
EltTys.push_back(DblTy);
- return DBuilder->createSubroutineType(Unit,
- DBuilder->getOrCreateTypeArray(EltTys));
+ return DBuilder->createSubroutineType(DBuilder->getOrCreateTypeArray(EltTys));
}
//===----------------------------------------------------------------------===//
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());
}
/// putchard - putchar that takes a double and returns 0.
extern "C" double putchard(double X) {
- putchar((char)X);
+ fputc((char)X, stderr);
return 0;
}
/// printd - printf that takes a double prints it as "%f\n", returning 0.
extern "C" double printd(double X) {
- printf("%f\n", X);
+ fprintf(stderr, "%f\n", X);
return 0;
}