You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
Interface between driver .exe and compiler .dll #52
Make it possible for CompilationModuleGroup to be instantiated outside of Compilation
Delete ICompilationRootProvider interface – change the pattern from "compilation group roots everything that should be a root" to "compilation group provides a list of roots for everyone who might be interested"
In the Compilation's Compile method, iterate over all the roots in the compilation group and root them
Move the CompilationGroup creation out to the Driver EXE, instantiate and pass the correct one to Compilation based on command line args (multi or single module)
Delete the MultiFile property on CompilationOptions
Remove IsCppCodegen parameter from the NodeFactory constructor
Instead of the Boolean flag, make NodeFactory accept a new interface with two methods: IMethodNode CreateMethodNode(MethodDesc method) and void CompileMethods(List<DependencyNodeCore<NodeFactory>> obj)
Have Compilation implement the new interface.
At this point we need to add two classes deriving from Compilation: RyuJitCompilation and CppCompilation. The split should be obvious.
Instantiate the correct Compilation class in the driver EXE.
Delete the IsCppCodegenCompilationOption.
This will also require a bit of work on NameMangler to make it stop depending on Compilation (it is a weird dependency and unnecessary one).
Simplify the NodeFactory construction
The TypeInitialization class instance passed to NodeFactory is awkward. I see two options: Merge TypeInitialization with CompilerTypeSystemContext (preferred), or hang a TypeInitialization instance as a property on CompilerTypeSystemContext
Either way, TypeInitialization is no longer created in Compilation
Expose a public CompilerTypeSystemContext property on the NodeFactory so that the nodes have access to it all the time. Remove the TypeInitialization constructor argument on NodeFactory and the property.
Move NodeFactory and CompilerTypeSystemContext creation out of Compilation into the driver EXE. Pass the instantiated versions to Compilation
Basically it feels like the success criteria for this is to get rid of CompilationOptions class in it's entirety and allow the driver to compose the LEGO bricks (classes) that constitute the compiler according to the command line arguments and run the Compile method.
Activity
MichalStrehovsky commentedon Jul 11, 2016
Rough execution plan:
Make it possible for
CompilationModuleGroupto be instantiated outside ofCompilationDelete
ICompilationRootProviderinterface – change the pattern from "compilation group roots everything that should be a root" to "compilation group provides a list of roots for everyone who might be interested"In the
Compilation'sCompilemethod, iterate over all the roots in the compilation group and root themMove the
CompilationGroupcreation out to the Driver EXE, instantiate and pass the correct one toCompilationbased on command line args (multi or single module)Delete the
MultiFileproperty onCompilationOptionsRemove
IsCppCodegenparameter from theNodeFactoryconstructorInstead of the Boolean flag, make
NodeFactoryaccept a new interface with two methods:IMethodNode CreateMethodNode(MethodDesc method)andvoid CompileMethods(List<DependencyNodeCore<NodeFactory>> obj)Have
Compilationimplement the new interface.At this point we need to add two classes deriving from
Compilation:RyuJitCompilationandCppCompilation. The split should be obvious.Instantiate the correct
Compilationclass in the driver EXE.Delete the
IsCppCodegenCompilationOption.This will also require a bit of work on
NameManglerto make it stop depending onCompilation(it is a weird dependency and unnecessary one).Simplify the NodeFactory construction
The
TypeInitializationclass instance passed to NodeFactory is awkward. I see two options: MergeTypeInitializationwithCompilerTypeSystemContext(preferred), or hang aTypeInitializationinstance as a property onCompilerTypeSystemContextEither way, TypeInitialization is no longer created in Compilation
Expose a public CompilerTypeSystemContext property on the NodeFactory so that the nodes have access to it all the time. Remove the
TypeInitializationconstructor argument onNodeFactoryand the property.Move NodeFactory and CompilerTypeSystemContext creation out of Compilation into the driver EXE. Pass the instantiated versions to
CompilationDelete a few more
CompilationOptionsMichalStrehovsky commentedon Jul 11, 2016
Basically it feels like the success criteria for this is to get rid of
CompilationOptionsclass in it's entirety and allow the driver to compose the LEGO bricks (classes) that constitute the compiler according to the command line arguments and run theCompilemethod.