Skip to content

Commit 6309557

Browse files
committed
macho: remove unused error signatures in dead_strip module
1 parent 7a42fef commit 6309557

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/MachO/dead_strip.zig

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const SymbolWithLoc = MachO.SymbolWithLoc;
1313

1414
const AtomTable = std.AutoHashMap(AtomIndex, void);
1515

16-
pub fn gcAtoms(macho_file: *MachO, reverse_lookups: [][]u32) !void {
16+
pub fn gcAtoms(macho_file: *MachO, reverse_lookups: [][]u32) Allocator.Error!void {
1717
const gpa = macho_file.base.allocator;
1818

1919
var arena = std.heap.ArenaAllocator.init(gpa);
@@ -26,8 +26,8 @@ pub fn gcAtoms(macho_file: *MachO, reverse_lookups: [][]u32) !void {
2626
try alive.ensureTotalCapacity(@intCast(u32, macho_file.atoms.items.len));
2727

2828
try collectRoots(macho_file, &roots);
29-
try mark(macho_file, roots, &alive, reverse_lookups);
30-
try prune(macho_file, alive);
29+
mark(macho_file, roots, &alive, reverse_lookups);
30+
prune(macho_file, alive);
3131
}
3232

3333
fn collectRoots(macho_file: *MachO, roots: *AtomTable) !void {
@@ -130,7 +130,7 @@ fn markLive(
130130
atom_index: AtomIndex,
131131
alive: *AtomTable,
132132
reverse_lookups: [][]u32,
133-
) anyerror!void {
133+
) void {
134134
if (alive.contains(atom_index)) return;
135135

136136
const atom = macho_file.getAtom(atom_index);
@@ -171,7 +171,7 @@ fn markLive(
171171
const other_atom = macho_file.getAtom(other_atom_index);
172172
const other_sym = macho_file.getSymbol(other_atom.getSymbolWithLoc());
173173
if (other_sym.n_sect == sect_id) {
174-
try markLive(macho_file, other_atom_index, alive, reverse_lookups);
174+
markLive(macho_file, other_atom_index, alive, reverse_lookups);
175175
}
176176
}
177177
continue;
@@ -194,11 +194,11 @@ fn markLive(
194194
macho_file.getAtom(target_atom_index).file,
195195
});
196196

197-
try markLive(macho_file, target_atom_index, alive, reverse_lookups);
197+
markLive(macho_file, target_atom_index, alive, reverse_lookups);
198198
}
199199
}
200200

201-
fn refersLive(macho_file: *MachO, atom_index: AtomIndex, alive: AtomTable, reverse_lookups: [][]u32) !bool {
201+
fn refersLive(macho_file: *MachO, atom_index: AtomIndex, alive: AtomTable, reverse_lookups: [][]u32) bool {
202202
const atom = macho_file.getAtom(atom_index);
203203
const sym_loc = atom.getSymbolWithLoc();
204204

@@ -242,10 +242,10 @@ fn refersLive(macho_file: *MachO, atom_index: AtomIndex, alive: AtomTable, rever
242242
return false;
243243
}
244244

245-
fn mark(macho_file: *MachO, roots: AtomTable, alive: *AtomTable, reverse_lookups: [][]u32) !void {
245+
fn mark(macho_file: *MachO, roots: AtomTable, alive: *AtomTable, reverse_lookups: [][]u32) void {
246246
var it = roots.keyIterator();
247247
while (it.next()) |root| {
248-
try markLive(macho_file, root.*, alive, reverse_lookups);
248+
markLive(macho_file, root.*, alive, reverse_lookups);
249249
}
250250

251251
var loop: bool = true;
@@ -267,8 +267,8 @@ fn mark(macho_file: *MachO, roots: AtomTable, alive: *AtomTable, reverse_lookups
267267
const source_sect = object.getSourceSection(sect_id);
268268

269269
if (source_sect.isDontDeadStripIfReferencesLive()) {
270-
if (try refersLive(macho_file, atom_index, alive.*, reverse_lookups)) {
271-
try markLive(macho_file, atom_index, alive, reverse_lookups);
270+
if (refersLive(macho_file, atom_index, alive.*, reverse_lookups)) {
271+
markLive(macho_file, atom_index, alive, reverse_lookups);
272272
loop = true;
273273
}
274274
}
@@ -277,7 +277,7 @@ fn mark(macho_file: *MachO, roots: AtomTable, alive: *AtomTable, reverse_lookups
277277
}
278278
}
279279

280-
fn prune(macho_file: *MachO, alive: AtomTable) !void {
280+
fn prune(macho_file: *MachO, alive: AtomTable) void {
281281
log.debug("pruning dead atoms", .{});
282282
for (macho_file.objects.items) |*object| {
283283
var i: usize = 0;

0 commit comments

Comments
 (0)