[all-commits] [llvm/llvm-project] 014028: [clang-format] Add simple macro replacements in fo...

r4nt via All-commits all-commits at lists.llvm.org
Fri Feb 24 07:49:30 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 01402831aaae76e9c61595f9aa81a506b0d926eb
      https://github.com/llvm/llvm-project/commit/01402831aaae76e9c61595f9aa81a506b0d926eb
  Author: Manuel Klimek <klimek at google.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M clang/include/clang/Format/Format.h
    M clang/lib/Format/ContinuationIndenter.cpp
    M clang/lib/Format/Format.cpp
    M clang/lib/Format/FormatToken.h
    M clang/lib/Format/MacroExpander.cpp
    M clang/lib/Format/Macros.h
    M clang/lib/Format/TokenAnalyzer.cpp
    M clang/lib/Format/TokenAnalyzer.h
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/lib/Format/TokenAnnotator.h
    M clang/lib/Format/UnwrappedLineFormatter.cpp
    M clang/lib/Format/UnwrappedLineParser.cpp
    M clang/lib/Format/UnwrappedLineParser.h
    M clang/lib/Format/WhitespaceManager.cpp
    M clang/unittests/Format/FormatTest.cpp
    M clang/unittests/Format/MacroCallReconstructorTest.cpp
    M clang/unittests/Format/MacroExpanderTest.cpp
    M clang/unittests/Format/TestLexer.h

  Log Message:
  -----------
  [clang-format] Add simple macro replacements in formatting.

Add configuration to specify macros.
Macros will be expanded, and the code will be parsed and annotated
in the expanded state. In a second step, the formatting decisions
in the annotated expanded code will be reconstructed onto the
original unexpanded macro call.

Eventually, this will allow to remove special-case code for
various macro options we accumulated over the years in favor of
one principled mechanism.

Differential Revision: https://reviews.llvm.org/D144170




More information about the All-commits mailing list