[PECOFF][Writer] Follow up patch for r186336.

- Make a const reference instead of copying an object
- Fix a comment

llvm-svn: 186355
This commit is contained in:
Rui Ueyama 2013-07-15 22:20:10 +00:00
parent 54b71fdee2
commit eb1e1ace85
1 changed files with 3 additions and 3 deletions

View File

@ -612,13 +612,13 @@ public:
PageOffsetT blocks = groupByPage(relocSites);
for (auto &i : blocks) {
uint64_t pageAddr = i.first;
std::vector<uint16_t> offsetsInPage = i.second;
const std::vector<uint16_t> &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<uint16_t> &offsets) {
const std::vector<uint16_t> &offsets) {
uint32_t size = 8 + offsets.size() * 2;
std::vector<uint8_t> contents(size);