Skip to content

Commit 3fa8cc3

Browse files
authored
Rollup merge of #68328 - jethrogb:jb/target-llvm-args, r=alexcrichton
Actually pass target LLVM args to LLVM Missed in #68059 r? @alexcrichton
2 parents dabd816 + 766f6c5 commit 3fa8cc3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/librustc_codegen_llvm/llvm_util.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ unsafe fn configure_llvm(sess: &Session) {
5858

5959
let cg_opts = sess.opts.cg.llvm_args.iter();
6060
let tg_opts = sess.target.target.options.llvm_args.iter();
61+
let sess_args = cg_opts.chain(tg_opts);
6162

6263
let user_specified_args: FxHashSet<_> =
63-
cg_opts.chain(tg_opts).map(|s| llvm_arg_to_arg_name(s)).filter(|s| s.len() > 0).collect();
64+
sess_args.clone().map(|s| llvm_arg_to_arg_name(s)).filter(|s| s.len() > 0).collect();
6465

6566
{
6667
// This adds the given argument to LLVM. Unless `force` is true
@@ -107,7 +108,7 @@ unsafe fn configure_llvm(sess: &Session) {
107108
// during inlining. Unfortunately these may block other optimizations.
108109
add("-preserve-alignment-assumptions-during-inlining=false", false);
109110

110-
for arg in &sess.opts.cg.llvm_args {
111+
for arg in sess_args {
111112
add(&(*arg), true);
112113
}
113114
}

0 commit comments

Comments
 (0)