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); }
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); }
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); } }
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(); } }
public LambdaDetector(CompilerPass parent) : base(parent) { }
public A2(CompilerPass parent) : base(parent) { }
internal ILStripper(CompilerPass parent) : base(parent) { }
public ILVerifier(CompilerPass parent) : base(parent) { _finallyVerifier = new FinallyVerifier(parent); }
public ILAnalyzer(CompilerPass parent) : base(parent) { _objectGetHashCode = ILFactory.GetEntity("object.GetHashCode()") as Method; _objectEquals = ILFactory.GetEntity("object.Equals(object)") as Method; }
public IndirectionTransform(CompilerPass parent) : base(parent) { }
public ExtensionTransform(CompilerPass parent) : base(parent) { }
public StructCopyTransform(CompilerPass parent) : base(parent) { DontCopyAttribute = ILFactory.GetType("Uno.Compiler.ExportTargetInterop.DontCopyStructAttribute"); }
public FinallyVerifier(CompilerPass parent) : base(parent) { }
public BackendTransform(CompilerPass parent) : base(parent) { }
public FixedArrayClassTransform(CompilerPass parent) : base(parent) { }
public NativeTransform(CompilerPass parent) : base(parent) { }
public MainClassFinder(CompilerPass parent) : base(parent) { }
public ThisVerifier(CompilerPass parent) : base(parent) { }
public ConstantFolder(CompilerPass parent) : base(parent) { }
public MemberTransform(CompilerPass parent) : base(parent) { }
public FixedArrayShaderTransform(CompilerPass parent) : base(parent) { }
public ArgumentSwapper(CompilerPass parent, Expression obj, Expression[] args) : base(parent) { Object = obj; Arguments = args; }
public static void Process(CompilerPass parent, Shader shader) { }
public ClosureConversionTransform(CompilerPass parent) : base(parent) { }
public ControlFlowVerifier(CompilerPass parent) : base(parent) { }
public FixedArrayAddressOfRemover(CompilerPass parent) : base(parent) { }