-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: runtime linking #300
Merged
Merged
Conversation
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
Codecov Report
@@ Coverage Diff @@
## master #300 +/- ##
==========================================
- Coverage 80.89% 80.89% -0.01%
==========================================
Files 242 244 +2
Lines 14689 14952 +263
==========================================
+ Hits 11883 12095 +212
- Misses 2806 2857 +51
Continue to review full report at Codecov.
|
ba52ebc
to
a381bde
Compare
bf0e2e2
to
d5950fe
Compare
d5950fe
to
dc4a4a6
Compare
41cac2e
to
63db093
Compare
beb0f2d
to
e461867
Compare
Wodann
requested changes
Mar 7, 2021
10ef2ff
to
57954ec
Compare
328392e
to
8d65f0c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the possibility to use multiple Mun files from a compiler and runtime perspective.
It adds the concept of a
ModuleGroup
. This is a struct that contains a grouping of modules that should be compiled together into an assembly. It provides some useful functions with respect to querying which functions should be included in the dispatch table or be exported from the assembly for external consumption or by another assembly. AModuleGroup
can be constructed from a single module or a set of modules. TheModuleGroup
also defines a name. From thename
a relative path is derived. Instead of iterating over the functions and structs of a single module, we iterate over the definitions from all modules.Furthermore, all type and function names that are exported now have their module path prepended to them. So a function
hello_world
infoo.mun
is exported asfoo::hello_world
. The same goes for structs.The
CodeGenDatabase
contains a new query:module_partition
. This returns aModulePartition
which is a grouping of groupings. Currently, the implementation creates aModuleGroup
for every individual module. TheDriver
uses this information to compile to correctModuleGroups
. It also allows the code to query to whichModuleGroup
a specifichir::Function
belongs. This allows us to correctly determine references from oneModuleGroup
to other groups. During symbol generation this information is stored in the assembly. A dependency is stored as the relative path of the referencedModuleGroup
without an extension.What's currently missing from this PR is:
munlib
that refers to a function from another module will always result in a linker error like:Failed to link: function
foo::fibonacciis missing.
Lots of tests changed!?
Yes, this is due to two reasons:
ModuleGroup
.