[libc-commits] [PATCH] D151282: [libc] Add initial support for 'puts' and 'fputs' to the GPU

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue May 30 10:28:33 PDT 2023


lntue added inline comments.


================
Comment at: libc/src/__support/File/file.h:24
+// out the buffering portions of the code in the general implementation.
+constexpr bool buffer_disabled() {
+#if defined(LIBC_TARGET_ARCH_IS_GPU)
----------------
Since most of the usage of this constexpr function is kind of double-negative form `if ( !buffer_disabled() )`, I think it is better to define this as a `static constexpr` member of class `File`, and change the name to positive form like `File::USE_BUFFER`, `File::ENABLE_BUFFER` or something like that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151282



More information about the libc-commits mailing list