trans: Upgrade LLVM
This brings some routine upgrades to the bundled LLVM that we're using, the most
notable of which is a bug fix to the way we handle range asserts when loading
the discriminant of an enum. This fix ended up being very similar to f9d4149c
where we basically can't have a range assert when loading a discriminant due to
filling drop, and appropriate flags were added to communicate this to
`trans::adt`.
This commit is contained in:
parent
142214d1f2
commit
d1cace17af
17 changed files with 123 additions and 43 deletions
|
@ -56,7 +56,7 @@ pub use self::DiagnosticSeverity::*;
|
|||
pub use self::Linkage::*;
|
||||
pub use self::DLLStorageClassTypes::*;
|
||||
|
||||
use std::ffi::CString;
|
||||
use std::ffi::{CString, CStr};
|
||||
use std::cell::RefCell;
|
||||
use std::slice;
|
||||
use libc::{c_uint, c_ushort, uint64_t, c_int, size_t, c_char};
|
||||
|
@ -2404,6 +2404,20 @@ pub fn initialize_available_targets() {
|
|||
init_pnacl();
|
||||
}
|
||||
|
||||
pub fn last_error() -> Option<String> {
|
||||
unsafe {
|
||||
let cstr = LLVMRustGetLastError();
|
||||
if cstr.is_null() {
|
||||
None
|
||||
} else {
|
||||
let err = CStr::from_ptr(cstr).to_bytes();
|
||||
let err = String::from_utf8_lossy(err).to_string();
|
||||
libc::free(cstr as *mut _);
|
||||
Some(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The module containing the native LLVM dependencies, generated by the build system
|
||||
// Note that this must come after the rustllvm extern declaration so that
|
||||
// parts of LLVM that rustllvm depends on aren't thrown away by the linker.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue