Merge pull request #140 from birth-software/remove-compiler-dead-code

Remove dead code
This commit is contained in:
David 2024-04-14 10:33:33 -06:00 committed by GitHub
commit a5f6a05755
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,11 +22,7 @@ pub fn link(context: *const Compilation.Context, options: linker.Options) !void
// const output_path = out_path orelse "a.out"; // const output_path = out_path orelse "a.out";
try argv.append(context.my_allocator, "-o"); try argv.append(context.my_allocator, "-o");
const is_dylib = library.ends_with_slice(options.output_file_path, ".dylib");
try argv.append(context.my_allocator, options.output_file_path); try argv.append(context.my_allocator, options.output_file_path);
if (library.byte_equal(options.output_file_path, "lib/LLVMHello.dylib")) {
assert(is_dylib);
}
try argv.append_slice(context.my_allocator, options.extra_arguments); try argv.append_slice(context.my_allocator, options.extra_arguments);
@ -43,6 +39,7 @@ pub fn link(context: *const Compilation.Context, options: linker.Options) !void
.aarch64 => "arm64", .aarch64 => "arm64",
else => |t| @panic(@tagName(t)), else => |t| @panic(@tagName(t)),
}); });
try argv.append_slice(context.my_allocator, &.{ "-syslibroot", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" }); try argv.append_slice(context.my_allocator, &.{ "-syslibroot", "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" });
if (!library.ends_with_slice(options.output_file_path, ".dylib")) { if (!library.ends_with_slice(options.output_file_path, ".dylib")) {