コード例 #1
0
        public void SetupMetadata(CST.Global global)
        {
            NumWarnings = 0;
            NumErrors   = 0;

            Global = global;

            if (tracerStream != null)
            {
                Tracer = new CST.CSTWriter(global, CST.WriterStyle.Debug, tracerStream);
            }

            Validity = new ValidityContext(this);

            GenericEnumeratorTypeConstructorRef = MkRef(Constants.GenericEnumeratorTypeConstructorName);
            JSContextRef   = MkRef(Constants.JSContextName);
            JSObjectRef    = MkRef(Constants.JSObjectName);
            JSPropertyRef  = MkRef(Constants.JSPropertyName);
            JSExceptionRef = MkRef(Constants.JSExceptionName);

            GlobalMapping   = new GlobalMapping(this);
            AttributeHelper = new AttributeHelper(this);
            InteropManager  = new InteropManager(this);
            JSTHelpers      = new JSTHelpers(this);
            InlinedMethods  = new InlinedMethodCache(this);
            Traces          = new Traces(this);
        }
コード例 #2
0
 public void Collect(CST.Global global, CST.AssemblyDef assemblyDef, CST.TypeDef typeDef)
 {
     foreach (var methodDef in typeDef.Members.OfType <CST.MethodDef>().Where(m => m.IsUsed && m.Invalid == null))
     {
         Collect(global, methodDef);
     }
 }
コード例 #3
0
        private void Collect(CST.Global global, CST.MethodDef methodDef)
        {
            var instructions = methodDef.Instructions(global);

            if (instructions != null)
            {
                foreach (var inst in instructions.Body)
                {
                    if (inst.Flavor == CST.InstructionFlavor.LdString)
                    {
                        var ldstri = (CST.LdStringInstruction)inst;
                        Seen(ldstri.Value);
                    }
                }
            }
        }
コード例 #4
0
        public void SetupMetadata(CST.Global global)
        {
            NumWarnings = 0;
            NumErrors = 0;

            Global = global;

            if (tracerStream != null)
                Tracer = new CST.CSTWriter(global, CST.WriterStyle.Debug, tracerStream);

            Validity = new ValidityContext(this);

            GenericEnumeratorTypeConstructorRef = MkRef(Constants.GenericEnumeratorTypeConstructorName);
            JSContextRef = MkRef(Constants.JSContextName);
            JSObjectRef = MkRef(Constants.JSObjectName);
            JSPropertyRef = MkRef(Constants.JSPropertyName);
            JSExceptionRef = MkRef(Constants.JSExceptionName);

            GlobalMapping = new GlobalMapping(this);
            AttributeHelper = new AttributeHelper(this);
            InteropManager = new InteropManager(this);
            JSTHelpers = new JSTHelpers(this);
            InlinedMethods = new InlinedMethodCache(this);
            Traces = new Traces(this);
        }