aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-builtin-ast-nodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-builtin-ast-nodes.h')
-rw-r--r--gcc/rust/ast/rust-builtin-ast-nodes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-builtin-ast-nodes.h b/gcc/rust/ast/rust-builtin-ast-nodes.h
index 2893e7b..c784ad6 100644
--- a/gcc/rust/ast/rust-builtin-ast-nodes.h
+++ b/gcc/rust/ast/rust-builtin-ast-nodes.h
@@ -134,6 +134,7 @@ public:
FormatArgumentKind get_kind () const { return kind; }
const Expr &get_expr () const { return *expr; }
+ Expr &get_expr () { return *expr; }
private:
FormatArgument (FormatArgumentKind::Kind kind, tl::optional<Identifier> ident,
@@ -164,6 +165,11 @@ public:
void push (FormatArgument &&elt) { args.emplace_back (std::move (elt)); }
const FormatArgument at (size_t idx) const { return args.at (idx); }
+ const std::vector<FormatArgument> &get_args () const { return args; }
+ std::vector<FormatArgument> &get_args () { return args; }
+ size_t size () const { return args.size (); }
+ bool empty () const { return args.empty (); }
+
private:
std::vector<FormatArgument> args;
};
@@ -200,6 +206,7 @@ public:
const Fmt::Pieces &get_template () const { return template_pieces; }
const FormatArguments &get_arguments () const { return arguments; }
+ FormatArguments &get_arguments () { return arguments; }
virtual location_t get_locus () const override;
Expr::Kind get_expr_kind () const override { return Expr::Kind::FormatArgs; }
@@ -255,6 +262,7 @@ public:
virtual location_t get_locus () const override { return loc; }
const Type &get_type () const { return *type; }
Type &get_type () { return *type; }
+ std::unique_ptr<Type> &get_type_ptr () { return type; }
const Identifier &get_field () const { return field; }
bool is_expr_without_block () const override { return false; }