Пример #1
0
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody() && !metadataWriter.MetadataOnly)
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);

                    for (IImportScope scope = body.ImportScope; scope != null; scope = scope.Parent)
                    {
                        if (_alreadySeenScopes.Add(scope))
                        {
                            VisitImports(scope.GetUsedNamespaces());
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else if (!metadataWriter.MetadataOnly)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }
Пример #2
0
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody())
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);
                }
                else if (!metadataWriter.allowMissingMethodBodies)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }
Пример #3
0
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody())
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);

                    for (IImportScope scope = body.ImportScope; scope != null; scope = scope.Parent)
                    {
                        if (_alreadySeenScopes.Add(scope))
                        {
                            VisitImports(scope.GetUsedNamespaces(Context));
                        }
                        else
                        {
                            break;
                        }
                    }
                }
                else if (!metadataWriter.allowMissingMethodBodies)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }
Пример #4
0
        protected override void ProcessMethodBody(IMethodDefinition method)
        {
            if (method.HasBody())
            {
                var body = method.GetBody(Context);

                if (body != null)
                {
                    this.Visit(body);
                }
                else if (!metadataWriter.allowMissingMethodBodies)
                {
                    throw ExceptionUtilities.Unreachable;
                }
            }
        }