[libcxx-commits] [PATCH] D104601: [Preprocessor] Implement -fnormalize-whitespace.

Michael Kruse via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 19 18:32:27 PDT 2021


Meinersbur created this revision.
Herald added subscribers: dang, jvesely.
Meinersbur requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, libcxx-commits, cfe-commits, sstefan1.
Herald added projects: clang, libc++, OpenMP.
Herald added a reviewer: libc++.

This patch adds the `-fnormalize-whitespace` with the following effects:

- If combined with `-E`, remove as much non-line-breaking whitespace as possible
- If combined with `-E -P`, removes as much whitespace as possible, including line-breaks.

The motivation is to reduce


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104601

Files:
  clang/docs/ClangCommandLineReference.rst
  clang/include/clang/Driver/Options.td
  clang/include/clang/Frontend/PreprocessorOutputOptions.h
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/PrintPreprocessedOutput.cpp
  clang/test/CXX/lex/lex.pptoken/p3-2a.cpp
  clang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld
  clang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld
  clang/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld
  clang/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld
  clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/as
  clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/ld
  clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/as
  clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/ld
  clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/as
  clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/ld
  clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/as
  clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/ld
  clang/test/Preprocessor/c99-6_10_3_4_p5.c
  clang/test/Preprocessor/c99-6_10_3_4_p6.c
  clang/test/Preprocessor/comment_save.c
  clang/test/Preprocessor/first-line-indent.c
  clang/test/Preprocessor/hash_line.c
  clang/test/Preprocessor/line-directive-output-normcol.c
  clang/test/Preprocessor/line-directive-output.c
  clang/test/Preprocessor/macro_space.c
  clang/test/Preprocessor/normalize-whitespace.c
  clang/test/Preprocessor/print_line_include.c
  clang/test/Preprocessor/stringize_space.c
  libclc/amdgcn-mesa3d
  libcxx/test/std/pstl
  openmp/tools/analyzer/llvm-openmp-analyzer++

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104601.353219.patch
Type: text/x-patch
Size: 41052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210620/5c0b0237/attachment-0001.bin>


More information about the libcxx-commits mailing list