From 9c353a84fb0f7701ea53713a516ccedadb3badc5 Mon Sep 17 00:00:00 2001 From: Dehao Chen Date: Mon, 10 Jul 2017 15:31:53 +0000 Subject: [PATCH] Use emplace_back to replace size() and resize(). Summary: This speeds-up thin-link for ~29% for large programs. Reviewers: tejohnson Reviewed By: tejohnson Subscribers: grandinj, sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35145 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307543 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/gold/gold-plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index cf207d9dbbb..6d011bab079 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -477,7 +477,7 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file, std::unique_ptr Obj = std::move(*ObjOrErr); - Modules.resize(Modules.size() + 1); + Modules.emplace_back(); claimed_file &cf = Modules.back(); cf.handle = file->handle; -- 2.40.0