diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2024-10-30 14:48:10 +1300 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2024-10-30 15:40:25 +1300 |
commit | 6cc0bec0e11d5fec757e90aebd7e51ed9393365c (patch) | |
tree | 9561c5a940db2389163ce62ba419c7821bc693a6 /src/locators.rs | |
parent | 2cd0c86659479774d092de727e0f0c31e27e49f2 (diff) | |
download | bedrock-asm-6cc0bec0e11d5fec757e90aebd7e51ed9393365c.zip |
Implement an intelligent source merging strategy
The previous source merging strategy was to concatenate source units
in the reverse order that they were added to the resolver, which
generally only worked when each source unit had at most one
macro-resolving parent.
An issue arose when some macros in a source unit were resolved by a
source unit which had been added earlier in the order, as the required
macro definitions would then be merged after they were referenced,
preventing the program from assembling.
The new source merging strategy finds an optimal merge order by first
recording for a given source unit the ID of each unit which resolves a
macro referenced by the given unit, and then only merging those source
units whose macro-defining dependencies have already been merged. In the
case that a cycle is detected, where two or more source units depend on
one another, a message is printed and the assembly is aborted.
Diffstat (limited to 'src/locators.rs')
0 files changed, 0 insertions, 0 deletions