diff options
Diffstat (limited to 'gcc/rust/expand/rust-macro-builtins-asm.h')
-rw-r--r-- | gcc/rust/expand/rust-macro-builtins-asm.h | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins-asm.h b/gcc/rust/expand/rust-macro-builtins-asm.h index 8081dae..3196a5a 100644 --- a/gcc/rust/expand/rust-macro-builtins-asm.h +++ b/gcc/rust/expand/rust-macro-builtins-asm.h @@ -142,16 +142,16 @@ tl::expected<InlineAsmContext, InlineAsmParseError> parse_reg_operand_unexpected (InlineAsmContext inline_asm_ctx); WARN_UNUSED_RESULT -tl::optional<AST::Fragment> -parse_asm (location_t invoc_locus, AST::MacroInvocData &invoc, - AST::InvocKind semicolon, AST::AsmKind is_global_asm); +tl::optional<AST::Fragment> parse_asm (location_t invoc_locus, + AST::MacroInvocData &invoc, + AST::InvocKind semicolon, + AST::AsmKind is_global_asm); WARN_UNUSED_RESULT -bool -check_identifier (Parser<MacroInvocLexer> &parser, std::string ident); +bool check_identifier (Parser<MacroInvocLexer> &parser, std::string ident); -void -check_and_set (InlineAsmContext &inline_asm_ctx, AST::InlineAsmOption option); +void check_and_set (InlineAsmContext &inline_asm_ctx, + AST::InlineAsm::Option option); // From rustc WARN_UNUSED_RESULT @@ -168,8 +168,36 @@ tl::optional<std::string> parse_format_string (InlineAsmContext &inline_asm_ctx); WARN_UNUSED_RESULT -tl::optional<std::string> -parse_label (Parser<MacroInvocLexer> &parser, TokenId last_token_id, - InlineAsmContext &inline_asm_ctx); +tl::optional<std::string> parse_label (Parser<MacroInvocLexer> &parser, + TokenId last_token_id, + InlineAsmContext &inline_asm_ctx); + +// LLVM ASM bits + +class LlvmAsmContext +{ +public: + AST::LlvmInlineAsm &llvm_asm; + Parser<MacroInvocLexer> &parser; + int last_token_id; + +public: + LlvmAsmContext (AST::LlvmInlineAsm &llvm_asm, Parser<MacroInvocLexer> &parser, + int last_token_id) + : llvm_asm (llvm_asm), parser (parser), last_token_id (last_token_id) + {} +}; + +void parse_llvm_outputs (LlvmAsmContext &ctx); + +void parse_llvm_inputs (LlvmAsmContext &ctx); + +void parse_llvm_clobbers (LlvmAsmContext &ctx); + +void parse_llvm_options (LlvmAsmContext &ctx); + +WARN_UNUSED_RESULT tl::optional<AST::Fragment> +parse_llvm_asm (location_t invoc_locus, AST::MacroInvocData &invoc, + AST::InvocKind semicolon, AST::AsmKind is_global_asm); } // namespace Rust |