public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-7843] gccrs: proc_macro: Rename from_string callback symbol
@ 2024-01-16 18:03 Arthur Cohen
  0 siblings, 0 replies; only message in thread
From: Arthur Cohen @ 2024-01-16 18:03 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b190aaeff7b4b6e3b96dfe0b5277ccc93ccb9973

commit r14-7843-gb190aaeff7b4b6e3b96dfe0b5277ccc93ccb9973
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Wed Jul 26 16:44:59 2023 +0200

    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>

Diff:
---
 gcc/rust/expand/rust-proc-macro.cc    | 4 ++--
 libgrust/libproc_macro/proc_macro.cc  | 2 +-
 libgrust/libproc_macro/registration.h | 2 +-
 libgrust/libproc_macro/tokenstream.cc | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/rust/expand/rust-proc-macro.cc b/gcc/rust/expand/rust-proc-macro.cc
index acd7f711a28..7843ead4412 100644
--- a/gcc/rust/expand/rust-proc-macro.cc
+++ b/gcc/rust/expand/rust-proc-macro.cc
@@ -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;
 
diff --git a/libgrust/libproc_macro/proc_macro.cc b/libgrust/libproc_macro/proc_macro.cc
index effe7178b89..a4046919721 100644
--- a/libgrust/libproc_macro/proc_macro.cc
+++ b/libgrust/libproc_macro/proc_macro.cc
@@ -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;
diff --git a/libgrust/libproc_macro/registration.h b/libgrust/libproc_macro/registration.h
index bba69b1e9bc..5cefc37de11 100644
--- a/libgrust/libproc_macro/registration.h
+++ b/libgrust/libproc_macro/registration.h
@@ -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 */
diff --git a/libgrust/libproc_macro/tokenstream.cc b/libgrust/libproc_macro/tokenstream.cc
index 5d9abb69a2d..0f7f1f2079b 100644
--- a/libgrust/libproc_macro/tokenstream.cc
+++ b/libgrust/libproc_macro/tokenstream.cc
@@ -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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-16 18:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 18:03 [gcc r14-7843] gccrs: proc_macro: Rename from_string callback symbol Arthur Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).