diff options
author | jjasmine <tanghocle456@gmail.com> | 2024-06-05 18:12:49 -0700 |
---|---|---|
committer | CohenArthur <arthur.cohen@embecosm.com> | 2024-06-13 15:31:07 +0000 |
commit | 4eb63c929f8bd77e0afa463bfc8f45986e12d288 (patch) | |
tree | 1f1e5063f03ac116f4f03adae7393933dc0e0c2c /gcc/rust/expand/rust-macro-builtins-asm.cc | |
parent | 4ec940e39cae459a7c26f9ee24a7145d277cc8bf (diff) | |
download | gcc-4eb63c929f8bd77e0afa463bfc8f45986e12d288.zip gcc-4eb63c929f8bd77e0afa463bfc8f45986e12d288.tar.gz gcc-4eb63c929f8bd77e0afa463bfc8f45986e12d288.tar.bz2 |
Fix visitor-related warnings
gcc/rust/ChangeLog:
* ast/rust-ast-collector.cc (TokenCollector::visit):
Fix visitor-related warnings
* ast/rust-ast-collector.h: Likewise.
* ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise.
* ast/rust-ast-visitor.h: Likewise.
* checks/errors/borrowck/rust-bir-builder-struct.h: Likewise.
* checks/errors/borrowck/rust-function-collector.h: Likewise.
* checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise.
* checks/errors/rust-const-checker.h: Likewise.
* expand/rust-derive.h: Likewise.
* expand/rust-macro-builtins-asm.cc (parse_reg_operand): Likewise.
* hir/rust-hir-dump.cc (Dump::visit): Likewise.
* hir/rust-hir-dump.h: Likewise.
* hir/tree/rust-hir-visitor.h: Likewise.
* resolve/rust-ast-resolve-base.cc (ResolverBase::visit): Likewise.
* resolve/rust-ast-resolve-base.h: Likewise.
Diffstat (limited to 'gcc/rust/expand/rust-macro-builtins-asm.cc')
-rw-r--r-- | gcc/rust/expand/rust-macro-builtins-asm.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc index 4e6193d..795c66a 100644 --- a/gcc/rust/expand/rust-macro-builtins-asm.cc +++ b/gcc/rust/expand/rust-macro-builtins-asm.cc @@ -263,8 +263,23 @@ parse_reg_operand (Parser<MacroInvocLexer> &parser, TokenId last_token_id, } else if (!is_global_asm && check_identifier (parser, "out")) { - rust_unreachable (); - return tl::nullopt; + rust_debug ("Enter parse_reg_operand out"); + + auto reg = parse_reg (parser, last_token_id, inline_asm_ctx); + + auto expr = parse_format_string (parser, last_token_id, inline_asm_ctx); + reg_operand.register_type = AST::InlineAsmOperand::RegisterType::Out; + + // Since reg is of type optional<T>, we need to check if it is not + // optional first. + // TODO: We don't throw any errors since we should have throw any + // encountered parsing error in parse_reg + if (reg) + { + reg_operand.in.reg = reg.value (); + } + + return reg_operand; } else if (!is_global_asm && check_identifier (parser, "lateout")) { |