Skip to content

Commit 654731b

Browse files
committed
Hook up the type map manager to the trimming test driver
1 parent 4334a63 commit 654731b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCasesRunner/TrimmingDriver.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,15 @@ public ILScanResults Trim (ILCompilerOptions options, TrimmingCustomizations? cu
139139
InteropStateManager interopStateManager = new InteropStateManager (typeSystemContext.GeneratedAssembly);
140140
InteropStubManager interopStubManager = new UsageBasedInteropStubManager (interopStateManager, pinvokePolicy, logger);
141141

142-
CompilationBuilder builder = new RyuJitCompilationBuilder (typeSystemContext, compilationGroup)
142+
TypeMapManager typeMapManager = new EmptyTypeMapManager();
143+
if (entrypointModule is { Assembly: EcmaAssembly entryAssembly })
144+
{
145+
typeMapManager = new MetadataBasedTypeMapManager (entryAssembly);
146+
}
147+
148+
compilationRoots.Add(typeMapManager);
149+
150+
CompilationBuilder builder = new RyuJitCompilationBuilder (typeSystemContext, compilationGroup)
143151
.UseILProvider (ilProvider)
144152
.UseCompilationUnitPrefix("");
145153

@@ -148,6 +156,7 @@ public ILScanResults Trim (ILCompilerOptions options, TrimmingCustomizations? cu
148156
.UseMetadataManager (metadataManager)
149157
.UseParallelism (System.Diagnostics.Debugger.IsAttached ? 1 : -1)
150158
.UseInteropStubManager (interopStubManager)
159+
.UseTypeMapManager (typeMapManager)
151160
.ToILScanner ();
152161

153162
return scanner.Scan ();

0 commit comments

Comments
 (0)