diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-08-23 11:03:22 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2018-08-28 13:32:11 -0700 |
| commit | 1fd45a13dee17701fc0aeaa847c1919d485d09fd (patch) | |
| tree | 8ca2cb2677b213994b44f037798db56d0c867d15 /src/librustc_codegen_llvm/llvm | |
| parent | 7061b2775782bb48c0a70d3c79ec711134396687 (diff) | |
| download | rust-1fd45a13dee17701fc0aeaa847c1919d485d09fd.tar.gz rust-1fd45a13dee17701fc0aeaa847c1919d485d09fd.zip | |
Fix warnings about the `native` target-cpu
This fixes a regression from #53031 where specifying `-C target-cpu=native` is printing a lot of warnings from LLVM about `native` being an unknown CPU. It turns out that `native` is indeed an unknown CPU and we have to perform a mapping to an actual CPU name, but this mapping is only performed in one location rather than all locations we inform LLVM about the target CPU. This commit centralizes the mapping of `native` to LLVM's value of the native CPU, ensuring that all locations we inform LLVM about the `target-cpu` it's never `native`. Closes #53322
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index d3039a05b6d..51b0299e63f 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1449,6 +1449,7 @@ extern "C" { pub fn LLVMRustPrintTargetCPUs(T: &TargetMachine); pub fn LLVMRustPrintTargetFeatures(T: &TargetMachine); + pub fn LLVMRustGetHostCPUName(len: *mut usize) -> *const c_char; pub fn LLVMRustCreateTargetMachine(Triple: *const c_char, CPU: *const c_char, Features: *const c_char, |
