aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-07-26 17:44:50 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:56:01 +0100
commit8db58652d87e3b3bd208aea8f3aad14427780f0a (patch)
treed20074b949a6819c8ac8805ce11a97bd508a9577 /gcc
parentce09474789d6e6df1b2b921df84c27db80fe02ba (diff)
downloadgcc-8db58652d87e3b3bd208aea8f3aad14427780f0a.zip
gcc-8db58652d87e3b3bd208aea8f3aad14427780f0a.tar.gz
gcc-8db58652d87e3b3bd208aea8f3aad14427780f0a.tar.bz2
gccrs: 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. libgrust/ChangeLog: * libproc_macro/proc_macro.cc (not_available): Remove function. * libproc_macro/proc_macro.h (not_available): Remove function prototype. * libproc_macro/registration.h: Change symbol type. * 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,