diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/CodeGen/FunctionGen.cc | 2 | ||||
| -rw-r--r-- | lib/CodeGen/StringConversionHandler.cc | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/FunctionGen.cc b/lib/CodeGen/FunctionGen.cc index 9ccd8af..978970a 100644 --- a/lib/CodeGen/FunctionGen.cc +++ b/lib/CodeGen/FunctionGen.cc @@ -11,7 +11,7 @@ using namespace cps; static bool isReservedRuntimeName(const std::string &Name) { static const char *Reserved[] = { "main", "printf", "scanf", "malloc", "free", "strlen", "memcpy", - "strcpy", "strcat", "toupper", "tolower", "sprintf", "strtol", + "strcpy", "strcat", "toupper", "tolower", "sprintf", "strtol", "strtoll", "strtod", "memset", "exit", "fopen", "fclose", "fgetc", "ungetc", "fputs", "fputc", "realloc", "strcmp", "__cxa_allocate_exception", "__cxa_throw", diff --git a/lib/CodeGen/StringConversionHandler.cc b/lib/CodeGen/StringConversionHandler.cc index 3b49cbb..6f7461c 100644 --- a/lib/CodeGen/StringConversionHandler.cc +++ b/lib/CodeGen/StringConversionHandler.cc @@ -12,8 +12,8 @@ void StringConversionHandler::setupExternalFunctions() { FunctionType *SprintfType = FunctionType::get(Type::getInt32Ty(Context), {PointerType::getUnqual(Context), PointerType::getUnqual(Context)}, true); SprintfFunc = Module.getOrInsertFunction("sprintf", SprintfType); - FunctionType *StrtolType = FunctionType::get(Type::getInt64Ty(Context), {PointerType::getUnqual(Context), PointerType::getUnqual(Context), Type::getInt32Ty(Context)}, false); - StrtolFunc = Module.getOrInsertFunction("strtol", StrtolType); + FunctionType *StrtollType = FunctionType::get(Type::getInt64Ty(Context), {PointerType::getUnqual(Context), PointerType::getUnqual(Context), Type::getInt32Ty(Context)}, false); + StrtollFunc = Module.getOrInsertFunction("strtoll", StrtollType); FunctionType *StrtodType = FunctionType::get(Type::getDoubleTy(Context), {PointerType::getUnqual(Context), PointerType::getUnqual(Context)}, false); StrtodFunc = Module.getOrInsertFunction("strtod", StrtodType); @@ -43,7 +43,7 @@ Value *StringConversionHandler::emitStrToNum(Value *Str, bool AsReal) { return Builder.CreateCall(StrtodFunc, {Str, NullPtr}, "str_to_real"); } else { Value *Base = ConstantInt::get(Type::getInt32Ty(Context), 10); - return Builder.CreateCall(StrtolFunc, {Str, NullPtr, Base}, "str_to_int"); + return Builder.CreateCall(StrtollFunc, {Str, NullPtr, Base}, "str_to_int"); } } |
