[libc-commits] [PATCH] D122773: [libc][NFC] add outline of printf

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Mar 31 13:42:16 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/src/stdio/printf_files/core_structs.h:48
+
+struct format_section {
+  bool has_conv;
----------------
Type names should be of the form `TypeName`.


================
Comment at: libc/src/stdio/printf_files/parser.h:18
+namespace __llvm_libc {
+namespace internal {
+namespace printf_core {
----------------
Do we really need an `internal` namespace here? You normally introduce an internal namespace to indicate that the interface declared in such a namespace is not to be used by clients of the higher level namespace. If we do need something internal, ISTM that the nesting should be reversed? As in, `internal` should be nested inside `printf_core`?


================
Comment at: libc/src/stdio/printf_files/writer.h:20
+
+class Writer {
+  void *output;
----------------
Is this class envisioned to be a `final` class? If yes, then we should have documentation of the expectations. For example, what is `output`, `raw_write` etc. If not also, we should add documentation about how it is to be specialized.


================
Comment at: libc/src/stdio/printf_files/writer.h:33
+
+  size_t get_chars_written();
+};
----------------
Why is size required at all?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122773



More information about the libc-commits mailing list