aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs')
-rw-r--r--src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs
index 31cbf0b8..1c2ca8eb 100644
--- a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs
+++ b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs
@@ -31,17 +31,17 @@ namespace WixToolset.Core.Link
31 /// <summary> 31 /// <summary>
32 /// Gets the collection of loaded symbols. 32 /// Gets the collection of loaded symbols.
33 /// </summary> 33 /// </summary>
34 public IDictionary<string, TupleWithSection> TuplesByName { get; private set; } 34 public IDictionary<string, SymbolWithSection> SymbolsByName { get; private set; }
35 35
36 /// <summary> 36 /// <summary>
37 /// Gets the collection of possibly conflicting symbols. 37 /// Gets the collection of possibly conflicting symbols.
38 /// </summary> 38 /// </summary>
39 public IEnumerable<TupleWithSection> PossibleConflicts { get; private set; } 39 public IEnumerable<SymbolWithSection> PossibleConflicts { get; private set; }
40 40
41 public void Execute() 41 public void Execute()
42 { 42 {
43 var tuplesByName = new Dictionary<string, TupleWithSection>(); 43 var symbolsByName = new Dictionary<string, SymbolWithSection>();
44 var possibleConflicts = new HashSet<TupleWithSection>(); 44 var possibleConflicts = new HashSet<SymbolWithSection>();
45 45
46 if (!Enum.TryParse(this.ExpectedOutputType.ToString(), out SectionType expectedEntrySectionType)) 46 if (!Enum.TryParse(this.ExpectedOutputType.ToString(), out SectionType expectedEntrySectionType))
47 { 47 {
@@ -66,44 +66,44 @@ namespace WixToolset.Core.Link
66 } 66 }
67 else 67 else
68 { 68 {
69 this.Messaging.Write(ErrorMessages.MultipleEntrySections(this.EntrySection.Tuples.FirstOrDefault()?.SourceLineNumbers, this.EntrySection.Id, section.Id)); 69 this.Messaging.Write(ErrorMessages.MultipleEntrySections(this.EntrySection.Symbols.FirstOrDefault()?.SourceLineNumbers, this.EntrySection.Id, section.Id));
70 this.Messaging.Write(ErrorMessages.MultipleEntrySections2(section.Tuples.FirstOrDefault()?.SourceLineNumbers)); 70 this.Messaging.Write(ErrorMessages.MultipleEntrySections2(section.Symbols.FirstOrDefault()?.SourceLineNumbers));
71 } 71 }
72 } 72 }
73 73
74 // Load all the symbols from the section's tables that create symbols. 74 // Load all the symbols from the section's tables that create symbols.
75 foreach (var tuple in section.Tuples.Where(t => t.Id != null)) 75 foreach (var symbol in section.Symbols.Where(t => t.Id != null))
76 { 76 {
77 var symbol = new TupleWithSection(section, tuple); 77 var symbolWithSection = new SymbolWithSection(section, symbol);
78 78
79 if (!tuplesByName.TryGetValue(symbol.Name, out var existingSymbol)) 79 if (!symbolsByName.TryGetValue(symbolWithSection.Name, out var existingSymbol))
80 { 80 {
81 tuplesByName.Add(symbol.Name, symbol); 81 symbolsByName.Add(symbolWithSection.Name, symbolWithSection);
82 } 82 }
83 else // uh-oh, duplicate symbols. 83 else // uh-oh, duplicate symbols.
84 { 84 {
85 // If the duplicate symbols are both private directories, there is a chance that they 85 // If the duplicate symbols are both private directories, there is a chance that they
86 // point to identical tuples. Identical directory tuples are redundant and will not cause 86 // point to identical symbols. Identical directory symbols are redundant and will not cause
87 // conflicts. 87 // conflicts.
88 if (AccessModifier.Private == existingSymbol.Access && AccessModifier.Private == symbol.Access && 88 if (AccessModifier.Private == existingSymbol.Access && AccessModifier.Private == symbolWithSection.Access &&
89 TupleDefinitionType.Directory == existingSymbol.Tuple.Definition.Type && existingSymbol.Tuple.IsIdentical(symbol.Tuple)) 89 SymbolDefinitionType.Directory == existingSymbol.Symbol.Definition.Type && existingSymbol.Symbol.IsIdentical(symbolWithSection.Symbol))
90 { 90 {
91 // Ensure identical symbol's tuple is marked redundant to ensure (should the tuple be 91 // Ensure identical symbol's symbol is marked redundant to ensure (should the symbol be
92 // referenced into the final output) it will not add duplicate primary keys during 92 // referenced into the final output) it will not add duplicate primary keys during
93 // the .IDT importing. 93 // the .IDT importing.
94 //symbol.Row.Redundant = true; - TODO: remove this 94 //symbol.Row.Redundant = true; - TODO: remove this
95 existingSymbol.AddRedundant(symbol); 95 existingSymbol.AddRedundant(symbolWithSection);
96 } 96 }
97 else 97 else
98 { 98 {
99 existingSymbol.AddPossibleConflict(symbol); 99 existingSymbol.AddPossibleConflict(symbolWithSection);
100 possibleConflicts.Add(existingSymbol); 100 possibleConflicts.Add(existingSymbol);
101 } 101 }
102 } 102 }
103 } 103 }
104 } 104 }
105 105
106 this.TuplesByName = tuplesByName; 106 this.SymbolsByName = symbolsByName;
107 this.PossibleConflicts = possibleConflicts; 107 this.PossibleConflicts = possibleConflicts;
108 } 108 }
109 } 109 }