authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-23 20:45:15-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-27 15:09:11-07:00
log0f824caa4cc0e16a8529318a5bb7e84795367002
tree5894cf5c5e1f389ed870bdff3781491410e2d7f7
parente9a3ec7e1e0536dcc833acff3cb8745b6e8df848

llvm.Builder: revert adding !nosanitize API

It's not actually useful after all.

1 files changed, 1 insertions(+), 36 deletions(-)

src/codegen/llvm/Builder.zig+1-36
......@@ -3994,7 +3994,6 @@ pub const Function = struct {
39943994 names: [*]const String = &[0]String{},
39953995 value_indices: [*]const u32 = &[0]u32{},
39963996 strip: bool,
3997 any_nosanitize: bool,
39983997 debug_locations: std.AutoHashMapUnmanaged(Instruction.Index, DebugLocation) = .{},
39993998 debug_values: []const Instruction.Index = &.{},
40003999 extra: []const u32 = &.{},
......@@ -4091,7 +4090,6 @@ pub const Function = struct {
40914090 block,
40924091 br,
40934092 br_cond,
4094 br_cond_nosanitize,
40954093 call,
40964094 @"call fast",
40974095 cmpxchg,
......@@ -4347,13 +4345,6 @@ pub const Function = struct {
43474345 else => unreachable,
43484346 };
43494347 }
4350
4351 pub fn isNosanitize(self: Tag) bool {
4352 return switch (self) {
4353 .br_cond_nosanitize => true,
4354 else => false,
4355 };
4356 }
43574348 };
43584349
43594350 pub const Index = enum(u32) {
......@@ -4376,7 +4367,6 @@ pub const Function = struct {
43764367 return switch (wip.instructions.items(.tag)[@intFromEnum(self)]) {
43774368 .br,
43784369 .br_cond,
4379 .br_cond_nosanitize,
43804370 .ret,
43814371 .@"ret void",
43824372 .@"switch",
......@@ -4390,7 +4380,6 @@ pub const Function = struct {
43904380 return switch (wip.instructions.items(.tag)[@intFromEnum(self)]) {
43914381 .br,
43924382 .br_cond,
4393 .br_cond_nosanitize,
43944383 .fence,
43954384 .ret,
43964385 .@"ret void",
......@@ -4481,7 +4470,6 @@ pub const Function = struct {
44814470 .block => .label,
44824471 .br,
44834472 .br_cond,
4484 .br_cond_nosanitize,
44854473 .fence,
44864474 .ret,
44874475 .@"ret void",
......@@ -4668,7 +4656,6 @@ pub const Function = struct {
46684656 .block => .label,
46694657 .br,
46704658 .br_cond,
4671 .br_cond_nosanitize,
46724659 .fence,
46734660 .ret,
46744661 .@"ret void",
......@@ -5113,7 +5100,6 @@ pub const WipFunction = struct {
51135100 instructions: std.MultiArrayList(Instruction),
51145101 names: std.ArrayListUnmanaged(String),
51155102 strip: bool,
5116 any_nosanitize: bool,
51175103 debug_locations: std.AutoArrayHashMapUnmanaged(Instruction.Index, DebugLocation),
51185104 debug_values: std.AutoArrayHashMapUnmanaged(Instruction.Index, void),
51195105 extra: std.ArrayListUnmanaged(u32),
......@@ -5160,7 +5146,6 @@ pub const WipFunction = struct {
51605146 .instructions = .{},
51615147 .names = .{},
51625148 .strip = options.strip,
5163 .any_nosanitize = false,
51645149 .debug_locations = .{},
51655150 .debug_values = .{},
51665151 .extra = .{},
......@@ -6452,7 +6437,7 @@ pub const WipFunction = struct {
64526437 .@"ret void",
64536438 .@"unreachable",
64546439 => {},
6455 .br_cond, .br_cond_nosanitize => {
6440 .br_cond => {
64566441 const extra = self.extraData(Instruction.BrCond, instruction.data);
64576442 instruction.data = wip_extra.addExtra(Instruction.BrCond{
64586443 .cond = instructions.map(extra.cond),
......@@ -6639,7 +6624,6 @@ pub const WipFunction = struct {
66396624 function.names = names.ptr;
66406625 function.value_indices = value_indices.ptr;
66416626 function.strip = self.strip;
6642 function.any_nosanitize = self.any_nosanitize;
66436627 function.debug_locations = debug_locations;
66446628 function.debug_values = debug_values;
66456629 }
......@@ -8553,7 +8537,6 @@ pub fn init(options: Options) Allocator.Error!Builder {
85538537
85548538 try self.metadata_string_indices.append(self.gpa, 0);
85558539 assert(try self.metadataString("") == .none);
8556 assert(try self.debugTuple(&.{}) == .empty_tuple);
85578540
85588541 return self;
85598542}
......@@ -8951,7 +8934,6 @@ pub fn addFunctionAssumeCapacity(
89518934 .kind = .{ .function = function_index },
89528935 }),
89538936 .strip = undefined,
8954 .any_nosanitize = false,
89558937 });
89568938 return function_index;
89578939}
......@@ -9599,12 +9581,6 @@ pub fn printUnbuffered(
95999581 });
96009582 }
96019583 if (function.instructions.len > 0) {
9602 const maybe_empty_tuple: ?u32 = if (!function.any_nosanitize) null else b: {
9603 const gop = try metadata_formatter.map.getOrPut(self.gpa, .{
9604 .metadata = .empty_tuple,
9605 });
9606 break :b @intCast(gop.index);
9607 };
96089584 var block_incoming_len: u32 = undefined;
96099585 try writer.writeAll(" {\n");
96109586 var maybe_dbg_index: ?u32 = null;
......@@ -9794,14 +9770,6 @@ pub fn printUnbuffered(
97949770 }),
97959771 }
97969772 },
9797 .br_cond_nosanitize => {
9798 const extra = function.extraData(Function.Instruction.BrCond, instruction.data);
9799 try writer.print(" br {%}, {%}, {%}", .{
9800 extra.cond.fmt(function_index, self),
9801 extra.then.toInst(&function).fmt(function_index, self),
9802 extra.@"else".toInst(&function).fmt(function_index, self),
9803 });
9804 },
98059773 .call,
98069774 .@"call fast",
98079775 .@"musttail call",
......@@ -10080,9 +10048,6 @@ pub fn printUnbuffered(
1008010048 if (maybe_dbg_index) |dbg_index| {
1008110049 try writer.print(", !dbg !{}", .{dbg_index});
1008210050 }
10083 if (instruction.tag.isNosanitize()) {
10084 try writer.print(", !nosanitize !{d}", .{maybe_empty_tuple.?});
10085 }
1008610051 try writer.writeByte('\n');
1008710052 }
1008810053 try writer.writeByte('}');