From eb1e1ace85348e0b259635c24ddceac0d757361f Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Mon, 15 Jul 2013 22:20:10 +0000 Subject: [PATCH] [PECOFF][Writer] Follow up patch for r186336. - Make a const reference instead of copying an object - Fix a comment llvm-svn: 186355 --- lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp index d0a95cd8..8f4e6ea 100644 --- a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp @@ -612,13 +612,13 @@ public: PageOffsetT blocks = groupByPage(relocSites); for (auto &i : blocks) { uint64_t pageAddr = i.first; - std::vector offsetsInPage = i.second; + const std::vector &offsetsInPage = i.second; appendAtom(createBaseRelocBlock(_file, pageAddr, offsetsInPage)); } } private: - // When loaded into memory, data section should be readable and writable. + // When loaded into memory, reloc section should be readable and writable. static const uint32_t characteristics = llvm::COFF::IMAGE_SCN_MEM_READ | llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA; @@ -644,7 +644,7 @@ private: // Create the content of a relocation block. DefinedAtom *createBaseRelocBlock(const File &file, uint64_t pageAddr, - std::vector &offsets) { + const std::vector &offsets) { uint32_t size = 8 + offsets.size() * 2; std::vector contents(size); -- 2.7.4