about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/llvm_util.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-01-10 20:08:58 +0000
committerbors <bors@rust-lang.org>2020-01-10 20:08:58 +0000
commit175631311716d7dfeceec40d2587cde7142ffa8c (patch)
treec77e6f2bb4e682bb6239b5e6ab31d674057ee31a /src/librustc_codegen_llvm/llvm_util.rs
parentac6eb0db01a781d4f4940b34bd4c1cbe7e75263a (diff)
parentbcfb3806340939127d61f15ce101933bce6805f1 (diff)
downloadrust-175631311716d7dfeceec40d2587cde7142ffa8c.tar.gz
rust-175631311716d7dfeceec40d2587cde7142ffa8c.zip
Auto merge of #68101 - JohnTitor:rollup-mvmjukr, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #66045 (Add method Result::into_ok)
 - #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)
 - #68014 (Unify output of "variant not found" errors)
 - #68019 (Build compiletest with in-tree libtest)
 - #68039 (remove explicit strip-hidden pass from compiler doc generation)
 - #68050 (Canonicalize rustc_error imports)
 - #68059 (Allow specifying LLVM args in target specifications)
 - #68075 (rustbuild: Cleanup book generation)

Failed merges:

 - #68089 (Unstabilize `Vec::remove_item`)

r? @ghost
Diffstat (limited to 'src/librustc_codegen_llvm/llvm_util.rs')
-rw-r--r--src/librustc_codegen_llvm/llvm_util.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs
index b3c58b24020..52613fef7e6 100644
--- a/src/librustc_codegen_llvm/llvm_util.rs
+++ b/src/librustc_codegen_llvm/llvm_util.rs
@@ -46,7 +46,7 @@ fn require_inited() {
 }
 
 unsafe fn configure_llvm(sess: &Session) {
-    let n_args = sess.opts.cg.llvm_args.len();
+    let n_args = sess.opts.cg.llvm_args.len() + sess.target.target.options.llvm_args.len();
     let mut llvm_c_strs = Vec::with_capacity(n_args + 1);
     let mut llvm_args = Vec::with_capacity(n_args + 1);
 
@@ -56,14 +56,11 @@ unsafe fn configure_llvm(sess: &Session) {
         full_arg.trim().split(|c: char| c == '=' || c.is_whitespace()).next().unwrap_or("")
     }
 
-    let user_specified_args: FxHashSet<_> = sess
-        .opts
-        .cg
-        .llvm_args
-        .iter()
-        .map(|s| llvm_arg_to_arg_name(s))
-        .filter(|s| s.len() > 0)
-        .collect();
+    let cg_opts = sess.opts.cg.llvm_args.iter();
+    let tg_opts = sess.target.target.options.llvm_args.iter();
+
+    let user_specified_args: FxHashSet<_> =
+        cg_opts.chain(tg_opts).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