summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-09-14 06:08:51 +0000
committerMartin Storsjo <martin@martin.st>2018-09-14 06:08:51 +0000
commit4c201a8ba56984608ce6d9b76692799972116237 (patch)
treebc049953a01a401a6e646567734b7128db992757
parentf08a9c700bcf1f7096a471ba521b030318582e4b (diff)
downloadbcm5719-llvm-4c201a8ba56984608ce6d9b76692799972116237.tar.gz
bcm5719-llvm-4c201a8ba56984608ce6d9b76692799972116237.zip
[COFF] Avoid copying of chunk vectors. NFC.
When declaring the pair variable as "auto Pair : Map", it is effectively declared as std::pair<std::pair<StringRef, uint32_t>, std::vector<Chunk *>>. This effectively does a full, shallow copy of the Chunk vector, just to be thrown away after each iteration. Differential Revision: https://reviews.llvm.org/D52051 llvm-svn: 342205
-rw-r--r--lld/COFF/Writer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 9d69b385823..17334b1a543 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -469,7 +469,7 @@ void Writer::createSections() {
// '$' and all following characters in input section names are
// discarded when determining output section. So, .text$foo
// contributes to .text, for example. See PE/COFF spec 3.2.
- for (auto Pair : Map) {
+ for (auto &Pair : Map) {
StringRef Name = getOutputSectionName(Pair.first.first);
uint32_t OutChars = Pair.first.second;
OpenPOWER on IntegriCloud