Skip to content

Commit

Permalink
Actually pass target LLVM args to LLVM
Browse files Browse the repository at this point in the history
  • Loading branch information
Jethro Beekman committed Jan 18, 2020
1 parent 689fca0 commit 766f6c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_codegen_llvm/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ unsafe fn configure_llvm(sess: &Session) {

let cg_opts = sess.opts.cg.llvm_args.iter();
let tg_opts = sess.target.target.options.llvm_args.iter();
let sess_args = cg_opts.chain(tg_opts);

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

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

for arg in &sess.opts.cg.llvm_args {
for arg in sess_args {
add(&(*arg), true);
}
}
Expand Down

0 comments on commit 766f6c5

Please sign in to comment.