Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Brown <morganb@microsoft.com>2017-08-12 07:12:39 +0300
committerMorgan Brown <morganb@microsoft.com>2017-09-15 03:24:46 +0300
commit6efbb8c6c85a9cd92622076a59db66279581937b (patch)
tree480bddc02709ffb3b0fc6f0fcdbbee7a78c94b25 /src/ILCompiler.Compiler
parent20cabc6ab8e1121dc13bb1b47573f19f77aba1bc (diff)
Enable multiple method compilation, calling void methods, loading floats and falling through basic blocks
Diffstat (limited to 'src/ILCompiler.Compiler')
-rw-r--r--src/ILCompiler.Compiler/src/Compiler/RawMainMethodRootProvider.cs31
-rw-r--r--src/ILCompiler.Compiler/src/ILCompiler.Compiler.csproj1
2 files changed, 32 insertions, 0 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/RawMainMethodRootProvider.cs b/src/ILCompiler.Compiler/src/Compiler/RawMainMethodRootProvider.cs
new file mode 100644
index 000000000..20c292b60
--- /dev/null
+++ b/src/ILCompiler.Compiler/src/Compiler/RawMainMethodRootProvider.cs
@@ -0,0 +1,31 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using Internal.TypeSystem;
+using Internal.TypeSystem.Ecma;
+
+namespace ILCompiler
+{
+ public class RawMainMethodRootProvider : ICompilationRootProvider
+ {
+ private EcmaModule _module;
+
+ public RawMainMethodRootProvider(EcmaModule module)
+ {
+ _module = module;
+ }
+
+ public void AddCompilationRoots(IRootingServiceProvider rootProvider)
+ {
+ MethodDesc mainMethod = _module.EntryPoint;
+ if (mainMethod == null)
+ throw new Exception("No managed entrypoint defined for executable module");
+
+ TypeDesc owningType = _module.GetGlobalModuleType();
+
+ rootProvider.AddCompilationRoot(mainMethod, "Managed Main Method");
+ }
+ }
+}
diff --git a/src/ILCompiler.Compiler/src/ILCompiler.Compiler.csproj b/src/ILCompiler.Compiler/src/ILCompiler.Compiler.csproj
index 8785265d2..8e396e45f 100644
--- a/src/ILCompiler.Compiler/src/ILCompiler.Compiler.csproj
+++ b/src/ILCompiler.Compiler/src/ILCompiler.Compiler.csproj
@@ -297,6 +297,7 @@
<Compile Include="Compiler\NodeMangler.cs" />
<Compile Include="Compiler\ObjectDumper.cs" />
<Compile Include="Compiler\PrecomputedMetadataManager.cs" />
+ <Compile Include="Compiler\RawMainMethodRootProvider.cs" />
<Compile Include="Compiler\ReadyToRun.cs" />
<Compile Include="Compiler\RyuJitCompilation.cs" />
<Compile Include="Compiler\RyuJitCompilationBuilder.cs" />