diff options
| author | Robin Voetter <robin@voetter.nl> | 2023-05-30 18:41:31 +0200 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2023-05-30 19:43:37 +0200 |
| commit | 3c4cc1eedb959aa804ca752e20268ccecc14ccef (patch) | |
| tree | 6da038c4f48f98c6ff63630d53a1ecc75a6972e1 /src/codegen/spirv/Module.zig | |
| parent | 0c41945a01a3a5254e8b4266a0677f2d8224aa1a (diff) | |
| download | zig-3c4cc1eedb959aa804ca752e20268ccecc14ccef.tar.gz zig-3c4cc1eedb959aa804ca752e20268ccecc14ccef.zip | |
spirv: eliminate remaining uses of emitConstant
Diffstat (limited to 'src/codegen/spirv/Module.zig')
| -rw-r--r-- | src/codegen/spirv/Module.zig | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig index a9a2571ff0..1d4840aeb7 100644 --- a/src/codegen/spirv/Module.zig +++ b/src/codegen/spirv/Module.zig @@ -127,7 +127,7 @@ sections: struct { // OpModuleProcessed - skip for now. /// Annotation instructions (OpDecorate etc). annotations: Section = .{}, - /// Global variable declarations + /// Type declarations, constants, global variables /// From this section, OpLine and OpNoLine is allowed. /// According to the SPIR-V documentation, this section normally /// also holds type and constant instructions. These are managed @@ -135,10 +135,6 @@ sections: struct { /// manages that section. These will be inserted between this and /// the previous section when emitting the final binary. /// TODO: Do we need this section? Globals are also managed with another mechanism. - /// The only thing that needs to be kept here is OpUndef - globals: Section = .{}, - /// Type declarations, constants, global variables - /// Below this section, OpLine and OpNoLine is allowed. types_globals_constants: Section = .{}, // Functions without a body - skip for now. /// Regular function definitions. @@ -192,7 +188,6 @@ pub fn deinit(self: *Module) void { self.sections.debug_strings.deinit(self.gpa); self.sections.debug_names.deinit(self.gpa); self.sections.annotations.deinit(self.gpa); - self.sections.globals.deinit(self.gpa); self.sections.functions.deinit(self.gpa); self.source_file_names.deinit(self.gpa); @@ -365,7 +360,6 @@ pub fn flush(self: *Module, file: std.fs.File) !void { self.sections.annotations.toWords(), types_constants.toWords(), self.sections.types_globals_constants.toWords(), - self.sections.globals.toWords(), globals.toWords(), self.sections.functions.toWords(), }; @@ -484,19 +478,6 @@ pub fn constComposite(self: *Module, ty_ref: CacheRef, members: []const IdRef) ! return result_id; } -pub fn emitConstant( - self: *Module, - ty_id: IdRef, - result_id: IdRef, - value: spec.LiteralContextDependentNumber, -) !void { - try self.sections.types_globals_constants.emit(self.gpa, .OpConstant, .{ - .id_result_type = ty_id, - .id_result = result_id, - .value = value, - }); -} - /// Decorate a result-id. pub fn decorate( self: *Module, |
