Ejemplo n.º 1
0
        private void InitializeDefaultOptions()
        {
            _options = new CompilationOptions();

            _options.InputFilePaths = _inputFilePaths;
            _options.ReferenceFilePaths = _referenceFilePaths;

            _options.SystemModuleName = "System.Private.CoreLib";

#if FXCORE
            // We could offer this as a command line option, but then we also need to
            // load a different RyuJIT, so this is a future nice to have...
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                _options.TargetOS = TargetOS.Windows;
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                _options.TargetOS = TargetOS.Linux;
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                _options.TargetOS = TargetOS.OSX;
            else
                throw new NotImplementedException();
#else
            _options.TargetOS = TargetOS.Windows;
#endif

            _options.TargetArchitecture = TargetArchitecture.X64;
            _options.MultiFile = false;
        }
Ejemplo n.º 2
0
        public Compilation(CompilerTypeSystemContext typeSystemContext, CompilationOptions options)
        {
            _typeSystemContext = typeSystemContext;
            _options = options;

            _nameMangler = new NameMangler(this);
        }
Ejemplo n.º 3
0
        public Compilation(CompilationOptions options, CompilerTypeSystemContext context, CompilationModuleGroup compilationGroup)
        {
            _options = options;

            _nameMangler = new NameMangler(options.IsCppCodeGen);

            _typeSystemContext = context;
            _compilationModuleGroup = compilationGroup;
        }
Ejemplo n.º 4
0
        public Compilation(CompilationOptions options)
        {
            _options = options;

            _typeSystemContext = new CompilerTypeSystemContext(new TargetDetails(options.TargetArchitecture, options.TargetOS));
            _typeSystemContext.InputFilePaths = options.InputFilePaths;
            _typeSystemContext.ReferenceFilePaths = options.ReferenceFilePaths;

            _typeSystemContext.SetSystemModule(_typeSystemContext.GetModuleForSimpleName(options.SystemModuleName));

            _nameMangler = new NameMangler(this);
        }
Ejemplo n.º 5
0
        private void InitializeDefaultOptions()
        {
            _options = new CompilationOptions();

#if FXCORE
            // We could offer this as a command line option, but then we also need to
            // load a different RyuJIT, so this is a future nice to have...
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
                _targetOS = TargetOS.Windows;
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                _targetOS = TargetOS.Linux;
            else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
                _targetOS = TargetOS.OSX;
            else
                throw new NotImplementedException();

            switch (RuntimeInformation.ProcessArchitecture)
            {
            case Architecture.X86:
                _targetArchitecture = TargetArchitecture.X86;
                break;
            case Architecture.X64:
                _targetArchitecture = TargetArchitecture.X64;
                break;
            case Architecture.Arm:
                _targetArchitecture = TargetArchitecture.ARM;
                break;
            case Architecture.Arm64:
                _targetArchitecture = TargetArchitecture.ARM64;
                break;
            default:
                throw new NotImplementedException();
            }
#else
            _targetOS = TargetOS.Windows;
            _targetArchitecture = TargetArchitecture.X64;
#endif
        }
Ejemplo n.º 6
0
        public Compilation(CompilationOptions options)
        {
            _options = options;

            _typeSystemContext = new CompilerTypeSystemContext(new TargetDetails(options.TargetArchitecture, options.TargetOS));
            _typeSystemContext.InputFilePaths = options.InputFilePaths;
            _typeSystemContext.ReferenceFilePaths = options.ReferenceFilePaths;

            _typeSystemContext.SetSystemModule(_typeSystemContext.GetModuleForSimpleName(options.SystemModuleName));

            _nameMangler = new NameMangler(this);

            _typeInitManager = new TypeInitialization();

            if (options.MultiFile)
            {
                _compilationModuleGroup = new MultiFileCompilationModuleGroup(_typeSystemContext, this);
            }
            else
            {
                _compilationModuleGroup = new SingleFileCompilationModuleGroup(_typeSystemContext, this);
            }
        }