diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-04 03:07:26 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-04 03:07:26 +0000 |
commit | 29202d506509cf470a1698d205c38f880b4130d5 (patch) | |
tree | 509cbeaf20821229b096a04ecc7cfed0904f869a /lib/CodeGen/CGVtable.cpp | |
parent | 2fce216955f754d661e2d86cf2778dbad2db2f0a (diff) |
Add a premature optimization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90532 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 7ee19ebf39..23de0a7948 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -832,6 +832,9 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m, } void VtableBuilder::AppendMethodsToVtable() { + // Reserve room for our new methods. + methods.reserve(methods.size() + Methods.size()); + for (unsigned i = 0, e = Methods.size(); i != e; ++i) { GlobalDecl GD = Methods[i]; const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl()); |