private bool LookupInImportExportOrdinals <TType>(
            Func <ImportExportOrdinals, ReadOnlyDictionary <TType, uint> > getOrdinalDictionary,
            TType lookup,
            MrtImportNode node)
        {
            uint ordinal = 0;
            MrtProcessedImportAddressTableNode importTable = null;

            foreach (KeyValuePair <MrtProcessedImportAddressTableNode, ImportExportOrdinals> ordinalGroup in _importOrdinals)
            {
                if (getOrdinalDictionary(ordinalGroup.Value).TryGetValue(lookup, out ordinal))
                {
                    importTable = ordinalGroup.Key;
                    break;
                }
            }

            if (importTable == null)
            {
                throw new ArgumentException();
            }

            node.InitializeImport(importTable, (int)ordinal);
            return(true);
        }
Example #2
0
        public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            MrtImportNode otherImportNode = (MrtImportNode)other;

            int result = string.CompareOrdinal(_importTable.ExportTableToImportSymbol, otherImportNode._importTable.ExportTableToImportSymbol);

            if (result != 0)
            {
                return(result);
            }

            return(Ordinal - otherImportNode.Ordinal);
        }
Example #3
0
        protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
        {
            MrtImportNode otherImportNode = (MrtImportNode)other;

            int result = string.CompareOrdinal(_importTable.ExportTableToImportSymbol, otherImportNode._importTable.ExportTableToImportSymbol);

            if (result != 0)
            {
                return(result);
            }

            return(Ordinal - otherImportNode.Ordinal);
        }
 public void AddNode(MrtImportNode node)
 {
     Debug.Assert(!_nodeListComplete);
     _importNodes.Add(node);
 }