diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-02-22 16:26:40 +0100 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-03-19 17:37:38 +0000 |
commit | 246b6316c0e1320cba90bae676675686890168a8 (patch) | |
tree | 159d337664f19fe4a50f5b64bac269cadcca5416 /gcc/rust/expand | |
parent | da10bf56cf11207877c3a552cffb472702d1b772 (diff) | |
download | gcc-246b6316c0e1320cba90bae676675686890168a8.zip gcc-246b6316c0e1320cba90bae676675686890168a8.tar.gz gcc-246b6316c0e1320cba90bae676675686890168a8.tar.bz2 |
format-args: Start storing string in Rust memory
gcc/rust/ChangeLog:
* ast/rust-fmt.cc (ffi::RustHamster::to_string): New.
(Pieces::collect): Adapt to use new handle API.
(Pieces::~Pieces): Likewise.
(Pieces::Pieces): Likewise.
(Pieces::operator=): Likewise.
* ast/rust-fmt.h (struct RustString): Add members.
(struct FormatArgsHandle): New.
(clone_pieces): Adapt for new FFI API.
(destroy_pieces): Likewise.
(struct Pieces): Store new FormatArgsHandle type.
* expand/rust-expand-format-args.cc (expand_format_args): Use proper
namespace.
* resolve/rust-ast-resolve-base.cc (ResolverBase::visit): FormatArgs
nodes are already resolved, so do nothing.
libgrust/ChangeLog:
* libformat_parser/src/lib.rs: Use new Handle struct and expose it.
Diffstat (limited to 'gcc/rust/expand')
-rw-r--r-- | gcc/rust/expand/rust-expand-format-args.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/expand/rust-expand-format-args.cc b/gcc/rust/expand/rust-expand-format-args.cc index 52249cb..276ffd5 100644 --- a/gcc/rust/expand/rust-expand-format-args.cc +++ b/gcc/rust/expand/rust-expand-format-args.cc @@ -28,10 +28,10 @@ expand_format_args (AST::FormatArgs &fmt) { switch (node.tag) { - case Fmt::Piece::Tag::String: + case Fmt::ffi::Piece::Tag::String: // rust_debug ("[ARTHUR]: %s", node.string._0.c_str ()); - case Fmt::Piece::Tag::NextArgument: + case Fmt::ffi::Piece::Tag::NextArgument: rust_debug ("[ARTHUR]: NextArgument"); break; } |