From c0a7f3e67a428affcd508eb272034fceb7f2841f Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Wed, 20 Sep 2023 17:39:16 +0200 Subject: gccrs: Add macro buffer global variable export Export a new symbol containing the proc macros. gcc/rust/ChangeLog: * backend/rust-compile-base.h: Make static function address_expression public. * backend/rust-compile.cc (CompileCrate::add_proc_macro_symbols): Add new global variable in export function. (build_bang_proc_macro): Add a function to build the bang proc macro structure type. (build_proc_macro): Add a function to build the proc macro structure type. (build_proc_macro_payload): Add a function to build the proc macro union used in proc macro structures. (init_derive_proc_macro): Add a function to initialize custom derive proc macros. (init_attribute_proc_macro): Add a function to initialize attribute proc macros. (init_bang_proc_macro): Add a function to initialize bang proc macros. (init_proc_macro): Add a function to initialize proc macro structures. (initialize_proc_macro_array): Add a function to initialize the proc macro buffer array. (CompileCrate::add_proc_macro_symbols): Add call to the new functions to correctly initialize proc macros as well as their entrypoint. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/backend/rust-compile-base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/rust/backend/rust-compile-base.h') diff --git a/gcc/rust/backend/rust-compile-base.h b/gcc/rust/backend/rust-compile-base.h index 41907ec..6529123 100644 --- a/gcc/rust/backend/rust-compile-base.h +++ b/gcc/rust/backend/rust-compile-base.h @@ -29,6 +29,8 @@ class HIRCompileBase public: virtual ~HIRCompileBase () {} + static tree address_expression (tree expr, location_t locus); + protected: HIRCompileBase (Context *ctx) : ctx (ctx) {} @@ -139,8 +141,6 @@ protected: static void setup_abi_options (tree fndecl, ABI abi); - static tree address_expression (tree expr, location_t locus); - static tree indirect_expression (tree expr, location_t locus); static bool mark_addressable (tree, location_t); -- cgit v1.1