예제 #1
0
        public TestCompiler(BaseTestPlatform platform)
        {
            this.platform = platform;

            simAdapter = platform.CreateSimAdaptor();

            compiler.CompilerTrace.TraceFilter.Active = false;
            compiler.CompilerTrace.TraceListener      = this;

            compiler.CompilerOptions.EnableOptimizations     = true;
            compiler.CompilerOptions.EnableSSA               = true;
            compiler.CompilerOptions.EnableVariablePromotion = true;
            compiler.CompilerOptions.EnableSparseConditionalConstantPropagation = true;
            compiler.CompilerOptions.EnableInlinedMethods = false;

            compiler.CompilerOptions.Architecture  = platform.CreateArchitecture();
            compiler.CompilerOptions.LinkerFactory = delegate { return(new SimLinker(simAdapter)); };
            compiler.CompilerFactory = delegate { return(new SimCompiler(simAdapter)); };

            CompileTestCode();
        }
예제 #2
0
        public void Reset()
        {
            IsInitialized = false;

            simAdapter = platform.CreateSimAdaptor();

            Compiler = new MosaCompiler();

            Compiler.CompilerTrace.TraceFilter.Active = false;
            Compiler.CompilerTrace.TraceListener      = this;

            Compiler.CompilerOptions.EnableOptimizations     = true;
            Compiler.CompilerOptions.EnableSSA               = true;
            Compiler.CompilerOptions.EnableVariablePromotion = true;
            Compiler.CompilerOptions.EnableSparseConditionalConstantPropagation = true;
            Compiler.CompilerOptions.EnableInlinedMethods = true;
            Compiler.CompilerOptions.EmitRelocations      = false;
            Compiler.CompilerOptions.EmitSymbols          = false;
            Compiler.CompilerOptions.Architecture         = platform.CreateArchitecture();
            Compiler.CompilerOptions.LinkerFormatType     = LinkerFormatType.Elf32;
            Compiler.CompilerFactory = delegate { return(new SimCompiler(simAdapter)); };
        }