[llvm] r363089 - Deduplicate S_CONSTANTs in LLD.
Amy Huang via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 11 11:02:39 PDT 2019
Author: akhuang
Date: Tue Jun 11 11:02:39 2019
New Revision: 363089
URL: http://llvm.org/viewvc/llvm-project?rev=363089&view=rev
Log:
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
Modified:
llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
Modified: llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp?rev=363089&r1=363088&r2=363089&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp (original)
+++ llvm/trunk/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp Tue Jun 11 11:02:39 2019
@@ -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;
}
More information about the llvm-commits
mailing list