Skip to content
Merged
Changes from all commits
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 @@ -13,11 +13,11 @@ namespace ILCompiler
public class ExportsFileWriter
{
private readonly string _exportsFile;
private readonly IEnumerable<string> _exportSymbols;
private readonly string[] _exportSymbols;
private readonly List<EcmaMethod> _methods;
private readonly TypeSystemContext _context;

public ExportsFileWriter(TypeSystemContext context, string exportsFile, IEnumerable<string> exportSymbols)
public ExportsFileWriter(TypeSystemContext context, string exportsFile, string[] exportSymbols)
{
_exportsFile = exportsFile;
_exportSymbols = exportSymbols;
Expand Down Expand Up @@ -51,11 +51,14 @@ public void EmitExportedMethods()
else
{
streamWriter.WriteLine("V1.0 {");
streamWriter.WriteLine(" global:");
foreach (string symbol in _exportSymbols)
streamWriter.WriteLine($" {symbol};");
foreach (var method in _methods)
streamWriter.WriteLine($" {method.GetUnmanagedCallersOnlyExportName()};");
if (_exportSymbols.Length != 0 || _methods.Count != 0)
{
streamWriter.WriteLine(" global:");
foreach (string symbol in _exportSymbols)
streamWriter.WriteLine($" {symbol};");
foreach (var method in _methods)
streamWriter.WriteLine($" {method.GetUnmanagedCallersOnlyExportName()};");
}
streamWriter.WriteLine(" local: *;");
streamWriter.WriteLine("};");
}
Expand Down