diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2017-05-16 00:01:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 00:01:24 +0300 |
commit | 85d38d522ca2b96a823cbbb99c903e5638a412a3 (patch) | |
tree | a2687a9f497dc27499a83df1e21ee0972dd3917d /src/ILCompiler.CppCodeGen | |
parent | 3a91ef88ae57b344f632cc76e56166cccac92077 (diff) |
Add IL scanner phase (#3503)
This adds an initial implementation of an IL scanner that will scan method bodies, starting from the provided compilation roots, and expand the dependency graph based on scanning the IL, to determine the set of methods (and types, and other interesting artifacts) that will be compiled.
This nicely plugs into the existing architecture where the scanner looks almost just like another codegen backend - we have a separate NodeFactory for it, a separate builder class, and a separate compilation class. The actual IL parsing reuses the importer written for CppCodegen and ILVerifier.
The results of the scanning phase will flow into the metadata generator and potentially other parts of the system.
Diffstat (limited to 'src/ILCompiler.CppCodeGen')
-rw-r--r-- | src/ILCompiler.CppCodeGen/src/Compiler/CppCodegenCompilationBuilder.cs | 4 | ||||
-rw-r--r-- | src/ILCompiler.CppCodeGen/src/Compiler/DependencyAnalysis/CppCodegenNodeFactory.cs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ILCompiler.CppCodeGen/src/Compiler/CppCodegenCompilationBuilder.cs b/src/ILCompiler.CppCodeGen/src/Compiler/CppCodegenCompilationBuilder.cs index 4f9dde54a..0ad6851c0 100644 --- a/src/ILCompiler.CppCodeGen/src/Compiler/CppCodegenCompilationBuilder.cs +++ b/src/ILCompiler.CppCodeGen/src/Compiler/CppCodegenCompilationBuilder.cs @@ -17,7 +17,7 @@ namespace ILCompiler CppCodegenConfigProvider _config = new CppCodegenConfigProvider(Array.Empty<string>()); public CppCodegenCompilationBuilder(CompilerTypeSystemContext context, CompilationModuleGroup group) - : base(context, group) + : base(context, group, new CoreRTNameMangler(new CppNodeMangler(), true)) { } @@ -30,7 +30,7 @@ namespace ILCompiler public override ICompilation ToCompilation() { MetadataManager metadataManager = CreateMetadataManager(); - CppCodegenNodeFactory factory = new CppCodegenNodeFactory(_context, _compilationGroup, metadataManager); + CppCodegenNodeFactory factory = new CppCodegenNodeFactory(_context, _compilationGroup, metadataManager, _nameMangler); DependencyAnalyzerBase<NodeFactory> graph = CreateDependencyGraph(factory); return new CppCodegenCompilation(graph, factory, _compilationRoots, _logger, _config); diff --git a/src/ILCompiler.CppCodeGen/src/Compiler/DependencyAnalysis/CppCodegenNodeFactory.cs b/src/ILCompiler.CppCodeGen/src/Compiler/DependencyAnalysis/CppCodegenNodeFactory.cs index bb7ba16a1..aac834c7d 100644 --- a/src/ILCompiler.CppCodeGen/src/Compiler/DependencyAnalysis/CppCodegenNodeFactory.cs +++ b/src/ILCompiler.CppCodeGen/src/Compiler/DependencyAnalysis/CppCodegenNodeFactory.cs @@ -10,8 +10,8 @@ namespace ILCompiler.DependencyAnalysis { public sealed class CppCodegenNodeFactory : NodeFactory { - public CppCodegenNodeFactory(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, MetadataManager metadataManager) - : base(context, compilationModuleGroup, metadataManager, new CoreRTNameMangler(new CppNodeMangler(), true)) + public CppCodegenNodeFactory(CompilerTypeSystemContext context, CompilationModuleGroup compilationModuleGroup, MetadataManager metadataManager, NameMangler nameMangler) + : base(context, compilationModuleGroup, metadataManager, nameMangler) { } |