aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-macro.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-10-19 14:05:54 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2023-02-21 12:36:37 +0100
commit68e743090df65d936305620bacfa1e766011d027 (patch)
tree393963bc4ff61edccce35f726e41b13c1841d4d3 /gcc/rust/ast/rust-macro.h
parente2647e5e5ad109320339779474659a4f27135c78 (diff)
downloadgcc-68e743090df65d936305620bacfa1e766011d027.zip
gcc-68e743090df65d936305620bacfa1e766011d027.tar.gz
gcc-68e743090df65d936305620bacfa1e766011d027.tar.bz2
gccrs: rust: Replace uses of ASTFragment -> Fragment
gcc/rust/ChangeLog: * ast/rust-ast.h (class ASTFragment): Remove old ASTFragment class. * ast/rust-macro.h (class MacroRulesDefinition): Use new Fragment API. * expand/rust-attribute-visitor.h: Likewise. * expand/rust-macro-builtins.cc (macro_end_token): Likewise. (MacroBuiltin::assert): Likewise. (MacroBuiltin::file): Likewise. (MacroBuiltin::column): Likewise. (MacroBuiltin::include_bytes): Likewise. (MacroBuiltin::include_str): Likewise. (MacroBuiltin::compile_error): Likewise. (MacroBuiltin::concat): Likewise. (MacroBuiltin::env): Likewise. (MacroBuiltin::cfg): Likewise. (MacroBuiltin::include): Likewise. (MacroBuiltin::line): Likewise. * expand/rust-macro-builtins.h: Likewise. * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Likewise. (MacroExpander::expand_invoc): Likewise. (MacroExpander::match_repetition): Likewise. (parse_many): Likewise. (transcribe_many_items): Likewise. (transcribe_many_ext): Likewise. (transcribe_many_trait_items): Likewise. (transcribe_many_impl_items): Likewise. (transcribe_many_trait_impl_items): Likewise. (transcribe_expression): Likewise. (transcribe_type): Likewise. (transcribe_on_delimiter): Likewise. (tokens_to_str): Likewise. * expand/rust-macro-expand.h (struct MacroExpander): Likewise. * util/rust-hir-map.cc (Mappings::insert_macro_def): Likewise.
Diffstat (limited to 'gcc/rust/ast/rust-macro.h')
-rw-r--r--gcc/rust/ast/rust-macro.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index 798bc97..fc4b5b8 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -21,6 +21,7 @@
#include "rust-system.h"
#include "rust-ast.h"
+#include "rust-ast-fragment.h"
#include "rust-location.h"
namespace Rust {
@@ -456,8 +457,7 @@ class MacroRulesDefinition : public MacroItem
std::vector<MacroRule> rules; // inlined form
Location locus;
- std::function<ASTFragment (Location, MacroInvocData &)>
- associated_transcriber;
+ std::function<Fragment (Location, MacroInvocData &)> associated_transcriber;
// Since we can't compare std::functions, we need to use an extra boolean
bool is_builtin_rule;
@@ -468,10 +468,10 @@ class MacroRulesDefinition : public MacroItem
* should make use of the actual rules. If the macro is builtin, then another
* associated transcriber should be used
*/
- static ASTFragment dummy_builtin (Location, MacroInvocData &)
+ static Fragment dummy_builtin (Location, MacroInvocData &)
{
gcc_unreachable ();
- return ASTFragment::create_error ();
+ return Fragment::create_error ();
}
/* NOTE: in rustc, macro definitions are considered (and parsed as) a type
@@ -491,9 +491,9 @@ public:
associated_transcriber (dummy_builtin), is_builtin_rule (false)
{}
- MacroRulesDefinition (Identifier builtin_name, DelimType delim_type,
- std::function<ASTFragment (Location, MacroInvocData &)>
- associated_transcriber)
+ MacroRulesDefinition (
+ Identifier builtin_name, DelimType delim_type,
+ std::function<Fragment (Location, MacroInvocData &)> associated_transcriber)
: outer_attrs (std::vector<Attribute> ()), rule_name (builtin_name),
delim_type (delim_type), rules (std::vector<MacroRule> ()),
locus (Location ()), associated_transcriber (associated_transcriber),
@@ -521,14 +521,14 @@ public:
const std::vector<MacroRule> &get_rules () const { return rules; }
bool is_builtin () const { return is_builtin_rule; }
- const std::function<ASTFragment (Location, MacroInvocData &)> &
+ const std::function<Fragment (Location, MacroInvocData &)> &
get_builtin_transcriber () const
{
rust_assert (is_builtin ());
return associated_transcriber;
}
void set_builtin_transcriber (
- std::function<ASTFragment (Location, MacroInvocData &)> transcriber)
+ std::function<Fragment (Location, MacroInvocData &)> transcriber)
{
associated_transcriber = transcriber;
is_builtin_rule = true;