update std lib and compiler sources to new for loop syntax
This commit is contained in:
@@ -392,7 +392,7 @@ fn processTypeInstruction(self: *Assembler) !AsmValue {
|
||||
.OpTypeFunction => blk: {
|
||||
const param_operands = operands[2..];
|
||||
const param_types = try self.spv.arena.alloc(SpvType.Ref, param_operands.len);
|
||||
for (param_types) |*param, i| {
|
||||
for (param_types, 0..) |*param, i| {
|
||||
param.* = try self.resolveTypeRef(param_operands[i].ref_id);
|
||||
}
|
||||
const payload = try self.spv.arena.create(SpvType.Payload.Function);
|
||||
|
||||
@@ -161,7 +161,7 @@ pub fn flush(self: Module, file: std.fs.File) !void {
|
||||
|
||||
var iovc_buffers: [buffers.len]std.os.iovec_const = undefined;
|
||||
var file_size: u64 = 0;
|
||||
for (iovc_buffers) |*iovc, i| {
|
||||
for (&iovc_buffers, 0..) |*iovc, i| {
|
||||
// Note, since spir-v supports both little and big endian we can ignore byte order here and
|
||||
// just treat the words as a sequence of bytes.
|
||||
const bytes = std.mem.sliceAsBytes(buffers[i]);
|
||||
@@ -389,7 +389,7 @@ fn decorateStruct(self: *Module, target: IdRef, info: *const Type.Payload.Struct
|
||||
// Decorations for the struct members.
|
||||
const extra = info.member_decoration_extra;
|
||||
var extra_i: u32 = 0;
|
||||
for (info.members) |member, i| {
|
||||
for (info.members, 0..) |member, i| {
|
||||
const d = member.decorations;
|
||||
const index = @intCast(Word, i);
|
||||
switch (d.matrix_layout) {
|
||||
|
||||
@@ -195,7 +195,7 @@ fn writeContextDependentNumber(section: *Section, operand: spec.LiteralContextDe
|
||||
|
||||
fn writeExtendedMask(section: *Section, comptime Operand: type, operand: Operand) void {
|
||||
var mask: Word = 0;
|
||||
inline for (@typeInfo(Operand).Struct.fields) |field, bit| {
|
||||
inline for (@typeInfo(Operand).Struct.fields, 0..) |field, bit| {
|
||||
switch (@typeInfo(field.type)) {
|
||||
.Optional => if (@field(operand, field.name) != null) {
|
||||
mask |= 1 << @intCast(u5, bit);
|
||||
|
||||
@@ -98,7 +98,7 @@ pub const Type = extern union {
|
||||
const struct_b = b.payload(.@"struct");
|
||||
if (struct_a.members.len != struct_b.members.len)
|
||||
return false;
|
||||
for (struct_a.members) |mem_a, i| {
|
||||
for (struct_a.members, 0..) |mem_a, i| {
|
||||
if (!std.meta.eql(mem_a, struct_b.members[i]))
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user