[NFC] Optimize vector usage in lld
By using emplace_back, as well as converting some loops to for-each, we can do more efficient vectorization.
Make copy constructor for TemporaryFile noexcept.
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D139552
diff --git a/lld/COFF/Chunks.cpp b/lld/COFF/Chunks.cpp
index 65de868..7ec4829 100644
--- a/lld/COFF/Chunks.cpp
+++ b/lld/COFF/Chunks.cpp
@@ -658,8 +658,7 @@
}
// sizeInBits is used to initialize the Flags field; currently no
// other flags are defined.
- res.emplace_back(
- RuntimePseudoReloc(target, this, rel.VirtualAddress, sizeInBits));
+ res.emplace_back(target, this, rel.VirtualAddress, sizeInBits);
}
}