Rollup merge of #83437 - Amanieu:asm_syntax, r=petrochenkov
Refactor #82270 as lint instead of an error This PR fixes several issues with #82270 which generated an error when `.intel_syntax` or `.att_syntax` was used in inline assembly: - It is now a warn-by-default lint instead of an error. - The lint only triggers on x86. `.intel_syntax` and `.att_syntax` are only valid on x86. - The lint no longer provides machine-applicable suggestions for two reasons: - These changes should not be made automatically since changes to assembly code can be very subtle. - The template string is not always just a string: it can contain macro invocation (`concat!`), raw strings, escape characters, etc. cc ``@asquared31415``
This commit is contained in:
commit
02b27cd79e
6 changed files with 179 additions and 118 deletions
|
@ -793,13 +793,6 @@ 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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue