[all-commits] [llvm/llvm-project] e0be78: [libc] Template the printf / scanf parser class (#...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Sep 21 15:02:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e0be78be427931e94d287002b9c3910f6bc6a22c
      https://github.com/llvm/llvm-project/commit/e0be78be427931e94d287002b9c3910f6bc6a22c
  Author: Joseph Huber <35342157+jhuber6 at users.noreply.github.com>
  Date:   2023-09-21 (Thu, 21 Sep 2023)

  Changed paths:
    M libc/fuzzing/stdio/CMakeLists.txt
    M libc/fuzzing/stdio/printf_parser_fuzz.cpp
    M libc/src/stdio/printf_core/CMakeLists.txt
    R libc/src/stdio/printf_core/parser.cpp
    M libc/src/stdio/printf_core/parser.h
    M libc/src/stdio/printf_core/printf_main.cpp
    M libc/src/stdio/scanf_core/CMakeLists.txt
    R libc/src/stdio/scanf_core/parser.cpp
    M libc/src/stdio/scanf_core/parser.h
    M libc/src/stdio/scanf_core/scanf_main.cpp
    M libc/test/src/stdio/printf_core/parser_test.cpp
    M libc/test/src/stdio/scanf_core/parser_test.cpp
    M utils/bazel/llvm-project-overlay/libc/BUILD.bazel

  Log Message:
  -----------
  [libc] Template the printf / scanf parser class (#66277)

Summary:
The parser class for stdio currently accepts different argument
providers. In-tree this is only used for a fuzzer test, however, the
proposed implementation of the GPU handling of printf / scanf will
require custom argument handlers. This makes the current approach of
using a preprocessor macro messier. This path proposed folding this
logic into a template instantiation. The downside to this is that
because the implementation of the parser class is placed into an
implementation file we need to manually instantiate the needed templates
which will slightly bloat binary size. Alternatively we could remove the
implementation file, or key off of the `libc` external packaging macro
so it is not present in the installed version.




More information about the All-commits mailing list