mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-05 02:07:16 +00:00
Reserve space for the eventual filling of the vector. This gives a small speedup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153949 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
43b32e0cff
commit
f563fc35c8
@ -551,17 +551,16 @@ getAllMetadataOtherThanDebugLocImpl(SmallVectorImpl<std::pair<unsigned,
|
||||
getContext().pImpl->MetadataStore.count(this) &&
|
||||
"Shouldn't have called this");
|
||||
const LLVMContextImpl::MDMapTy &Info =
|
||||
getContext().pImpl->MetadataStore.find(this)->second;
|
||||
getContext().pImpl->MetadataStore.find(this)->second;
|
||||
assert(!Info.empty() && "Shouldn't have called this");
|
||||
|
||||
Result.reserve(Info.size());
|
||||
Result.append(Info.begin(), Info.end());
|
||||
|
||||
|
||||
// Sort the resulting array so it is stable.
|
||||
if (Result.size() > 1)
|
||||
array_pod_sort(Result.begin(), Result.end());
|
||||
}
|
||||
|
||||
|
||||
/// clearMetadataHashEntries - Clear all hashtable-based metadata from
|
||||
/// this instruction.
|
||||
void Instruction::clearMetadataHashEntries() {
|
||||
|
Loading…
Reference in New Issue
Block a user