Skip to content

Commit b6f845f

Browse files
committed
Use SmallStr when building target-features LLVM attribute
1 parent 725c11e commit b6f845f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Set and unset common attributes on LLVM values.
22
33
use rustc_codegen_ssa::traits::*;
4+
use rustc_data_structures::small_str::SmallStr;
45
use rustc_hir::def_id::DefId;
56
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
67
use rustc_middle::ty::{self, TyCtxt};
@@ -382,7 +383,7 @@ pub fn from_fn_attrs<'ll, 'tcx>(
382383
let val = global_features
383384
.chain(function_features.iter().map(|s| &s[..]))
384385
.intersperse(",")
385-
.collect::<String>();
386+
.collect::<SmallStr<1024>>();
386387
to_add.push(llvm::CreateAttrStringValue(cx.llcx, "target-features", &val));
387388
}
388389

0 commit comments

Comments
 (0)