AstGen: implement inline asm output

This commit is contained in:
Andrew Kelley
2021-04-19 18:44:59 -07:00
parent a136c093bf
commit 4630e3891c
8 changed files with 126 additions and 49 deletions

View File

@@ -1036,11 +1036,11 @@ fn genAsm(o: *Object, as: *Inst.Assembly) !CValue {
}
const volatile_string: []const u8 = if (as.is_volatile) "volatile " else "";
try writer.print("__asm {s}(\"{s}\"", .{ volatile_string, as.asm_source });
if (as.output) |_| {
return o.dg.fail(.{ .node_offset = 0 }, "TODO inline asm output", .{});
if (as.output_constraint) |_| {
return o.dg.fail(.{ .node_offset = 0 }, "TODO: CBE inline asm output", .{});
}
if (as.inputs.len > 0) {
if (as.output == null) {
if (as.output_constraint == null) {
try writer.writeAll(" :");
}
try writer.writeAll(": ");