diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-12-06 19:22:54 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-12-06 19:22:54 +0000 |
commit | 3280a5d9f5b158d03174e1b47fe8b1c06bd1ded4 (patch) | |
tree | bccedb5d5da5dfc1b2a15e5ce1abd84e894eecac /llvm/lib/Linker/LinkModules.cpp | |
parent | 89e5306f43422827bd8f42739f3185cec1f6a616 (diff) | |
download | bcm5719-llvm-3280a5d9f5b158d03174e1b47fe8b1c06bd1ded4.tar.gz bcm5719-llvm-3280a5d9f5b158d03174e1b47fe8b1c06bd1ded4.zip |
Turn some DenseMaps that are only used for set operations into DenseSets.
DenseSet has better memory efficiency now.
llvm-svn: 223589
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index de62c3b94d0..87f195ead2f 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -1593,8 +1593,7 @@ bool Linker::StructTypeKeyInfo::isEqual(const StructType *LHS, void Linker::IdentifiedStructTypeSet::addNonOpaque(StructType *Ty) { assert(!Ty->isOpaque()); - bool &Entry = NonOpaqueStructTypes[Ty]; - Entry = true; + NonOpaqueStructTypes.insert(Ty); } void Linker::IdentifiedStructTypeSet::addOpaque(StructType *Ty) { @@ -1609,7 +1608,7 @@ Linker::IdentifiedStructTypeSet::findNonOpaque(ArrayRef<Type *> ETypes, auto I = NonOpaqueStructTypes.find_as(Key); if (I == NonOpaqueStructTypes.end()) return nullptr; - return I->first; + return *I; } bool Linker::IdentifiedStructTypeSet::hasType(StructType *Ty) { @@ -1618,7 +1617,7 @@ bool Linker::IdentifiedStructTypeSet::hasType(StructType *Ty) { auto I = NonOpaqueStructTypes.find(Ty); if (I == NonOpaqueStructTypes.end()) return false; - return I->first == Ty; + return *I == Ty; } void Linker::init(Module *M, DiagnosticHandlerFunction DiagnosticHandler) { |