Improve error messages on LLVM bitcode parsing failure
The LLVM error causing the parse failure is now printed, in the style of the other thin LTO error messages. This prevents a flood of assertion failure messages if the bitcode can’t be parsed.
This commit is contained in:
parent
50f6c3ece0
commit
a399326ca2
@ -613,7 +613,10 @@ impl ThinModule {
|
||||
self.data().len(),
|
||||
self.shared.module_names[self.idx].as_ptr(),
|
||||
);
|
||||
assert!(!llmod.is_null());
|
||||
if llmod.is_null() {
|
||||
let msg = format!("failed to parse bitcode for thin LTO module");
|
||||
return Err(write::llvm_err(&diag_handler, msg));
|
||||
}
|
||||
let mtrans = ModuleTranslation {
|
||||
source: ModuleSource::Translated(ModuleLlvm {
|
||||
llmod,
|
||||
|
Loading…
Reference in New Issue
Block a user