diff options
author | Matt Morehouse <mascasa@google.com> | 2018-04-27 01:48:09 +0000 |
---|---|---|
committer | Matt Morehouse <mascasa@google.com> | 2018-04-27 01:48:09 +0000 |
commit | 1ae1febfde7e6860bb199132859f46909b87593c (patch) | |
tree | 319b496177aae7156875093fe098c75ee32e800a /llvm/lib/Analysis/TargetLibraryInfo.cpp | |
parent | 18db58e7c7e76bdec856e36fff49ae53fdc07e4a (diff) | |
download | bcm5719-llvm-1ae1febfde7e6860bb199132859f46909b87593c.tar.gz bcm5719-llvm-1ae1febfde7e6860bb199132859f46909b87593c.zip |
Revert "[SimplifyLibcalls] Replace locked IO with unlocked IO"
This reverts r331002 due to sanitizer bot breakage.
llvm-svn: 331011
Diffstat (limited to 'llvm/lib/Analysis/TargetLibraryInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/TargetLibraryInfo.cpp | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index d3536bd0ab2..ff6aae8b5ec 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -62,18 +62,6 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, }) && "TargetLibraryInfoImpl function names must be sorted"); - // Set IO unlocked variants as unavailable - // Set them as available per system below - TLI.setUnavailable(LibFunc_getchar_unlocked); - TLI.setUnavailable(LibFunc_putc_unlocked); - TLI.setUnavailable(LibFunc_putchar_unlocked); - TLI.setUnavailable(LibFunc_fputc_unlocked); - TLI.setUnavailable(LibFunc_fgetc_unlocked); - TLI.setUnavailable(LibFunc_fread_unlocked); - TLI.setUnavailable(LibFunc_fwrite_unlocked); - TLI.setUnavailable(LibFunc_fputs_unlocked); - TLI.setUnavailable(LibFunc_fgets_unlocked); - bool ShouldExtI32Param = false, ShouldExtI32Return = false, ShouldSignExtI32Param = false; // PowerPC64, Sparc64, SystemZ need signext/zeroext on i32 parameters and @@ -119,12 +107,6 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, // memset_pattern16 is only available on iOS 3.0 and Mac OS X 10.5 and later. // All versions of watchOS support it. if (T.isMacOSX()) { - // available IO unlocked variants on Mac OS X - TLI.setAvailable(LibFunc_getc_unlocked); - TLI.setAvailable(LibFunc_getchar_unlocked); - TLI.setAvailable(LibFunc_putc_unlocked); - TLI.setAvailable(LibFunc_putchar_unlocked); - if (T.isMacOSXVersionLT(10, 5)) TLI.setUnavailable(LibFunc_memset_pattern16); } else if (T.isiOS()) { @@ -283,6 +265,7 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, TLI.setUnavailable(LibFunc_ftello); TLI.setUnavailable(LibFunc_ftrylockfile); TLI.setUnavailable(LibFunc_funlockfile); + TLI.setUnavailable(LibFunc_getc_unlocked); TLI.setUnavailable(LibFunc_getitimer); TLI.setUnavailable(LibFunc_getlogin_r); TLI.setUnavailable(LibFunc_getpwnam); @@ -482,20 +465,6 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T, TLI.setUnavailable(LibFunc_sinhl_finite); } - if (T.isOSLinux()) { - // available IO unlocked variants on Linux - TLI.setAvailable(LibFunc_getc_unlocked); - TLI.setAvailable(LibFunc_getchar_unlocked); - TLI.setAvailable(LibFunc_putc_unlocked); - TLI.setAvailable(LibFunc_putchar_unlocked); - TLI.setAvailable(LibFunc_fputc_unlocked); - TLI.setAvailable(LibFunc_fgetc_unlocked); - TLI.setAvailable(LibFunc_fread_unlocked); - TLI.setAvailable(LibFunc_fwrite_unlocked); - TLI.setAvailable(LibFunc_fputs_unlocked); - TLI.setAvailable(LibFunc_fgets_unlocked); - } - // As currently implemented in clang, NVPTX code has no standard library to // speak of. Headers provide a standard-ish library implementation, but many // of the signatures are wrong -- for example, many libm functions are not @@ -836,7 +805,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy, case LibFunc_feof: case LibFunc_fflush: case LibFunc_fgetc: - case LibFunc_fgetc_unlocked: case LibFunc_fileno: case LibFunc_flockfile: case LibFunc_free: @@ -865,7 +833,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy, return (NumParams == 2 && FTy.getReturnType()->isPointerTy() && FTy.getParamType(1)->isPointerTy()); case LibFunc_fputc: - case LibFunc_fputc_unlocked: case LibFunc_fstat: case LibFunc_frexp: case LibFunc_frexpf: @@ -873,22 +840,18 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy, case LibFunc_fstatvfs: return (NumParams == 2 && FTy.getParamType(1)->isPointerTy()); case LibFunc_fgets: - case LibFunc_fgets_unlocked: return (NumParams == 3 && FTy.getParamType(0)->isPointerTy() && FTy.getParamType(2)->isPointerTy()); case LibFunc_fread: - case LibFunc_fread_unlocked: return (NumParams == 4 && FTy.getParamType(0)->isPointerTy() && FTy.getParamType(3)->isPointerTy()); case LibFunc_fwrite: - case LibFunc_fwrite_unlocked: return (NumParams == 4 && FTy.getReturnType()->isIntegerTy() && FTy.getParamType(0)->isPointerTy() && FTy.getParamType(1)->isIntegerTy() && FTy.getParamType(2)->isIntegerTy() && FTy.getParamType(3)->isPointerTy()); case LibFunc_fputs: - case LibFunc_fputs_unlocked: return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() && FTy.getParamType(1)->isPointerTy()); case LibFunc_fscanf: @@ -901,7 +864,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy, return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() && FTy.getParamType(1)->isPointerTy()); case LibFunc_getchar: - case LibFunc_getchar_unlocked: return (NumParams == 0 && FTy.getReturnType()->isIntegerTy()); case LibFunc_gets: return (NumParams == 1 && FTy.getParamType(0) == PCharTy); @@ -914,7 +876,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy, return (NumParams == 2 && FTy.getParamType(0)->isPointerTy() && FTy.getParamType(1)->isPointerTy()); case LibFunc_putc: - case LibFunc_putc_unlocked: return (NumParams == 2 && FTy.getParamType(1)->isPointerTy()); case LibFunc_pread: case LibFunc_pwrite: @@ -1301,7 +1262,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy, case LibFunc_isascii: case LibFunc_toascii: case LibFunc_putchar: - case LibFunc_putchar_unlocked: return (NumParams == 1 && FTy.getReturnType()->isIntegerTy(32) && FTy.getReturnType() == FTy.getParamType(0)); |