From 52907e7b0216c42e976724214cd90c63d46f8e51 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 25 Jan 2020 15:36:37 -0500 Subject: [PATCH] astgen: Preserve #line, #2138. --- src/astgen | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/astgen b/src/astgen index d1144f77a..ed42a54bf 100644 --- a/src/astgen +++ b/src/astgen @@ -362,9 +362,12 @@ sub write_header { my $type = "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,"; + $fh->print("#line 1 \"../$in_filename\"\n"); + while (defined (my $line = $ifh->getline())) { # Drop expanded macro definitions - but keep empty line so compiler # message locations are accurate