diff options
| author | Amy Huang <akhuang@google.com> | 2019-06-11 18:02:39 +0000 |
|---|---|---|
| committer | Amy Huang <akhuang@google.com> | 2019-06-11 18:02:39 +0000 |
| commit | 9970817c57f7fe03cb75c8a37a11b5d7d1fbeb6f (patch) | |
| tree | 53a82b886699d711790a7af8ac90942ec12d0386 /llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp | |
| parent | 36bd1c90d0e0f10b1999470c2372e50386bfd936 (diff) | |
| download | bcm5719-llvm-9970817c57f7fe03cb75c8a37a11b5d7d1fbeb6f.tar.gz bcm5719-llvm-9970817c57f7fe03cb75c8a37a11b5d7d1fbeb6f.zip | |
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
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<CVSymbol> Records; uint32_t StreamIndex; - llvm::DenseSet<CVSymbol, UdtDenseMapInfo> UdtHashes; + llvm::DenseSet<CVSymbol, SymbolDenseMapInfo> SymbolHashes; std::vector<PSHashRecord> HashRecords; std::array<support::ulittle32_t, (IPHR_HASH + 32) / 32> HashBitmap; std::vector<support::ulittle32_t> 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; } |

