-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When importing symbolic constants and types, also import the associat…
…ed generic and index. (#4180) A symbolic constant has an instruction to compute the constant value, as well as potentially also having a generic ID and an index within that generic to indicate where corresponding values can be found in a specific. Import those pieces of information when importing such a constant. We try to import the generic before we start the main work of importing the constant, and retry the import process if importing the generic adds work to the worklist. This means that the first time we import anything within a generic, we can now perform three passes calling `TryResolveInst` instead of two, but the first pass is very lightweight and only looks up and adds a single instruction, so the added overhead of the extra pass should be minimal. To avoid introducing cycles when importing a generic function, make the import of a function declaration build the new `Function`, `FunctionDecl`, and `FunctionType` in the first pass, like classes and interfaces do.
- Loading branch information
Showing
25 changed files
with
242 additions
and
254 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
Oops, something went wrong.