Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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