Use SmallStr when building target-features LLVM attribute
This commit is contained in:
parent
725c11ef3c
commit
b6f845f225
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
//! Set and unset common attributes on LLVM values.
|
//! Set and unset common attributes on LLVM values.
|
||||||
|
|
||||||
use rustc_codegen_ssa::traits::*;
|
use rustc_codegen_ssa::traits::*;
|
||||||
|
use rustc_data_structures::small_str::SmallStr;
|
||||||
use rustc_hir::def_id::DefId;
|
use rustc_hir::def_id::DefId;
|
||||||
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
|
||||||
use rustc_middle::ty::{self, TyCtxt};
|
use rustc_middle::ty::{self, TyCtxt};
|
||||||
|
@ -382,7 +383,7 @@ pub fn from_fn_attrs<'ll, 'tcx>(
|
||||||
let val = global_features
|
let val = global_features
|
||||||
.chain(function_features.iter().map(|s| &s[..]))
|
.chain(function_features.iter().map(|s| &s[..]))
|
||||||
.intersperse(",")
|
.intersperse(",")
|
||||||
.collect::<String>();
|
.collect::<SmallStr<1024>>();
|
||||||
to_add.push(llvm::CreateAttrStringValue(cx.llcx, "target-features", &val));
|
to_add.push(llvm::CreateAttrStringValue(cx.llcx, "target-features", &val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue