[PATCH] D107527: Mark getc_unlocked as unavailable by default

Ryan Prichard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 4 20:13:13 PDT 2021


rprichard created this revision.
Herald added subscribers: mstorsjo, hiraditya.
rprichard requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Before D45736 <https://reviews.llvm.org/D45736>, getc_unlocked was available by default, but turned off
for non-Cygwin/non-MinGW Windows. D45736 <https://reviews.llvm.org/D45736> then added 9 more unlocked
functions, which were unavailable by default, but it also:

- left getc_unlocked enabled by default,
- removed the disabling line for Windows, and
- added code to enable getc_unlocked for GNU, Android, and OSX.

For consistency, make getc_unlocked unavailable by default. Maybe this
was the intent of D45736 <https://reviews.llvm.org/D45736> anyway.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107527

Files:
  llvm/lib/Analysis/TargetLibraryInfo.cpp


Index: llvm/lib/Analysis/TargetLibraryInfo.cpp
===================================================================
--- llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -123,6 +123,7 @@
 
   // Set IO unlocked variants as unavailable
   // Set them as available per system below
+  TLI.setUnavailable(LibFunc_getc_unlocked);
   TLI.setUnavailable(LibFunc_getchar_unlocked);
   TLI.setUnavailable(LibFunc_putc_unlocked);
   TLI.setUnavailable(LibFunc_putchar_unlocked);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107527.364333.patch
Type: text/x-patch
Size: 506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210805/6ae8746d/attachment.bin>


More information about the llvm-commits mailing list