Browse Source

+ also print node tree after firstpass with -vp (patch by Adriaan van Os,
mantis #15710)

git-svn-id: trunk@14883 -

Jonas Maebe 15 years ago
parent
commit
e89d0bcee3
1 changed files with 8 additions and 3 deletions
  1. 8 3
      compiler/psub.pas

+ 8 - 3
compiler/psub.pas

@@ -49,7 +49,7 @@ interface
         dfabuilder : TDFABuilder;
         dfabuilder : TDFABuilder;
         constructor create(aparent:tprocinfo);override;
         constructor create(aparent:tprocinfo);override;
         destructor  destroy;override;
         destructor  destroy;override;
-        procedure printproc;
+        procedure printproc(pass:string);
         procedure generate_code;
         procedure generate_code;
         procedure resetprocdef;
         procedure resetprocdef;
         procedure add_to_symtablestack;
         procedure add_to_symtablestack;
@@ -534,7 +534,7 @@ implementation
        end;
        end;
 
 
 
 
-    procedure tcgprocinfo.printproc;
+    procedure tcgprocinfo.printproc(pass:string);
       begin
       begin
         assign(printnodefile,treelogfilename);
         assign(printnodefile,treelogfilename);
         {$I-}
         {$I-}
@@ -549,6 +549,7 @@ implementation
          end;
          end;
         writeln(printnodefile);
         writeln(printnodefile);
         writeln(printnodefile,'*******************************************************************************');
         writeln(printnodefile,'*******************************************************************************');
+        writeln(printnodefile, pass);
         writeln(printnodefile,procdef.fullprocname(false));
         writeln(printnodefile,procdef.fullprocname(false));
         writeln(printnodefile,'*******************************************************************************');
         writeln(printnodefile,'*******************************************************************************');
         printnode(printnodefile,code);
         printnode(printnodefile,code);
@@ -767,6 +768,10 @@ implementation
           include(flags,pi_uses_fpu);
           include(flags,pi_uses_fpu);
 {$endif i386}
 {$endif i386}
 
 
+        { Print the node to tree.log }
+        if paraprintnodetree=1 then
+          printproc( 'after the firstpass');
+
         { do this before adding the entry code else the tail recursion recognition won't work,
         { do this before adding the entry code else the tail recursion recognition won't work,
           if this causes troubles, it must be if'ed
           if this causes troubles, it must be if'ed
         }
         }
@@ -1399,7 +1404,7 @@ implementation
 
 
          { Print the node to tree.log }
          { Print the node to tree.log }
          if paraprintnodetree=1 then
          if paraprintnodetree=1 then
-           printproc;
+           printproc( 'after parsing');
 
 
          { ... remove symbol tables }
          { ... remove symbol tables }
          remove_from_symtablestack;
          remove_from_symtablestack;