forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CFG node uniqueness. (FuelLabs#3232)
The CFG now keeps track of previously processed declarations and makes sure to re-use the previously added graph node, instead of creating duplicate nodes for the same declarations. We do this by introducing a new IdentUnique type, which is pretty much the same as an Ident, but hashes with the full span, as opposed to an Ident which just uses the name as the hash, hence not fully ideal to use as the key for the CFG namespace, since it won't work correctly in multi-file cases. Closes FuelLabs#3093. <del> This does multiple fixes: - The declaration engine now tries to keep sure we do not create new declaration ids for previously added types. Right now this is only implemented for enums, but should be extended in the future for other declaration types. This is kinda like the monormophization cache we previously discussed, but working for non-generic types. - The CFG/DCA graph now also keeps track of previously processed declaration ids and makes sure to re-use the previously added graph node, instead of creating duplicate ones for the same declaration nodes. This also needs to be extended for other declaration types. Closes FuelLabs#3093. </del>
- Loading branch information
Showing
19 changed files
with
282 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.