ZIR: emit proper string literals

master
Andrew Kelley 2020-05-15 19:11:00 -04:00
parent 8980f150e9
commit 5135238f86
1 changed files with 16 additions and 1 deletions

View File

@ -1456,6 +1456,21 @@ const EmitZIR = struct {
.kw_args = .{},
};
try self.decls.append(self.allocator, &str_inst.base);
return &str_inst.base;
const ref_inst = try self.arena.allocator.create(Inst.Ref);
ref_inst.* = .{
.base = .{
.name = try self.autoName(),
.src = src,
.tag = Inst.Ref.base_tag,
},
.positionals = .{
.operand = &str_inst.base,
},
.kw_args = .{},
};
try self.decls.append(self.allocator, &ref_inst.base);
return &ref_inst.base;
}
};