aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-expr.h
diff options
context:
space:
mode:
authorjjasmine <tanghocle456@gmail.com>2024-06-16 20:40:06 -0700
committerCohenArthur <arthur.cohen@embecosm.com>2024-06-28 09:59:34 +0000
commit76ba4a65809d2c8d1b8dac97585676c5ce22f447 (patch)
tree3026dc801cfbadd54b4394f417717695c7d5664d /gcc/rust/ast/rust-expr.h
parent74b6c7e4f95592423871b15a1457c816fb25e327 (diff)
downloadgcc-76ba4a65809d2c8d1b8dac97585676c5ce22f447.zip
gcc-76ba4a65809d2c8d1b8dac97585676c5ce22f447.tar.gz
gcc-76ba4a65809d2c8d1b8dac97585676c5ce22f447.tar.bz2
Added tl::expected to parse_operand
Added tl::expected to parse_operand by implementing the validation inside the parse_reg_operand function. gcc/rust/ChangeLog: * ast/rust-expr.h: Added tl::expected to parse_operand * expand/rust-macro-builtins-asm.cc (parse_reg): Likewise. (parse_reg_operand): Likewise. (parse_reg_operand_const): Likewise. (parse_reg_operand_inout): Likewise. (parse_asm_arg): Likewise. * expand/rust-macro-builtins-asm.h: Likewise. Signed-off-by: badumbatish <tanghocle456@gmail.com>
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r--gcc/rust/ast/rust-expr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h
index ba413da..9787e9a 100644
--- a/gcc/rust/ast/rust-expr.h
+++ b/gcc/rust/ast/rust-expr.h
@@ -5072,9 +5072,21 @@ private:
std::vector<Attribute> outer_attrs;
public:
+ // https://github.com/rust-lang/rust/blob/55cac26a9ef17da1c9c77c0816e88e178b7cc5dd/compiler/rustc_builtin_macros/src/asm.rs#L56C1-L64C7
+ // let mut args = AsmArgs {
+ // templates: vec![first_template],
+ // operands: vec![],
+ // named_args: Default::default(),
+ // reg_args: Default::default(),
+ // clobber_abis: Vec::new(),
+ // options: ast::InlineAsmOptions::empty(),
+ // options_spans: vec![],
+ // };
std::vector<InlineAsmTemplatePiece> template_;
std::vector<TupleTemplateStr> template_strs;
std::vector<InlineAsmOperand> operands;
+ std::map<std::string, int> named_args;
+ std::set<int> reg_args;
std::vector<TupleClobber> clobber_abi;
std::set<InlineAsmOption> options;