summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-07-10 15:31:53 +0000
committerDehao Chen <dehao@google.com>2017-07-10 15:31:53 +0000
commit396f62444d69985e526042ee89c21ee30c6fe01b (patch)
treed9bd2e9ac6125651952521a9f0ae7c0119c92f77
parent70ffd65ca97bd7010108ad8c1369c105fb78714a (diff)
downloadbcm5719-llvm-396f62444d69985e526042ee89c21ee30c6fe01b.tar.gz
bcm5719-llvm-396f62444d69985e526042ee89c21ee30c6fe01b.zip
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 llvm-svn: 307543
-rw-r--r--llvm/tools/gold/gold-plugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/gold/gold-plugin.cpp b/llvm/tools/gold/gold-plugin.cpp
index cf207d9dbbb..6d011bab079 100644
--- a/llvm/tools/gold/gold-plugin.cpp
+++ b/llvm/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<InputFile> Obj = std::move(*ObjOrErr);
- Modules.resize(Modules.size() + 1);
+ Modules.emplace_back();
claimed_file &cf = Modules.back();
cf.handle = file->handle;
OpenPOWER on IntegriCloud