diff options
| author | bors <bors@rust-lang.org> | 2019-04-06 07:21:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-04-06 07:21:41 +0000 |
| commit | 2982dbf855fe12e30e75175d6b0fa74e7110e1cd (patch) | |
| tree | 0603e4ea19db6c86c060068e6b4302f8c85f12eb /src/librustc_codegen_llvm/llvm | |
| parent | b025802a2454a2335074feaf18f7afb516f0420c (diff) | |
| parent | aafe2c6da93373b5f612c406037c5b75ba9deb46 (diff) | |
| download | rust-2982dbf855fe12e30e75175d6b0fa74e7110e1cd.tar.gz rust-2982dbf855fe12e30e75175d6b0fa74e7110e1cd.zip | |
Auto merge of #59744 - cuviper:output-errors, r=sanxiyn
Show better errors for LLVM IR output
I was trying to output LLVM IR directly to the console:
$ rustc hello.rs --emit=llvm-ir -o /dev/stdout
LLVM ERROR: IO failure on output stream: Bad file descriptor
Now `LLVMRustPrintModule` returns an error, and we print:
error: failed to write LLVM IR to /dev/stdout.hello.7rcbfp3g-cgu.0.rcgu.ll: Permission denied
... which is more informative.
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index 2ad6d9c053a..a0aae4df7e7 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1687,7 +1687,8 @@ extern "C" { Demangle: extern fn(*const c_char, size_t, *mut c_char, - size_t) -> size_t); + size_t) -> size_t, + ) -> LLVMRustResult; pub fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char); pub fn LLVMRustPrintPasses(); pub fn LLVMRustSetNormalizedTarget(M: &Module, triple: *const c_char); |
