[all-commits] [llvm/llvm-project] e336b7: [clang-format] Add a MacroExpander.

r4nt via All-commits all-commits at lists.llvm.org
Fri Sep 25 05:09:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e336b74c995d665bc3fb75164375bbb0f78f516c
      https://github.com/llvm/llvm-project/commit/e336b74c995d665bc3fb75164375bbb0f78f516c
  Author: Manuel Klimek <klimek at google.com>
  Date:   2020-09-25 (Fri, 25 Sep 2020)

  Changed paths:
    M clang/lib/Format/CMakeLists.txt
    M clang/lib/Format/FormatToken.h
    A clang/lib/Format/MacroExpander.cpp
    A clang/lib/Format/Macros.h
    M clang/unittests/Format/CMakeLists.txt
    A clang/unittests/Format/MacroExpanderTest.cpp
    A clang/unittests/Format/TestLexer.h

  Log Message:
  -----------
  [clang-format] Add a MacroExpander.

Summary:
The MacroExpander allows to expand simple (non-resursive) macro
definitions from a macro identifier token and macro arguments. It
annotates the tokens with a newly introduced MacroContext that keeps
track of the role a token played in expanding the macro in order to
be able to reconstruct the macro expansion from an expanded (formatted)
token stream.

Made Token explicitly copy-able to enable copying tokens from the parsed
macro definition.

Reviewers: sammccall

Subscribers: mgorny, cfe-commits

Tags: #clang

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




More information about the All-commits mailing list