]> git.ipfire.org Git - thirdparty/gcc.git/commit
Collect procedural macros in the crate
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 6 Sep 2023 12:44:20 +0000 (14:44 +0200)
committerPhilip Herron <philip.herron@embecosm.com>
Tue, 31 Oct 2023 11:39:08 +0000 (11:39 +0000)
commit573ca06d2a88c4cc27598c2f8597d8316f3fa418
tree9a92b881fd6e947ca90b387ec9d911ddeb4a4199
parent80fe1c7b6f5a253655f7b5a8849b7d3c746cecf4
Collect procedural macros in the crate

Collect informations on procedural macros in the compiled crate. For
attribute and bang procedural macros we only require the final address
as well as the name of the function. Derive procedural macros are a bit
different, we collect the fonction's address through it's fndecl tree as
well as the trait's name and the multiple attributes.

gcc/rust/ChangeLog:

* backend/rust-compile-base.cc (HIRCompileBase::setup_fndecl):
Make the function non static in order to be able to access the
compile context. Also add the whole proc macro infomrmation
collection.
(get_attributes): Add a function to retrieve the different
attributes from a derive procedural macro definition attribute.
(get_trait_name): Add a function to retrieve the trait name from
a derive procedural macro definition attribute.
* backend/rust-compile-base.h: Add function prototypes.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/backend/rust-compile-base.cc
gcc/rust/backend/rust-compile-base.h