diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-03-18 00:28:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-18 00:28:06 +0100 |
| commit | 16f6583f2d95b53610ee10073752e883dbfa24ea (patch) | |
| tree | c1fef8dfd813219bdb24cf68103623a9b9a5e110 /compiler/rustc_session/src | |
| parent | 90797ef008a2004e70ff0106c756f24ea63ab236 (diff) | |
| parent | 4b13b8120e67e2b3173c8f6ce0d175847b745085 (diff) | |
| download | rust-16f6583f2d95b53610ee10073752e883dbfa24ea.tar.gz rust-16f6583f2d95b53610ee10073752e883dbfa24ea.zip | |
Rollup merge of #82270 - asquared31415:asm-syntax-directive-errors, r=nagisa
Emit error when trying to use assembler syntax directives in `asm!` The `.intel_syntax` and `.att_syntax` assembler directives should not be used, in favor of not specifying a syntax for intel, and in favor of the explicit `att_syntax` option using the inline assembly options. Closes #79869
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 4f611118360..fc57b6b8ace 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -793,6 +793,13 @@ impl Session { } } + pub fn inline_asm_dialect(&self) -> rustc_ast::LlvmAsmDialect { + match self.asm_arch { + Some(InlineAsmArch::X86 | InlineAsmArch::X86_64) => rustc_ast::LlvmAsmDialect::Intel, + _ => rustc_ast::LlvmAsmDialect::Att, + } + } + pub fn relocation_model(&self) -> RelocModel { self.opts.cg.relocation_model.unwrap_or(self.target.relocation_model) } |
