compiler: update many references to bin_file.options

This commit is contained in:
Andrew Kelley
2023-12-13 18:28:00 -07:00
parent b162c3c820
commit 33cdf33b95
11 changed files with 318 additions and 230 deletions

View File

@@ -3084,7 +3084,7 @@ pub const Object = struct {
if (comp.unwind_tables) {
try attributes.addFnAttr(.{ .uwtable = Builder.Attribute.UwTable.default }, &o.builder);
}
if (comp.skip_linker_dependencies or comp.bin_file.options.no_builtin) {
if (comp.skip_linker_dependencies or comp.no_builtin) {
// The intent here is for compiler-rt and libc functions to not generate
// infinite recursion. For example, if we are compiling the memcpy function,
// and llvm detects that the body is equivalent to memcpy, it may replace the

View File

@@ -191,13 +191,9 @@ pub const Object = struct {
air: Air,
liveness: Liveness,
) !void {
const target = mod.getTarget();
// We always want a structured control flow in shaders. This option is only relevant
// for OpenCL kernels.
const want_structured_cfg = switch (target.os.tag) {
.opencl => mod.comp.bin_file.options.want_structured_cfg orelse false,
else => true,
};
const decl = mod.declPtr(decl_index);
const namespace = mod.namespacePtr(decl.src_namespace);
const structured_cfg = namespace.file_scope.mod.structured_cfg;
var decl_gen = DeclGen{
.gpa = self.gpa,
@@ -208,7 +204,7 @@ pub const Object = struct {
.air = air,
.liveness = liveness,
.type_map = &self.type_map,
.control_flow = switch (want_structured_cfg) {
.control_flow = switch (structured_cfg) {
true => .{ .structured = .{} },
false => .{ .unstructured = .{} },
},