diff options
author | badumbatish <tanghocle456@gmail.com> | 2024-10-16 22:41:47 -0700 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-03-19 15:32:17 +0100 |
commit | 064459884acb15eb41fe6d8e64602d407d86ccc9 (patch) | |
tree | 5d396c22129acaccb1a24b0912659ad042cbf66c | |
parent | 81397a9f53440ed6fb816480784fd9b14a3fca57 (diff) | |
download | gcc-064459884acb15eb41fe6d8e64602d407d86ccc9.zip gcc-064459884acb15eb41fe6d8e64602d407d86ccc9.tar.gz gcc-064459884acb15eb41fe6d8e64602d407d86ccc9.tar.bz2 |
gccrs: Fix compiler error on ast wrong implicit construct push_back
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_reg_operand_in): Fix
compiler error on ast wrong implicit construct push_back
-rw-r--r-- | gcc/rust/expand/rust-macro-builtins-asm.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.cc b/gcc/rust/expand/rust-macro-builtins-asm.cc index e970f28..5ed24d6 100644 --- a/gcc/rust/expand/rust-macro-builtins-asm.cc +++ b/gcc/rust/expand/rust-macro-builtins-asm.cc @@ -314,6 +314,7 @@ parse_reg_operand_in (InlineAsmContext inline_asm_ctx) // For the keyword IN, currently we count it as a seperate keyword called // Rust::IN search for #define RS_TOKEN_LIST in code base. auto &parser = inline_asm_ctx.parser; + location_t locus = parser.peek_current_token ()->get_locus (); if (!inline_asm_ctx.is_global_asm () && parser.skip_token (IN)) { auto reg = parse_reg (inline_asm_ctx); @@ -331,7 +332,7 @@ parse_reg_operand_in (InlineAsmContext inline_asm_ctx) // TODO: When we've succesfully parse an expr, remember to clone_expr() // instead of nullptr struct AST::InlineAsmOperand::In in (reg, std::move (expr)); - inline_asm_ctx.inline_asm.operands.push_back (in); + inline_asm_ctx.inline_asm.operands.emplace_back (in, locus); return inline_asm_ctx; } return tl::unexpected<InlineAsmParseError> (NONCOMMITED); |