示例#1
0
        protected override void GetDependenciesDueToMethodCodePresenceInternal(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
        {
            bool scanReflection = (_generationOptions & UsageBasedMetadataGenerationOptions.ReflectionILScanning) != 0;
            bool scanInterop    = (_generationOptions & UsageBasedMetadataGenerationOptions.IteropILScanning) != 0;

            // NOTE: we will intentionally run the scanner even if both scan modes are disabled
            // because we rely on the scanner to report constructed EETypes for LDTOKEN references
            // to types.
            ReflectionMethodBodyScanner.ScanModes modes = 0;
            if (scanReflection)
            {
                modes |= ReflectionMethodBodyScanner.ScanModes.Reflection;
            }
            if (scanInterop)
            {
                modes |= ReflectionMethodBodyScanner.ScanModes.Interop;
            }

            MethodIL methodIL = _ilProvider.GetMethodIL(method);

            if (methodIL != null)
            {
                try
                {
                    ReflectionMethodBodyScanner.Scan(ref dependencies, factory, methodIL, modes);
                }
                catch (TypeSystemException)
                {
                    // A problem with the IL - we just don't scan it...
                }
            }
        }
        protected override void GetDependenciesDueToMethodCodePresenceInternal(ref DependencyList dependencies, NodeFactory factory, MethodDesc method)
        {
            if ((_generationOptions & UsageBasedMetadataGenerationOptions.ILScanning) != 0)
            {
                MethodIL methodIL = _ilProvider.GetMethodIL(method);

                if (methodIL != null)
                {
                    try
                    {
                        ReflectionMethodBodyScanner.Scan(ref dependencies, factory, methodIL);
                    }
                    catch (TypeSystemException)
                    {
                        // A problem with the IL - we just don't scan it...
                    }
                }
            }
        }
示例#3
0
        protected override void GetDependenciesDueToMethodCodePresence(ref DependencyNodeCore <NodeFactory> .DependencyList dependencies, NodeFactory factory, MethodDesc method)
        {
            if (_ilProvider != null)
            {
                MethodIL methodIL = _ilProvider.GetMethodIL(method);

                if (methodIL != null)
                {
                    try
                    {
                        ReflectionMethodBodyScanner.ScanMarshalOnly(ref dependencies, factory, methodIL);
                    }
                    catch (TypeSystemException)
                    {
                        // A problem with the IL - we just don't scan it...
                    }
                }
            }
        }
示例#4
0
 public HandleCallAction(
     LinkContext context,
     ReflectionMethodBodyScanner reflectionMethodBodyScanner,
     in ReflectionMethodBodyScanner.AnalysisContext analysisContext,
示例#5
0
 public RequireDynamicallyAccessedMembersAction(
     LinkContext context,
     ReflectionMethodBodyScanner reflectionMethodBodyScanner,
     in ReflectionMethodBodyScanner.AnalysisContext analysisContext)