aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-07-26 17:44:50 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2023-07-27 12:25:20 +0000
commit614f081a5e5dabdeef6ba5718aa7b3730f4e3fe7 (patch)
tree23c6c0eab4d876917846fc501842423cd8a6e207 /gcc
parent4321126f05b46c83a11256c3e1d0ed905660d657 (diff)
downloadgcc-614f081a5e5dabdeef6ba5718aa7b3730f4e3fe7.zip
gcc-614f081a5e5dabdeef6ba5718aa7b3730f4e3fe7.tar.gz
gcc-614f081a5e5dabdeef6ba5718aa7b3730f4e3fe7.tar.bz2
proc_macro: Remode function indirection
There was no need to register a function when the value could be registered directly. gcc/rust/ChangeLog: * expand/rust-proc-macro.cc (available): Remove function. (load_macros_array): There was no need for an indirection here. ChangeLog: * libgrust/libproc_macro/proc_macro.cc (not_available): Remove function. * libgrust/libproc_macro/proc_macro.h (not_available): Remove function prototype. * libgrust/libproc_macro/registration.h: Change symbol type. * libgrust/libproc_macro/bridge.h: New file. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/expand/rust-proc-macro.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/gcc/rust/expand/rust-proc-macro.cc b/gcc/rust/expand/rust-proc-macro.cc
index b6cfe25..9fee4bb 100644
--- a/gcc/rust/expand/rust-proc-macro.cc
+++ b/gcc/rust/expand/rust-proc-macro.cc
@@ -56,12 +56,6 @@ static_assert (
ProcMacro::from_str_function_t>::value,
"Registration callback signature not synced, check proc macro internals.");
-static bool
-available ()
-{
- return true;
-}
-
template <typename Symbol, typename Callback>
bool
register_callback (void *handle, Symbol, std::string symbol_name,
@@ -102,7 +96,7 @@ load_macros_array (std::string path)
tokenstream_from_string))
return nullptr;
if (!REGISTER_CALLBACK (handle, __gccrs_proc_macro_is_available_fn,
- available))
+ ProcMacro::BridgeState::Available))
return nullptr;
// FIXME: Add CrateStableId handling, right now all versions may be loaded,