summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-05 22:02:37 +0000
committerZachary Turner <zturner@google.com>2017-05-05 22:02:37 +0000
commit8c74673388f62f5f4bffc7e840d405c0914558a4 (patch)
tree87f70831bd1071a8186937241b62846eeab18b7e /llvm/include
parentc1c569168611e312a698ab358fe18c7ea0eda4c6 (diff)
downloadbcm5719-llvm-8c74673388f62f5f4bffc7e840d405c0914558a4.tar.gz
bcm5719-llvm-8c74673388f62f5f4bffc7e840d405c0914558a4.zip
[CodeView] Reserve TypeDatabase records up front.
Most of the time we know exactly how many type records we have in a list, and we want to use the visitor to deserialize them into actual records in a database. Previously we were just using push_back() every time without reserving the space up front in the vector. This is obviously terrible from a performance standpoint, and it's not uncommon to have PDB files with half a million type records, where the performance degredation was quite noticeable. llvm-svn: 302302
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/DebugInfo/CodeView/TypeDatabase.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/DebugInfo/CodeView/TypeDatabase.h b/llvm/include/llvm/DebugInfo/CodeView/TypeDatabase.h
index 220de4bf0ee..be7b19e7df0 100644
--- a/llvm/include/llvm/DebugInfo/CodeView/TypeDatabase.h
+++ b/llvm/include/llvm/DebugInfo/CodeView/TypeDatabase.h
@@ -21,7 +21,7 @@ namespace llvm {
namespace codeview {
class TypeDatabase {
public:
- TypeDatabase() : TypeNameStorage(Allocator) {}
+ explicit TypeDatabase(uint32_t ExpectedSize);
/// Gets the type index for the next type record.
TypeIndex getNextTypeIndex() const;
OpenPOWER on IntegriCloud