Skip to content

Commit edc93a7

Browse files
authored
Generate .di to stdout if name is "-" (dlang#22662)
1 parent 0f74e94 commit edc93a7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

compiler/src/dmd/main.d

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,11 @@ private int tryMain(const(char)[][] argv, out Param params)
582582

583583
buf.reset(); // reuse the buffer
584584
genhdrfile(m, params.dihdr.fullOutput, buf);
585-
if (!writeFile(m.loc, m.hdrfile.toString(), buf[]))
585+
if (params.dihdr.name == "-") {
586+
size_t n = fwrite(buf[].ptr, 1, buf.length, stdout);
587+
assert(n == buf.length);
588+
}
589+
else if (!writeFile(m.loc, m.hdrfile.toString(), buf[]))
586590
fatal();
587591
}
588592
}

0 commit comments

Comments
 (0)