astgen: Preserve #line, #2138.

This commit is contained in:
Wilson Snyder 2020-01-25 15:36:37 -05:00
parent ef5250f0ca
commit 52907e7b02

View File

@ -362,9 +362,12 @@ sub write_header {
my $type = "None"; my $type = "None";
my $base = "None"; my $base = "None";
my $ifile = "$Opt_I[0]/V3AstNodes.h"; my $in_filename = "V3AstNodes.h";
my $ifile = "$Opt_I[0]/$in_filename";
my $ifh = IO::File->new($ifile) or die "%Error: $! $ifile,"; my $ifh = IO::File->new($ifile) or die "%Error: $! $ifile,";
$fh->print("#line 1 \"../$in_filename\"\n");
while (defined (my $line = $ifh->getline())) { while (defined (my $line = $ifh->getline())) {
# Drop expanded macro definitions - but keep empty line so compiler # Drop expanded macro definitions - but keep empty line so compiler
# message locations are accurate # message locations are accurate