mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
stage2 llvm: do not use getIntrinsic for airFrameAddress
getIntrinsic gets the return type wrong so we have to add the function manually
This commit is contained in:
parent
a3cfb15fb4
commit
487ee79ec9
@ -1630,7 +1630,6 @@ fn getSymbolFromDwarf(address: u64, di: *DW.DwarfInfo) !SymbolInfo {
|
||||
.symbol_name = nosuspend di.getSymbolName(address) orelse "???",
|
||||
.compile_unit_name = compile_unit.die.getAttrString(di, DW.AT.name) catch |err| switch (err) {
|
||||
error.MissingDebugInfo, error.InvalidDebugInfo => "???",
|
||||
else => return err,
|
||||
},
|
||||
.line_info = nosuspend di.getLineNumberInfo(compile_unit.*, address) catch |err| switch (err) {
|
||||
error.MissingDebugInfo, error.InvalidDebugInfo => null,
|
||||
|
||||
@ -5347,7 +5347,14 @@ pub const FuncGen = struct {
|
||||
if (self.liveness.isUnused(inst)) return null;
|
||||
|
||||
const llvm_i32 = self.context.intType(32);
|
||||
const llvm_fn = self.getIntrinsic("llvm.frameaddress", &.{llvm_i32});
|
||||
const llvm_fn_name = "llvm.frameaddress.p0i8";
|
||||
const llvm_fn = self.dg.object.llvm_module.getNamedFunction(llvm_fn_name) orelse blk: {
|
||||
const llvm_p0i8 = self.context.intType(8).pointerType(0);
|
||||
const param_types = [_]*const llvm.Type{llvm_i32};
|
||||
const fn_type = llvm.functionType(llvm_p0i8, ¶m_types, param_types.len, .False);
|
||||
break :blk self.dg.object.llvm_module.addFunction(llvm_fn_name, fn_type);
|
||||
};
|
||||
|
||||
const params = [_]*const llvm.Value{llvm_i32.constNull()};
|
||||
const ptr_val = self.builder.buildCall(llvm_fn, ¶ms, params.len, .Fast, .Auto, "");
|
||||
const llvm_usize = try self.dg.llvmType(Type.usize);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user