[libc-commits] [PATCH] D155892: [libc][NFC] mark vprintf functions as inline

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jul 20 14:50:23 PDT 2023


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGaeec4627e6df: [libc][NFC] mark vprintf functions as inline (authored by michaelrj).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155892

Files:
  libc/src/stdio/printf_core/vfprintf_internal.h


Index: libc/src/stdio/printf_core/vfprintf_internal.h
===================================================================
--- libc/src/stdio/printf_core/vfprintf_internal.h
+++ libc/src/stdio/printf_core/vfprintf_internal.h
@@ -55,7 +55,7 @@
 
 namespace printf_core {
 
-int file_write_hook(cpp::string_view new_str, void *fp) {
+LIBC_INLINE int file_write_hook(cpp::string_view new_str, void *fp) {
   ::FILE *target_file = reinterpret_cast<::FILE *>(fp);
   // Write new_str to the target file. The logic preventing a zero-length write
   // is in the writer, so we don't check here.
@@ -66,8 +66,9 @@
   return WRITE_OK;
 }
 
-int vfprintf_internal(::FILE *__restrict stream, const char *__restrict format,
-                      internal::ArgList &args) {
+LIBC_INLINE int vfprintf_internal(::FILE *__restrict stream,
+                                  const char *__restrict format,
+                                  internal::ArgList &args) {
   constexpr size_t BUFF_SIZE = 1024;
   char buffer[BUFF_SIZE];
   printf_core::WriteBuffer wb(buffer, BUFF_SIZE, &file_write_hook,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155892.542689.patch
Type: text/x-patch
Size: 1084 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230720/bdae14df/attachment.bin>


More information about the libc-commits mailing list