Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit af0dbee

Browse files
committed
Deduplicate S_CONSTANTs in LLD.
Summary: Deduplicate S_CONSTANTS when linking, if they have the same value. Reviewers: rnk Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63151 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363089 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8a6498e commit af0dbee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using namespace llvm::pdb;
3030
using namespace llvm::codeview;
3131

3232
struct llvm::pdb::GSIHashStreamBuilder {
33-
struct UdtDenseMapInfo {
33+
struct SymbolDenseMapInfo {
3434
static inline CVSymbol getEmptyKey() {
3535
static CVSymbol Empty;
3636
return Empty;
@@ -50,7 +50,7 @@ struct llvm::pdb::GSIHashStreamBuilder {
5050

5151
std::vector<CVSymbol> Records;
5252
uint32_t StreamIndex;
53-
llvm::DenseSet<CVSymbol, UdtDenseMapInfo> UdtHashes;
53+
llvm::DenseSet<CVSymbol, SymbolDenseMapInfo> SymbolHashes;
5454
std::vector<PSHashRecord> HashRecords;
5555
std::array<support::ulittle32_t, (IPHR_HASH + 32) / 32> HashBitmap;
5656
std::vector<support::ulittle32_t> HashBuckets;
@@ -66,8 +66,8 @@ struct llvm::pdb::GSIHashStreamBuilder {
6666
CodeViewContainer::Pdb));
6767
}
6868
void addSymbol(const CVSymbol &Symbol) {
69-
if (Symbol.kind() == S_UDT) {
70-
auto Iter = UdtHashes.insert(Symbol);
69+
if (Symbol.kind() == S_UDT || Symbol.kind() == S_CONSTANT) {
70+
auto Iter = SymbolHashes.insert(Symbol);
7171
if (!Iter.second)
7272
return;
7373
}

0 commit comments

Comments
 (0)