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
This commit is contained in:
Dylan DPC 2021-03-18 00:28:06 +01:00 committed by GitHub
commit 16f6583f2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 181 additions and 1 deletions

View file

@ -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)
}