예제 #1
0
        void SingleFileCompilation()
        {
            List <MethodDesc> rootMethods      = new List <MethodDesc>();
            MethodDesc        entryPointMethod = null;

            EcmaModule entryPointModule = GetEntryPointModule();

            if (entryPointModule != null)
            {
                int entryPointToken = entryPointModule.PEReader.PEHeaders.CorHeader.EntryPointTokenOrRelativeVirtualAddress;
                entryPointMethod = entryPointModule.GetMethod(MetadataTokens.EntityHandle(entryPointToken));
            }

            Compilation compilation = new Compilation(_compilerTypeSystemContext, _options);

            compilation.Log        = Console.Out;
            compilation.OutputPath = _outputPath;
            if (_options.IsCppCodeGen)
            {
                // Don't set Out when using object writer which is handled by LLVM.
                compilation.Out = new StreamWriter(File.Create(_outputPath));
            }

            compilation.CompileSingleFile(entryPointMethod);
        }
예제 #2
0
        private void SingleFileCompilation()
        {
            Compilation compilation = new Compilation(_options);

            compilation.Log = _options.Verbose ? Console.Out : TextWriter.Null;

            compilation.CompileSingleFile();
        }
예제 #3
0
        private void SingleFileCompilation()
        {
            List<MethodDesc> rootMethods = new List<MethodDesc>();
            MethodDesc entryPointMethod = null;

            EcmaModule entryPointModule = GetEntryPointModule();
            if (entryPointModule != null)
            {
                int entryPointToken = entryPointModule.PEReader.PEHeaders.CorHeader.EntryPointTokenOrRelativeVirtualAddress;
                entryPointMethod = entryPointModule.GetMethod(MetadataTokens.EntityHandle(entryPointToken));
            }

            Compilation compilation = new Compilation(_compilerTypeSystemContext, _options);
            compilation.Log = Console.Out;
            compilation.OutputPath = _outputPath;
            if (_options.IsCppCodeGen)
            {
                // Don't set Out when using object writer which is handled by LLVM.
                compilation.Out = new StreamWriter(File.Create(_outputPath));
            }

            compilation.CompileSingleFile(entryPointMethod);
        }
예제 #4
0
파일: Program.cs 프로젝트: nguerrera/corert
        private void SingleFileCompilation()
        {
            Compilation compilation = new Compilation(_options);
            compilation.Log = _options.Verbose ? Console.Out : TextWriter.Null;

            compilation.CompileSingleFile();
        }