gccrs: libproc_macro: Put all structures in a namespace

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>
This commit is contained in:
Pierre-Emmanuel Patry 2023-04-25 12:42:47 +02:00 committed by Arthur Cohen
parent 1ca5d5f84c
commit e112189800
12 changed files with 24 additions and 0 deletions

View file

@ -22,6 +22,7 @@
#include "group.h" #include "group.h"
namespace ProcMacro {
namespace Group { namespace Group {
Group Group
@ -37,3 +38,4 @@ Group::drop (Group *g)
} }
} // namespace Group } // namespace Group
} // namespace ProcMacro

View file

@ -25,6 +25,7 @@
#include "tokenstream.h" #include "tokenstream.h"
namespace ProcMacro {
namespace Group { namespace Group {
enum Delimiter enum Delimiter
@ -47,5 +48,6 @@ public:
}; };
} // namespace Group } // namespace Group
} // namespace ProcMacro
#endif /* ! GROUP_H */ #endif /* ! GROUP_H */

View file

@ -23,6 +23,7 @@
#include <cstring> #include <cstring>
namespace ProcMacro {
namespace Ident { namespace Ident {
extern "C" { extern "C" {
@ -84,3 +85,4 @@ Ident::drop (Ident *ident)
} }
} // namespace Ident } // namespace Ident
} // namespace ProcMacro

View file

@ -26,6 +26,7 @@
#include <cstdint> #include <cstdint>
#include <string> #include <string>
namespace ProcMacro {
namespace Ident { namespace Ident {
struct Ident struct Ident
@ -61,5 +62,6 @@ Ident__clone (const Ident *ident);
} }
} // namespace Ident } // namespace Ident
} // namespace ProcMacro
#endif /* ! IDENT_H */ #endif /* ! IDENT_H */

View file

@ -24,6 +24,7 @@
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
namespace ProcMacro {
namespace Literal { namespace Literal {
void void
@ -289,3 +290,4 @@ Literal::make_isize (std::int64_t value, bool suffixed)
} }
} // namespace Literal } // namespace Literal
} // namespace ProcMacro

View file

@ -27,6 +27,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
namespace ProcMacro {
namespace Literal { namespace Literal {
enum UnsignedTag enum UnsignedTag
{ {
@ -207,5 +208,6 @@ Literal__from_string (const unsigned char *str, std::uint64_t len,
Literal *lit); Literal *lit);
} }
} // namespace Literal } // namespace Literal
} // namespace ProcMacro
#endif /* ! LITERAL_H */ #endif /* ! LITERAL_H */

View file

@ -23,6 +23,7 @@
#include "punct.h" #include "punct.h"
#include <cstdlib> #include <cstdlib>
namespace ProcMacro {
namespace Punct { namespace Punct {
Punct Punct
@ -32,3 +33,4 @@ Punct::make_punct (std::uint32_t ch, Spacing spacing)
} }
} // namespace Punct } // namespace Punct
} // namespace ProcMacro

View file

@ -25,6 +25,7 @@
#include <cstdint> #include <cstdint>
namespace ProcMacro {
namespace Punct { namespace Punct {
enum Spacing enum Spacing
@ -43,5 +44,6 @@ public:
}; };
} // namespace Punct } // namespace Punct
} // namespace ProcMacro
#endif /* ! PUNCT_H */ #endif /* ! PUNCT_H */

View file

@ -25,6 +25,7 @@
#include <cstring> #include <cstring>
namespace ProcMacro {
namespace TokenStream { namespace TokenStream {
TokenStream TokenStream
@ -117,3 +118,4 @@ TokenStream__drop (TokenStream *stream)
} }
} // namespace TokenStream } // namespace TokenStream
} // namespace ProcMacro

View file

@ -26,6 +26,7 @@
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
namespace ProcMacro {
namespace TokenTree { namespace TokenTree {
struct TokenTree; struct TokenTree;
} }
@ -73,5 +74,6 @@ extern "C" void
TokenStream__drop (TokenStream *stream); TokenStream__drop (TokenStream *stream);
} // namespace TokenStream } // namespace TokenStream
} // namespace ProcMacro
#endif /* ! TOKENSTREAM_H */ #endif /* ! TOKENSTREAM_H */

View file

@ -22,6 +22,7 @@
#include "tokentree.h" #include "tokentree.h"
namespace ProcMacro {
namespace TokenTree { namespace TokenTree {
TokenTree TokenTree
@ -76,3 +77,4 @@ TokenTree::drop (TokenTree *tt)
} }
} // namespace TokenTree } // namespace TokenTree
} // namespace ProcMacro

View file

@ -28,6 +28,7 @@
#include "punct.h" #include "punct.h"
#include "literal.h" #include "literal.h"
namespace ProcMacro {
namespace TokenTree { namespace TokenTree {
enum TokenTreeTag enum TokenTreeTag
@ -61,5 +62,6 @@ public:
}; };
} // namespace TokenTree } // namespace TokenTree
} // namespace ProcMacro
#endif /* ! TOKENTREE_H */ #endif /* ! TOKENTREE_H */