1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Reserve space for the eventual filling of the vector. This gives a small speedup.

llvm-svn: 153949
This commit is contained in:
Bill Wendling 2012-04-03 10:50:09 +00:00
parent d72bf636aa
commit 3f12fbd290

View File

@ -553,7 +553,7 @@ getAllMetadataOtherThanDebugLocImpl(SmallVectorImpl<std::pair<unsigned,
const LLVMContextImpl::MDMapTy &Info =
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.
@ -561,7 +561,6 @@ getAllMetadataOtherThanDebugLocImpl(SmallVectorImpl<std::pair<unsigned,
array_pod_sort(Result.begin(), Result.end());
}
/// clearMetadataHashEntries - Clear all hashtable-based metadata from
/// this instruction.
void Instruction::clearMetadataHashEntries() {