mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 10:54:07 +08:00
gccrs: proc_macro: Rename from_string callback symbol
The symbol had a different convention from rust standard naming convention (?) hence the change before adding new callback. gcc/rust/ChangeLog: * expand/rust-proc-macro.cc (load_macros_array): Symbol rename. libgrust/ChangeLog: * libproc_macro/proc_macro.cc (Procmacro::make_bang): Change symbol name. * libproc_macro/registration.h: Likewise. * libproc_macro/tokenstream.cc (TokenStream::make_tokenstream): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
parent
de7e34bdd6
commit
b190aaeff7
@ -26,7 +26,7 @@ namespace Rust {
|
||||
|
||||
const std::string PROC_MACRO_DECL_PREFIX = "__gccrs_proc_macro_decls_";
|
||||
|
||||
ProcMacro::TokenStream
|
||||
static ProcMacro::TokenStream
|
||||
tokenstream_from_string (std::string &data, bool &lex_error)
|
||||
{
|
||||
// FIXME: Insert location pointing to call site in tokens
|
||||
@ -92,7 +92,7 @@ load_macros_array (std::string path)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!REGISTER_CALLBACK (handle, __gccrs_pm_callback_from_str_fn,
|
||||
if (!REGISTER_CALLBACK (handle, __gccrs_proc_macro_from_str_fn,
|
||||
tokenstream_from_string))
|
||||
return nullptr;
|
||||
|
||||
|
@ -51,4 +51,4 @@ Procmacro::make_bang (const char *name, BangMacro macro)
|
||||
|
||||
} // namespace ProcMacro
|
||||
|
||||
ProcMacro::from_str_function_t __gccrs_pm_callback_from_str_fn = nullptr;
|
||||
ProcMacro::from_str_function_t __gccrs_proc_macro_from_str_fn = nullptr;
|
||||
|
@ -32,6 +32,6 @@ using from_str_function_t = ProcMacro::TokenStream (*) (std::string &, bool &);
|
||||
|
||||
} // namespace ProcMacro
|
||||
|
||||
extern "C" ProcMacro::from_str_function_t __gccrs_pm_callback_from_str_fn;
|
||||
extern "C" ProcMacro::from_str_function_t __gccrs_proc_macro_from_str_fn;
|
||||
|
||||
#endif /* !REGISTRATION_H */
|
||||
|
@ -49,7 +49,7 @@ TokenStream::make_tokenstream (std::uint64_t capacity)
|
||||
TokenStream
|
||||
TokenStream::make_tokenstream (std::string &source, bool &has_error)
|
||||
{
|
||||
return __gccrs_pm_callback_from_str_fn (source, has_error);
|
||||
return __gccrs_proc_macro_from_str_fn (source, has_error);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user