-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #124161 - matthiaskrgr:rollup-9y6cm1q, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #123571 (Correctly change type when adding adjustments on top of `NeverToAny`) - #123729 (run-make: refactor out command wrappers for `clang` and `llvm-readobj`) - #124149 (rustdoc-search: fix description on aliases in results) - #124155 (bootstrap: don't use rayon for sysinfo) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
14 changed files
with
259 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
use std::env; | ||
use std::path::Path; | ||
use std::process::Command; | ||
|
||
use crate::{bin_name, handle_failed_output, tmp_dir}; | ||
|
||
/// Construct a new `clang` invocation. `clang` is not always available for all targets. | ||
pub fn clang() -> Clang { | ||
Clang::new() | ||
} | ||
|
||
/// A `clang` invocation builder. | ||
#[derive(Debug)] | ||
pub struct Clang { | ||
cmd: Command, | ||
} | ||
|
||
crate::impl_common_helpers!(Clang); | ||
|
||
impl Clang { | ||
/// Construct a new `clang` invocation. `clang` is not always available for all targets. | ||
pub fn new() -> Self { | ||
let clang = | ||
env::var("CLANG").expect("`CLANG` not specified, but this is required to find `clang`"); | ||
let cmd = Command::new(clang); | ||
Self { cmd } | ||
} | ||
|
||
/// Provide an input file. | ||
pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self { | ||
self.cmd.arg(path.as_ref()); | ||
self | ||
} | ||
|
||
/// Specify the name of the executable. The executable will be placed under `$TMPDIR`, and the | ||
/// extension will be determined by [`bin_name`]. | ||
pub fn out_exe(&mut self, name: &str) -> &mut Self { | ||
self.cmd.arg("-o"); | ||
self.cmd.arg(tmp_dir().join(bin_name(name))); | ||
self | ||
} | ||
|
||
/// Specify which target triple clang should target. | ||
pub fn target(&mut self, target_triple: &str) -> &mut Self { | ||
self.cmd.arg("-target"); | ||
self.cmd.arg(target_triple); | ||
self | ||
} | ||
|
||
/// Pass `-nostdlib` to disable linking the C standard library. | ||
pub fn no_stdlib(&mut self) -> &mut Self { | ||
self.cmd.arg("-nostdlib"); | ||
self | ||
} | ||
|
||
/// Specify architecture. | ||
pub fn arch(&mut self, arch: &str) -> &mut Self { | ||
self.cmd.arg(format!("-march={arch}")); | ||
self | ||
} | ||
|
||
/// Specify LTO settings. | ||
pub fn lto(&mut self, lto: &str) -> &mut Self { | ||
self.cmd.arg(format!("-flto={lto}")); | ||
self | ||
} | ||
|
||
/// Specify which ld to use. | ||
pub fn use_ld(&mut self, ld: &str) -> &mut Self { | ||
self.cmd.arg(format!("-fuse-ld={ld}")); | ||
self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use std::env; | ||
use std::path::{Path, PathBuf}; | ||
use std::process::Command; | ||
|
||
use crate::handle_failed_output; | ||
|
||
/// Construct a new `llvm-readobj` invocation. This assumes that `llvm-readobj` is available | ||
/// at `$LLVM_BIN_DIR/llvm-readobj`. | ||
pub fn llvm_readobj() -> LlvmReadobj { | ||
LlvmReadobj::new() | ||
} | ||
|
||
/// A `llvm-readobj` invocation builder. | ||
#[derive(Debug)] | ||
pub struct LlvmReadobj { | ||
cmd: Command, | ||
} | ||
|
||
crate::impl_common_helpers!(LlvmReadobj); | ||
|
||
impl LlvmReadobj { | ||
/// Construct a new `llvm-readobj` invocation. This assumes that `llvm-readobj` is available | ||
/// at `$LLVM_BIN_DIR/llvm-readobj`. | ||
pub fn new() -> Self { | ||
let llvm_bin_dir = env::var("LLVM_BIN_DIR") | ||
.expect("`LLVM_BIN_DIR` not specified, but this is required to find `llvm-readobj`"); | ||
let llvm_bin_dir = PathBuf::from(llvm_bin_dir); | ||
let llvm_readobj = llvm_bin_dir.join("llvm-readobj"); | ||
let cmd = Command::new(llvm_readobj); | ||
Self { cmd } | ||
} | ||
|
||
/// Provide an input file. | ||
pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self { | ||
self.cmd.arg(path.as_ref()); | ||
self | ||
} | ||
|
||
/// Pass `--file-header` to display file headers. | ||
pub fn file_header(&mut self) -> &mut Self { | ||
self.cmd.arg("--file-header"); | ||
self | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// MIR for `_f` after built | ||
|
||
fn _f(_1: !, _2: !) -> () { | ||
debug a => _1; | ||
debug b => _2; | ||
let mut _0: (); | ||
let mut _3: !; | ||
let _4: bool; | ||
let mut _5: &(); | ||
let mut _6: !; | ||
let mut _7: &(); | ||
let _8: (); | ||
let mut _9: !; | ||
|
||
bb0: { | ||
StorageLive(_4); | ||
StorageLive(_5); | ||
StorageLive(_6); | ||
_6 = _1; | ||
unreachable; | ||
} | ||
|
||
bb1: { | ||
StorageDead(_6); | ||
StorageLive(_7); | ||
StorageLive(_8); | ||
StorageLive(_9); | ||
_9 = _2; | ||
unreachable; | ||
} | ||
|
||
bb2: { | ||
_7 = &_8; | ||
StorageDead(_9); | ||
_4 = <() as PartialEq>::eq(move _5, move _7) -> [return: bb3, unwind: bb5]; | ||
} | ||
|
||
bb3: { | ||
StorageDead(_7); | ||
StorageDead(_5); | ||
StorageDead(_8); | ||
StorageDead(_4); | ||
unreachable; | ||
} | ||
|
||
bb4: { | ||
return; | ||
} | ||
|
||
bb5 (cleanup): { | ||
resume; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// skip-filecheck | ||
#![feature(never_type)] | ||
#![allow(unreachable_code)] | ||
|
||
// EMIT_MIR eq_never_type._f.built.after.mir | ||
fn _f(a: !, b: !) { | ||
// Both arguments must be references (i.e. == should auto-borrow/coerce-to-ref both arguments) | ||
// (this previously was buggy due to `NeverToAny` coercion incorrectly throwing out other | ||
// coercions) | ||
a == b; | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.