make tree.log more complete
Original Reporter info from Mantis: Adriaan van Os
-
Reporter name: Adriaan van Os
Original Reporter info from Mantis: Adriaan van Os
- Reporter name: Adriaan van Os
Description:
When compiling with verbose option -vp, a tree.log file is created with a parse tree. This is quite useful for compiler development.
The tree.log is created right after parsing. This means that
- location information is still invalid
- tree changes in the first pass of code generation are not reflected in the tree.
So, if we are interested in the missing information, we need a tree print after the first pass of code generation also. The attached patch does that. Below an example of the result.
Additional information:
OLD tree.log fragment
*******************************************************************************
r(objproc);
*******************************************************************************
(blockn, resultdef = "untyped", pos = (16,3), loc = LOC_INVALID, expectloc = LOC_INVALID
(statementn, resultdef = <nil>, pos = (18,3), loc = LOC_INVALID, expectloc = LOC_INVALID
(calln, resultdef = "untyped", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_INVALID
proc = <nil>
right =
(loadn, resultdef = "<procedure variable type of procedure(<Pointer>) of object;Register>", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_INVALID
nil
symbol = PP
)
left =
(callparan, resultdef = <nil>, pos = (18,3), loc = LOC_INVALID, expectloc = LOC_INVALID
(nothingn, resultdef = "untyped", pos = (18,3), loc = LOC_INVALID, expectloc = LOC_INVALID
)
)
)
)
)
NEW tree.log fragment
*******************************************************************************
after parsing
r(objproc);
*******************************************************************************
(blockn, resultdef = "untyped", pos = (16,3), loc = LOC_INVALID, expectloc = LOC_INVALID
(statementn, resultdef = <nil>, pos = (18,3), loc = LOC_INVALID, expectloc = LOC_INVALID
(calln, resultdef = "untyped", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_INVALID
proc = <nil>
right =
(loadn, resultdef = "<procedure variable type of procedure(<Pointer>) of object;Register>", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_INVALID
nil
symbol = PP
)
left =
(callparan, resultdef = <nil>, pos = (18,3), loc = LOC_INVALID, expectloc = LOC_INVALID
(nothingn, resultdef = "untyped", pos = (18,3), loc = LOC_INVALID, expectloc = LOC_INVALID
)
)
)
)
)
*******************************************************************************
after the firstpass
r(objproc);
*******************************************************************************
(blockn, resultdef = "untyped", pos = (16,3), loc = LOC_INVALID, expectloc = LOC_VOID
(statementn, resultdef = <nil>, pos = (18,3), loc = LOC_INVALID, expectloc = LOC_VOID
(calln, resultdef = "untyped", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_VOID
proc = <nil>
right =
(loadn, resultdef = "<procedure variable type of procedure(<Pointer>) of object;Register>", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_REF
nil
symbol = PP
)
left =
(callparan, resultdef = "^untyped", pos = (18,3), loc = LOC_INVALID, expectloc = LOC_REF
(subscriptn, resultdef = "^untyped", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_REF
(typeconvn, resultdef = "<record type>", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_REF, convtype = tc_equal
(loadn, resultdef = "<procedure variable type of procedure(<Pointer>) of object;Register>", pos = (17,5), loc = LOC_INVALID, expectloc = LOC_REF
nil
symbol = PP
)
)
)
)
)
)
)
Mantis conversion info:
- Mantis ID: 15710
- OS: Mac OS X
- OS Build: 10.5.2
- Build: svn r14867
- Platform: Mac OS
- Version: 2.5.1
- Fixed in version: 2.6.0
- Fixed in revision: 14883 (#e89d0bce)