diff options
author | Simon Nattress <simonn@microsoft.com> | 2015-12-03 08:08:22 +0300 |
---|---|---|
committer | Simon Nattress <simonn@microsoft.com> | 2015-12-03 22:37:29 +0300 |
commit | 14c72d88e2d09198a3a71740b78a81a4db41d166 (patch) | |
tree | 14636fe9c9ec452b4a8d3220dbb7e9137520aea3 /src/ILCompiler.Compiler | |
parent | eea6ebd0a7154ca0d04f222ed8a97a6815a2bbd8 (diff) |
Enable command line args for RyuJit bootstrapper
Create managed objects for String[] args and each string command line
argument and pass them in through the call to __managed__Main.
Add System.String[] as a rooted type (until we generate start-up code in
managed and don't need the lib export).
Diffstat (limited to 'src/ILCompiler.Compiler')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/Compilation.cs | 7 | ||||
-rw-r--r-- | src/ILCompiler.Compiler/src/CppCodeGen/CppWriter.cs | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/Compilation.cs b/src/ILCompiler.Compiler/src/Compiler/Compilation.cs index 5c13208c9..9e9ef0727 100644 --- a/src/ILCompiler.Compiler/src/Compiler/Compilation.cs +++ b/src/ILCompiler.Compiler/src/Compiler/Compilation.cs @@ -420,14 +420,21 @@ namespace ILCompiler { var stringType = TypeSystemContext.GetWellKnownType(WellKnownType.String); + // TODO: We are rooting String[] so the bootstrap code can find the EEType for making the command-line args + // string array. Once we generate the startup code in managed code, we should remove this + var arrayOfStringType = stringType.MakeArrayType(); + if (_dependencyGraph != null) { _dependencyGraph.AddRoot(_nodeFactory.ConstructedTypeSymbol(stringType), "String type is always generated"); + _dependencyGraph.AddRoot(_nodeFactory.ConstructedTypeSymbol(arrayOfStringType), "String[] type is always generated"); } else { AddType(stringType); MarkAsConstructed(stringType); + AddType(arrayOfStringType); + MarkAsConstructed(arrayOfStringType); } } diff --git a/src/ILCompiler.Compiler/src/CppCodeGen/CppWriter.cs b/src/ILCompiler.Compiler/src/CppCodeGen/CppWriter.cs index 366be379e..c90367efd 100644 --- a/src/ILCompiler.Compiler/src/CppCodeGen/CppWriter.cs +++ b/src/ILCompiler.Compiler/src/CppCodeGen/CppWriter.cs @@ -48,10 +48,6 @@ namespace ILCompiler.CppCodeGen // TODO: For now, ensure that all types/methods referenced by unmanaged helpers are present var stringType = _compilation.TypeSystemContext.GetWellKnownType(WellKnownType.String); AddInstanceFields(stringType); - - var stringArrayType = stringType.MakeArrayType(); - _compilation.AddType(stringArrayType); - _compilation.MarkAsConstructed(stringArrayType); } public string GetCppSignatureTypeName(TypeDesc type) |