[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:26:45 PDT 2021


rprichard updated this revision to Diff 364335.
rprichard added a comment.

Update test.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107527/new/

https://reviews.llvm.org/D107527

Files:
  llvm/lib/Analysis/TargetLibraryInfo.cpp
  llvm/test/Transforms/InferFunctionAttrs/annotate.ll


Index: llvm/test/Transforms/InferFunctionAttrs/annotate.ll
===================================================================
--- llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -509,7 +509,9 @@
 ; CHECK: declare noundef i32 @getc(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
 declare i32 @getc(%opaque*)
 
-; CHECK: declare noundef i32 @getc_unlocked(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
+; CHECK-KNOWN: declare noundef i32 @getc_unlocked(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
+; CHECK-UNKNOWN: declare i32 @getc_unlocked(%opaque*)
+; CHECK-UNKNOWN-NOT: #{{.*}}
 declare i32 @getc_unlocked(%opaque*)
 
 ; CHECK: declare noundef i32 @getchar() [[NOFREE_NOUNWIND]]
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.364335.patch
Type: text/x-patch
Size: 1258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210805/916b883d/attachment.bin>


More information about the llvm-commits mailing list