[Feature] Class and record definition XML dump extension
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
These patches extend the node dump feature (enabled with DEBUG_NODE_XML) so it also dumps class and record definitions to the XML file. They are contained within &LtPos;definition> tags.
Currently only fields and constants are dumped to the XML file. Methods, constant and variable definitions may be added later.
Steps to reproduce:
- Apply patches.
- Confirm compiler builds with no changes when DEBUG_NODE_XML is specified.
- Confirm compiler builds with extended XML dump information when DEBUG_NODE_XML is specified (WARNING: uses a lot of disk space).
Additional information:
- "node-dump-extension-refactor.patch" should not change the current node dump behaviour, but moves some functions so non-node classes can use them.
- "node-dump-extension-defs.patch" requires "node-dump-extension-refactor.patch" to work, and contains the changes required to allow record and class definitions to be dumped to the relevant XML file.
For example, the declaration:
type TVec = record
X, Y, Z: Single;
end;
Appears as the following in the XML dump:
<definition name="TVec" pos="29,9">
<type><record></type>
<size>12</size>
<alignment>4</alignment>
<field name="X" pos="30,5">
<type>Single</type>
<visibility>vis_public</visibility>
<offset>0</offset>
<size>4</size>
</field>
<field name="Y" pos="30,8">
<type>Single</type>
<visibility>vis_public</visibility>
<offset>4</offset>
<size>4</size>
</field>
<field name="Z" pos="30,11">
<type>Single</type>
<visibility>vis_public</visibility>
<offset>8</offset>
<size>4</size>
</field>
</definition>
(I might have the visibility field be omitted later on if it is vis_public)
The idea behind this extra information in the node dump files, even though they're not actually nodes, is to aid with compiler development where vectorisation is concerned by confirming, say, the offsets and sizes of fields are suitable for transferring en masse to an XMM register, and studying a selection of nodes in the same file that might be suitable for vectorisation.
Mantis conversion info:
- Mantis ID: 36882
- OS: Microsoft Windows
- OS Build: 10 Professional
- Build: r44513
- Platform: Cross-platform
- Version: 3.3.1
- Fixed in version: 3.3.1