]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: libproc_macro: Put all structures in a namespace
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 25 Apr 2023 10:42:47 +0000 (12:42 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:34:15 +0000 (18:34 +0100)
Put all functions and structures in a Procmacro namespace to avoid
spilling names in any other namespace.

libgrust/ChangeLog:

* libproc_macro/group.cc (Group::drop): Add Procmacro
namespace.
* libproc_macro/group.h: Likewise.
* libproc_macro/ident.cc (Ident::drop): Likewise.
* libproc_macro/ident.h (Ident__clone): Likewise.
* libproc_macro/literal.cc (Literal::make_isize):
Likewise.
* libproc_macro/literal.h (Literal__from_string):
Likewise.
* libproc_macro/punct.cc (Punct::make_punct): Likewise.
* libproc_macro/punct.h: Likewise.
* libproc_macro/tokenstream.cc (TokenStream__drop):
Likewise.
* libproc_macro/tokenstream.h (TokenStream__drop):
Likewise.
* libproc_macro/tokentree.cc (TokenTree::drop):
Likewise.
* libproc_macro/tokentree.h: Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
12 files changed:
libgrust/libproc_macro/group.cc
libgrust/libproc_macro/group.h
libgrust/libproc_macro/ident.cc
libgrust/libproc_macro/ident.h
libgrust/libproc_macro/literal.cc
libgrust/libproc_macro/literal.h
libgrust/libproc_macro/punct.cc
libgrust/libproc_macro/punct.h
libgrust/libproc_macro/tokenstream.cc
libgrust/libproc_macro/tokenstream.h
libgrust/libproc_macro/tokentree.cc
libgrust/libproc_macro/tokentree.h

index c5948ed03c79d97e8d0dcf98240a8cb54816aa93..9394387f6367a54ba270d7a8e845dbbb71677382 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "group.h"
 
+namespace ProcMacro {
 namespace Group {
 
 Group
@@ -37,3 +38,4 @@ Group::drop (Group *g)
 }
 
 } // namespace Group
+} // namespace ProcMacro
index bf2a23ff3ecfd8fbe1a00ba4837f91d033db1dee..51913253550dc1297aea120bcb1a8933d26c01cf 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "tokenstream.h"
 
+namespace ProcMacro {
 namespace Group {
 
 enum Delimiter
@@ -47,5 +48,6 @@ public:
 };
 
 } // namespace Group
+} // namespace ProcMacro
 
 #endif /* ! GROUP_H */
index 0bed2a8e7d4deea634d9d974822f5b067a7e89b8..6fe8676d45f17981600f7405529dd848c0e9d4a5 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <cstring>
 
+namespace ProcMacro {
 namespace Ident {
 
 extern "C" {
@@ -84,3 +85,4 @@ Ident::drop (Ident *ident)
 }
 
 } // namespace Ident
+} // namespace ProcMacro
index 0e21275863eaa655f8cd8dbc164cf8fc8b5aac14..0c89185f30669bd8e8a1fb8a8bf98a88ec7dc983 100644 (file)
@@ -26,6 +26,7 @@
 #include <cstdint>
 #include <string>
 
+namespace ProcMacro {
 namespace Ident {
 
 struct Ident
@@ -61,5 +62,6 @@ Ident__clone (const Ident *ident);
 }
 
 } // namespace Ident
+} // namespace ProcMacro
 
 #endif /* ! IDENT_H */
index d4977533a90e226d2f2e7516745ab2c139a5efd5..13b97a9417d50f0a746d5080f5c3e0b5024477f4 100644 (file)
@@ -24,6 +24,7 @@
 #include <cstring>
 #include <cstdlib>
 
+namespace ProcMacro {
 namespace Literal {
 
 void
@@ -289,3 +290,4 @@ Literal::make_isize (std::int64_t value, bool suffixed)
 }
 
 } // namespace Literal
+} // namespace ProcMacro
index 2c61231e8b25ae80849933b36f31a9460d41a4b7..15d40e066202b502da86ba457e0888d906ecf264 100644 (file)
@@ -27,6 +27,7 @@
 #include <string>
 #include <vector>
 
+namespace ProcMacro {
 namespace Literal {
 enum UnsignedTag
 {
@@ -207,5 +208,6 @@ Literal__from_string (const unsigned char *str, std::uint64_t len,
                      Literal *lit);
 }
 } // namespace Literal
+} // namespace ProcMacro
 
 #endif /* ! LITERAL_H */
index 67d35fec5a8068da95d66475efc3c635aa7272d6..762d6424f94bbd351e0e8091782f4a5cec6c3df8 100644 (file)
@@ -23,6 +23,7 @@
 #include "punct.h"
 #include <cstdlib>
 
+namespace ProcMacro {
 namespace Punct {
 
 Punct
@@ -32,3 +33,4 @@ Punct::make_punct (std::uint32_t ch, Spacing spacing)
 }
 
 } // namespace Punct
+} // namespace ProcMacro
index 0e5e42f674d9f577a2fe7ff8b427716feaebbd7f..b9098b1e279e7a902e61bed5ced36d56fa3d6ef2 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <cstdint>
 
+namespace ProcMacro {
 namespace Punct {
 
 enum Spacing
@@ -43,5 +44,6 @@ public:
 };
 
 } // namespace Punct
+} // namespace ProcMacro
 
 #endif /* ! PUNCT_H */
index 921cc22bf13960e70b95dbe000760d976a8e82cb..68e72666691532bb60ea7a224e435c304cb8e93b 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <cstring>
 
+namespace ProcMacro {
 namespace TokenStream {
 
 TokenStream
@@ -117,3 +118,4 @@ TokenStream__drop (TokenStream *stream)
 }
 
 } // namespace TokenStream
+} // namespace ProcMacro
index 909e6f441b2be11fd91497d51cbe881335b3b1e3..ac88f8047e3c1361bdefea261eefd6d43028fad5 100644 (file)
@@ -26,6 +26,7 @@
 #include <cstdint>
 #include <vector>
 
+namespace ProcMacro {
 namespace TokenTree {
 struct TokenTree;
 }
@@ -73,5 +74,6 @@ extern "C" void
 TokenStream__drop (TokenStream *stream);
 
 } // namespace TokenStream
+} // namespace ProcMacro
 
 #endif /* ! TOKENSTREAM_H */
index 924e50c6f3b85ee0358a7781fc8854d5d858ffbd..408828ba1f2e96de5dbaf584a816e91dac14e59c 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "tokentree.h"
 
+namespace ProcMacro {
 namespace TokenTree {
 
 TokenTree
@@ -76,3 +77,4 @@ TokenTree::drop (TokenTree *tt)
 }
 
 } // namespace TokenTree
+} // namespace ProcMacro
index 86fc5eb2688653be50674bc629c9c52c798ce42b..ada1557efd9e1e18737a2b5edf32aa3170840281 100644 (file)
@@ -28,6 +28,7 @@
 #include "punct.h"
 #include "literal.h"
 
+namespace ProcMacro {
 namespace TokenTree {
 
 enum TokenTreeTag
@@ -61,5 +62,6 @@ public:
 };
 
 } // namespace TokenTree
+} // namespace ProcMacro
 
 #endif /* ! TOKENTREE_H */