]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Resolve nested macro definition
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 8 Aug 2023 10:16:44 +0000 (12:16 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:34 +0000 (19:00 +0100)
commitdfef82f273690130660acc4bf989d372c33e7528
tree1cf682e11b3ebee221782e42e2aefa8aac337cf3
parent9048f08f4e94594b837290ac26f3a5bbeb47f2c3
gccrs: Resolve nested macro definition

We need to collect the early resolver's macros error to emit them at a
later stage after further expansion in order to retrieve macros defined
by other macro invocations.
Register some mappings for macro invocations and macro definitions.

gcc/rust/ChangeLog:

* resolve/rust-early-name-resolver-2.0.cc (Early::visit):
Collect error instead of emitting it. Also add invocation
registration.
* resolve/rust-early-name-resolver-2.0.h (std::function<void):
Add type definition for collection.
* resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit):
Register macro rule definition in mappings.
* rust-session-manager.cc (Session::expansion): Add macro
resolve error collection.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/resolve/rust-early-name-resolver-2.0.cc
gcc/rust/resolve/rust-early-name-resolver-2.0.h
gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc
gcc/rust/rust-session-manager.cc