Skip to content

Commit

Permalink
Use SmallStr when building target-features LLVM attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Mar 4, 2022
1 parent 725c11e commit b6f845f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_codegen_llvm/src/attributes.rs
@@ -1,6 +1,7 @@
//! Set and unset common attributes on LLVM values.

use rustc_codegen_ssa::traits::*;
use rustc_data_structures::small_str::SmallStr;
use rustc_hir::def_id::DefId;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use rustc_middle::ty::{self, TyCtxt};
Expand Down Expand Up @@ -382,7 +383,7 @@ pub fn from_fn_attrs<'ll, 'tcx>(
let val = global_features
.chain(function_features.iter().map(|s| &s[..]))
.intersperse(",")
.collect::<String>();
.collect::<SmallStr<1024>>();
to_add.push(llvm::CreateAttrStringValue(cx.llcx, "target-features", &val));
}

Expand Down

0 comments on commit b6f845f

Please sign in to comment.