]> git.ipfire.org Git - thirdparty/gcc.git/commit
d: Use read() to load contents of stdin into memory.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 25 Aug 2020 09:23:24 +0000 (11:23 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sun, 30 Aug 2020 14:23:54 +0000 (16:23 +0200)
commit0989a6df97887a448612af2dbad568b8997fb304
treeabd285662627bce2ecf3470d75bfc59a013dd640
parent69ea3d97a04a1a892e3e846316e01c0b3c4e5467
d: Use read() to load contents of stdin into memory.

This would be an improvement over reading one character at a time.

An ICE was discovered when mixing reading from stdin with `-v', this has been
fixed in upstream DMD and backported as well.

Reviewed-on: https://github.com/dlang/dmd/pull/11620

gcc/d/ChangeLog:

* d-lang.cc (d_parse_file): Use read() to load contents from stdin,
allow the front-end to free the memory after parsing.
* dmd/func.c (FuncDeclaration::semantic): Use module filename if
searchPath returns NULL.

(cherry picked from commit 7421802276e737c2da297599121480833db92de9)
gcc/d/d-lang.cc
gcc/d/dmd/func.c