| File: Compiler\EmptyInteropStubManager.cs | Web Access |
| Project: ILCompiler.Compiler.csproj (ILCompiler.Compiler) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Internal.TypeSystem; using ILCompiler.DependencyAnalysis; using DependencyList = ILCompiler.DependencyAnalysisFramework.DependencyNodeCore<ILCompiler.DependencyAnalysis.NodeFactory>.DependencyList; using DependencySink = ILCompiler.DependencyAnalysisFramework.DependencyNodeCore<ILCompiler.DependencyAnalysis.NodeFactory>.DependencySink; using IDependencySink = ILCompiler.DependencyAnalysisFramework.DependencyNodeCore<ILCompiler.DependencyAnalysis.NodeFactory>.IDependencySink; using Internal.IL; using Internal.Text; using ILCompiler.DependencyAnalysisFramework; namespace ILCompiler { /// <summary> /// This class is responsible for managing stub methods for interop /// </summary> public sealed class EmptyInteropStubManager : InteropStubManager { private class DummyConfiguration : PInvokeILEmitterConfiguration { public override LinkageMetadata GetLinkageMetadata(MethodDesc method) { string symbol = method.GetPInvokeMethodMetadata().Name; return new LinkageMetadata(symbol is null ? default : new Utf8String(symbol)); } } public EmptyInteropStubManager() : base(new DummyConfiguration()) { } public override PInvokeILProvider CreatePInvokeILProvider() { return null; } public override void AddDependenciesDueToMethodCodePresence(IDependencySink dependencies, NodeFactory factory, MethodDesc method) { } public override void AddInterestingInteropConstructedTypeDependencies(DependencySink dependencies, NodeFactory factory, TypeDesc type) { } public override void AddMarshalAPIsGenericDependencies(IDependencySink dependencies, NodeFactory factory, MethodDesc method) { } } }