Internals: Fix tabs in astgen. No effective functional change.

This commit is contained in:
Wilson Snyder 2020-05-05 20:33:35 -04:00
parent 6ab3d8f3ed
commit 05aecd2c0b
1 changed files with 11 additions and 7 deletions

View File

@ -140,7 +140,11 @@ sub read_refs {
sub open_file { sub open_file {
my $filename = shift; my $filename = shift;
my $fh = IO::File->new($filename,"w") or die "%Error: $! $filename,"; my $fh = IO::File->new($filename,"w") or die "%Error: $! $filename,";
print $fh '// Generated by astgen // -*- mode: C++; c-file-style: "cc-mode" -*-'."\n"; if ($filename =~ /\.txt$/) {
print $fh '// Generated by astgen'."\n";
} else {
print $fh '// Generated by astgen // -*- mode: C++; c-file-style: "cc-mode" -*-'."\n";
}
return $fh; return $fh;
} }
@ -182,32 +186,32 @@ sub write_report {
$fh->print("Processing stages (approximate, based on order in Verilator.cpp):\n"); $fh->print("Processing stages (approximate, based on order in Verilator.cpp):\n");
foreach my $class (sort {$Stages{$a} <=> $Stages{$b}} keys %Stages) { foreach my $class (sort {$Stages{$a} <=> $Stages{$b}} keys %Stages) {
$fh->print("\t$class\n"); $fh->print(" $class\n");
} }
$fh->print("\nProcessing stages (approximate, based on order in Verilator.cpp):\n"); $fh->print("\nClasses:\n");
foreach my $type (sort (keys %Classes)) { foreach my $type (sort (keys %Classes)) {
printf $fh " class %-20s\n", "Ast${type}"; printf $fh " class %-20s\n", "Ast${type}";
$fh->print("\tparent:\t"); $fh->print(" parent: ");
foreach my $subclass (subclasses_of($type)) { foreach my $subclass (subclasses_of($type)) {
next if $subclass eq 'Node'; next if $subclass eq 'Node';
printf $fh "Ast%-12s ",$subclass; printf $fh "Ast%-12s ",$subclass;
} }
printf $fh "\n"; printf $fh "\n";
$fh->print("\tchilds:\t"); $fh->print(" childs: ");
foreach my $subclass (children_of($type)) { foreach my $subclass (children_of($type)) {
next if $subclass eq 'Node'; next if $subclass eq 'Node';
printf $fh "Ast%-12s ",$subclass; printf $fh "Ast%-12s ",$subclass;
} }
printf $fh "\n"; printf $fh "\n";
if (my $refs = $ClassRefs{"Ast${type}"}) { if (my $refs = $ClassRefs{"Ast${type}"}) {
$fh->print("\tnewed:\t"); $fh->print(" newed: ");
foreach my $stage (sort {($Stages{$a}||-1) <=> ($Stages{$b}||-1)} foreach my $stage (sort {($Stages{$a}||-1) <=> ($Stages{$b}||-1)}
keys %{$refs->{newed}}) { keys %{$refs->{newed}}) {
$fh->print($stage." "); $fh->print($stage." ");
} }
$fh->print("\n"); $fh->print("\n");
$fh->print("\tused:\t"); $fh->print(" used: ");
foreach my $stage (sort {($Stages{$a}||-1) <=> ($Stages{$b}||-1)} foreach my $stage (sort {($Stages{$a}||-1) <=> ($Stages{$b}||-1)}
keys %{$refs->{used}}) { keys %{$refs->{used}}) {
$fh->print($stage." "); $fh->print($stage." ");