Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace ILCompiler
{
public abstract class Compilation : ICompilation
public abstract class Compilation : ICompilation, IDisposable
{
protected readonly DependencyAnalyzerBase<NodeFactory> _dependencyGraph;
protected readonly NodeFactory _nodeFactory;
Expand Down Expand Up @@ -67,6 +67,7 @@ protected Compilation(
_methodILCache = new ILCache(ilProvider, NodeFactory.CompilationModuleGroup);
}

public abstract void Dispose();
public abstract void Compile(string outputFileName);
public abstract void WriteDependencyLog(string outputFileName);

Expand Down Expand Up @@ -218,6 +219,7 @@ public interface ICompilation
{
void Compile(string outputFileName);
void WriteDependencyLog(string outputFileName);
void Dispose();
}

public sealed class ReadyToRunCodegenCompilation : Compilation
Expand Down Expand Up @@ -638,5 +640,10 @@ protected override void ComputeDependencyNodeDependencies(List<DependencyNodeCor
}

public ISymbolNode GetFieldRvaData(FieldDesc field) => NodeFactory.CopiedFieldRva(field);

public override void Dispose()
{
_corInfoImpls?.Clear();
}
}
}
1 change: 1 addition & 0 deletions src/coreclr/tools/aot/crossgen2/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ private int Run(string[] args)

if (_commandLineOptions.DgmlLogFileName != null)
compilation.WriteDependencyLog(_commandLineOptions.DgmlLogFileName);
compilation.Dispose();
}

return 0;
Expand Down