diff options
author | Fadi Hanna <fadim@microsoft.com> | 2018-06-12 00:19:23 +0300 |
---|---|---|
committer | Fadi Hanna <fadim@microsoft.com> | 2018-06-12 00:19:23 +0300 |
commit | 3230b78e20800da9bf4a01035f8582e36e61304f (patch) | |
tree | d96ff2e5f5df500d570b9dce3ec8eba920dce379 /src/ILCompiler.Compiler | |
parent | 0296349dac20ca6f69d6f3e56baa6db0e13b394c (diff) |
Hooking up the baseline TOC logic so that the compiler would reuse ordinals of a baseline build when provided with one during exportations.
Cleanup dead code.
[tfs-changeset: 1703636]
Diffstat (limited to 'src/ILCompiler.Compiler')
-rw-r--r-- | src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtProcessedExportAddressTableNode.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtProcessedExportAddressTableNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtProcessedExportAddressTableNode.cs index 50c3e3a8f..0be12b938 100644 --- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtProcessedExportAddressTableNode.cs +++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/MrtProcessedExportAddressTableNode.cs @@ -24,7 +24,8 @@ namespace ILCompiler.DependencyAnalysis _factory = factory; } - public event Action<int, IExportableSymbolNode> ReportExportedItem; + public event Func<uint, IExportableSymbolNode, bool> ReportExportedItem; + public event Func<uint> GetInitialExportOrdinal; public void AddExportableSymbol(IExportableSymbolNode exportableSymbol) { @@ -75,12 +76,13 @@ namespace ILCompiler.DependencyAnalysis builder.EmitInt(1); // Export table version 1 builder.EmitInt(symbolNodes.Length); // Count of exported symbols in this table - int index = 1; + uint index = GetInitialExportOrdinal == null ? 1 : GetInitialExportOrdinal(); foreach (ISortableSymbolNode symbol in symbolNodes) { builder.EmitReloc(symbol, RelocType.IMAGE_REL_BASED_REL32); - ReportExportedItem?.Invoke(index, (IExportableSymbolNode)symbol); - index++; + bool? baselineOrdinalFound = ReportExportedItem?.Invoke(index, (IExportableSymbolNode)symbol); + if (baselineOrdinalFound.HasValue && !baselineOrdinalFound.Value) + index++; } return builder.ToObjectData(); |