Merged
Conversation
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
This file contains hidden or 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
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. AModuleGroupcan be constructed from a single module or a set of modules. TheModuleGroupalso defines a name. From thenamea 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_worldinfoo.munis exported asfoo::hello_world. The same goes for structs.The
CodeGenDatabasecontains a new query:module_partition. This returns aModulePartitionwhich is a grouping of groupings. Currently, the implementation creates aModuleGroupfor every individual module. TheDriveruses this information to compile to correctModuleGroups. It also allows the code to query to whichModuleGroupa specifichir::Functionbelongs. This allows us to correctly determine references from oneModuleGroupto other groups. During symbol generation this information is stored in the assembly. A dependency is stored as the relative path of the referencedModuleGroupwithout an extension.What's currently missing from this PR is:
munlibthat refers to a function from another module will always result in a linker error like:Failed to link: functionfoo::fibonacciis missing.Lots of tests changed!?
Yes, this is due to two reasons:
ModuleGroup.