diff options
| author | xd009642 <danielmckenna93@gmail.com> | 2020-10-08 23:23:27 +0100 |
|---|---|---|
| committer | xd009642 <danielmckenna93@gmail.com> | 2020-10-08 23:32:20 +0100 |
| commit | a6e2b636e658ca7346ffb32bf11301d92b72a1de (patch) | |
| tree | 6542609d14fcfd59a5500e0fb3fa6b3a699c4760 /compiler/rustc_codegen_llvm/src | |
| parent | 4437b4b1509c3c15b41a05489c4bddd2fe30e33f (diff) | |
| download | rust-a6e2b636e658ca7346ffb32bf11301d92b72a1de.tar.gz rust-a6e2b636e658ca7346ffb32bf11301d92b72a1de.zip | |
Implement the instruction_set attribute
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/attributes.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs index a633ea5e5a9..f02c30c3ee3 100644 --- a/compiler/rustc_codegen_llvm/src/attributes.rs +++ b/compiler/rustc_codegen_llvm/src/attributes.rs @@ -18,7 +18,7 @@ use crate::attributes; use crate::llvm::AttributePlace::Function; use crate::llvm::{self, Attribute}; use crate::llvm_util; -pub use rustc_attr::{InlineAttr, OptimizeAttr}; +pub use rustc_attr::{InlineAttr, InstructionSetAttr, OptimizeAttr}; use crate::context::CodegenCx; use crate::value::Value; @@ -310,6 +310,10 @@ pub fn from_fn_attrs(cx: &CodegenCx<'ll, 'tcx>, llfn: &'ll Value, instance: ty:: let feature = &f.as_str(); format!("+{}", llvm_util::to_llvm_feature(cx.tcx.sess, feature)) })) + .chain(codegen_fn_attrs.instruction_set.iter().map(|x| match x { + InstructionSetAttr::ArmA32 => "-thumb-mode".to_string(), + InstructionSetAttr::ArmT32 => "+thumb-mode".to_string(), + })) .collect::<Vec<String>>() .join(","); |
