Esempio n. 1
0
        public TestSetupTransform(CompilerPass parent)
            : base(parent)
        {
            if (Environment.Options.TestOptions == null)
            {
                throw new InvalidOperationException("Internal error, could not get test options");
            }

            _testOptions         = Environment.Options.TestOptions.Value;
            _testAttributeType   = ILFactory.GetType("Uno.Testing.TestAttribute");
            _ignoreAttributeType = ILFactory.GetType("Uno.Testing.IgnoreAttribute");

            if (_testAttributeType is InvalidType)
            {
                throw new InvalidOperationException("Did you forget to reference the Uno.Testing package?");
            }

            _actionType    = (DelegateType)ILFactory.GetType("Uno.Action");
            _testSetupType = ILFactory.GetType("Uno.Testing.TestSetup");

            _appClass = Essentials.Application;

            _source           = Package.Source;
            _testRegistryType = ILFactory.GetType("Uno.Testing.Registry");
            _mainClass        = new ClassType(_source, Data.IL, null, Modifiers.Generated | Modifiers.Public, "MainClass");
            _mainClass.SetBase(_appClass);
            _mainConstructor = new Constructor(_source, _mainClass, null, Modifiers.Public, ParameterList.Empty);
            _mainClass.Constructors.Add(_mainConstructor);

            _testSetupField = new Field(_source, _mainClass, "_testSetup", null, Modifiers.Private, FieldModifiers.ReadOnly, _testSetupType);
            _mainClass.Fields.Add(_testSetupField);

            Data.IL.Types.Add(_mainClass);
        }
Esempio n. 2
0
        public Compiler(Log log, Backend backend, SourcePackage package, CompilerOptions options)
            : base(log)
        {
            // This is a block of dependency injection to initialize the Compiler
            var il         = new Namespace();
            var extensions = new ExtensionRoot();

            Backend = backend;
            var disk = Disk = new Disk(log, true);

            Shell = new Shell(log);
            var essentials   = Essentials = new Essentials();
            var resolver     = NameResolver = new NameResolver(this);
            var ilf          = ILFactory = new ILFactory(backend, il, essentials, resolver, this);
            var data         = Data = new BuildData(il, extensions, ilf);
            var environment  = Environment = new BuildEnvironment(backend, package, options, extensions, ilf, this);
            var input        = Input = new SourceReader(log, package, environment);
            var blockBuilder = BlockBuilder = new BlockBuilder(backend, il, ilf, resolver, this);
            var typeBuilder  = TypeBuilder = new TypeBuilder(environment, ilf, resolver, this);
            var bundle       = BundleBuilder = new BundleBuilder(backend, environment, ilf, this);

            AstProcessor = new AstProcessor(il, blockBuilder, typeBuilder, resolver, environment);
            UxlProcessor = new UxlProcessor(disk, backend.Name, il, extensions, environment, ilf);
            Plugins      = new PluginCache(log, bundle, ilf, environment);
            var pass = Pass = new CompilerPass(disk, data, environment, ilf, backend, input.Package, typeBuilder, resolver);

            Utilities      = new Utilities(il, pass);
            ILVerifier     = new ILVerifier(pass);
            ConstantFolder = new ConstantFolder(pass);
            ILStripper     = new ILStripper(pass);
        }
Esempio n. 3
0
        public static void Process(CompilerPass parent, DataType dt, Scope initScope, HashSet <Scope> drawScopes)
        {
            var p = new FixedArrayClassTransform(parent);

            initScope.Visit(p);

            foreach (var s in drawScopes)
            {
                s.Visit(p);
            }
        }
Esempio n. 4
0
 internal void ResolveMainClass(CompilerPass parent, BuildEnvironment environment)
 {
     if (MainClass != null && MainClass != DataType.Invalid)
     {
         return;
     }
     if (!string.IsNullOrEmpty(environment.Options.MainClass))
     {
         SetMainClass(_ilf.GetType(environment.Options.MainClass));
     }
     else
     {
         new MainClassFinder(parent).Run();
     }
 }
Esempio n. 5
0
 public LambdaDetector(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 6
0
File: A2.cs Progetto: mortend/uno
 public A2(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 7
0
 internal ILStripper(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 8
0
 public ILVerifier(CompilerPass parent)
     : base(parent)
 {
     _finallyVerifier = new FinallyVerifier(parent);
 }
Esempio n. 9
0
 public ILAnalyzer(CompilerPass parent)
     : base(parent)
 {
     _objectGetHashCode = ILFactory.GetEntity("object.GetHashCode()") as Method;
     _objectEquals      = ILFactory.GetEntity("object.Equals(object)") as Method;
 }
Esempio n. 10
0
 public IndirectionTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 11
0
 public ExtensionTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 12
0
 public StructCopyTransform(CompilerPass parent)
     : base(parent)
 {
     DontCopyAttribute = ILFactory.GetType("Uno.Compiler.ExportTargetInterop.DontCopyStructAttribute");
 }
Esempio n. 13
0
 public FinallyVerifier(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 14
0
 public BackendTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 15
0
 public FixedArrayClassTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 16
0
 public NativeTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 17
0
 public MainClassFinder(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 18
0
 public ThisVerifier(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 19
0
 public ConstantFolder(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 20
0
 public MemberTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 21
0
 public FixedArrayShaderTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 22
0
File: O1.cs Progetto: kusma/uno
 public ArgumentSwapper(CompilerPass parent, Expression obj, Expression[] args)
     : base(parent)
 {
     Object    = obj;
     Arguments = args;
 }
Esempio n. 23
0
 public static void Process(CompilerPass parent, Shader shader)
 {
 }
Esempio n. 24
0
 public ClosureConversionTransform(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 25
0
 public ControlFlowVerifier(CompilerPass parent)
     : base(parent)
 {
 }
Esempio n. 26
0
 public FixedArrayAddressOfRemover(CompilerPass parent)
     : base(parent)
 {
 }