HomePhabricator

[clang-format] Add a MacroExpander.

Authored by klimek on Jul 7 2020, 3:17 AM.

Description

[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

Details

Committed
klimekSep 25 2020, 5:08 AM
Differential Revision
D83296: [clang-format] Add a MacroExpander.
Parents
rGb8880f5f97bf: [mlir] [VectorOps] generalize printing support for integers
Branches
Unknown
Tags
Unknown