Merge pull request #19152 from antlilja/llvm-broken-debug
LLVM: Fail to emit if LLVM encounters broken debug info
This commit is contained in:
@@ -1245,9 +1245,11 @@ pub const Object = struct {
|
||||
);
|
||||
defer bitcode_memory_buffer.dispose();
|
||||
|
||||
context.enableBrokenDebugInfoCheck();
|
||||
|
||||
var module: *llvm.Module = undefined;
|
||||
if (context.parseBitcodeInContext2(bitcode_memory_buffer, &module).toBool()) {
|
||||
std.debug.print("Failed to parse bitcode\n", .{});
|
||||
if (context.parseBitcodeInContext2(bitcode_memory_buffer, &module).toBool() or context.getBrokenDebugInfo()) {
|
||||
log.err("Failed to parse bitcode", .{});
|
||||
return error.FailedToEmit;
|
||||
}
|
||||
break :emit .{ context, module };
|
||||
|
||||
@@ -37,6 +37,12 @@ pub const Context = opaque {
|
||||
|
||||
pub const setOptBisectLimit = ZigLLVMSetOptBisectLimit;
|
||||
extern fn ZigLLVMSetOptBisectLimit(C: *Context, limit: c_int) void;
|
||||
|
||||
pub const enableBrokenDebugInfoCheck = ZigLLVMEnableBrokenDebugInfoCheck;
|
||||
extern fn ZigLLVMEnableBrokenDebugInfoCheck(C: *Context) void;
|
||||
|
||||
pub const getBrokenDebugInfo = ZigLLVMGetBrokenDebugInfo;
|
||||
extern fn ZigLLVMGetBrokenDebugInfo(C: *Context) bool;
|
||||
};
|
||||
|
||||
pub const Module = opaque {
|
||||
|
||||
Reference in New Issue
Block a user