From 9970817c57f7fe03cb75c8a37a11b5d7d1fbeb6f Mon Sep 17 00:00:00 2001 From: Amy Huang Date: Tue, 11 Jun 2019 18:02:39 +0000 Subject: 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 llvm-svn: 363089 --- llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp index de453ee4b84..8ed5b8b44c5 100644 --- a/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp @@ -30,7 +30,7 @@ using namespace llvm::pdb; using namespace llvm::codeview; struct llvm::pdb::GSIHashStreamBuilder { - struct UdtDenseMapInfo { + struct SymbolDenseMapInfo { static inline CVSymbol getEmptyKey() { static CVSymbol Empty; return Empty; @@ -50,7 +50,7 @@ struct llvm::pdb::GSIHashStreamBuilder { std::vector Records; uint32_t StreamIndex; - llvm::DenseSet UdtHashes; + llvm::DenseSet SymbolHashes; std::vector HashRecords; std::array HashBitmap; std::vector HashBuckets; @@ -66,8 +66,8 @@ struct llvm::pdb::GSIHashStreamBuilder { CodeViewContainer::Pdb)); } void addSymbol(const CVSymbol &Symbol) { - if (Symbol.kind() == S_UDT) { - auto Iter = UdtHashes.insert(Symbol); + if (Symbol.kind() == S_UDT || Symbol.kind() == S_CONSTANT) { + auto Iter = SymbolHashes.insert(Symbol); if (!Iter.second) return; } -- cgit v1.2.3