From 5dd609206d74b56cb609df70eb5e01cec680d775 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 11 Dec 2013 10:57:36 +0000 Subject: [PATCH] [PECOFF] Add "const" qualifiers to BaseRelocChunk methods. Also removed unused field. llvm-svn: 197027 --- lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp index 04768ec1913f..aa750253f822 100644 --- a/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp +++ b/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp @@ -311,7 +311,7 @@ private: llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | llvm::COFF::IMAGE_SCN_MEM_DISCARDABLE; - std::vector createContents(ChunkVectorT &chunks); + std::vector createContents(ChunkVectorT &chunks) const; // Returns a list of RVAs that needs to be relocated if the binary is loaded // at an address different from its preferred one. @@ -322,9 +322,9 @@ private: // Create the content of a relocation block. std::vector - createBaseRelocBlock(uint64_t pageAddr, const std::vector &offsets); + createBaseRelocBlock(uint64_t pageAddr, + const std::vector &offsets) const; - mutable llvm::BumpPtrAllocator _alloc; std::vector _contents; }; @@ -676,7 +676,8 @@ void BaseRelocChunk::write(uint8_t *buffer) { /// the base relocation. A block consists of a 32 bit page RVA and 16 bit /// relocation entries which represent offsets in the page. That is a more /// compact representation than a simple vector of 32 bit RVAs. -std::vector BaseRelocChunk::createContents(ChunkVectorT &chunks) { +std::vector +BaseRelocChunk::createContents(ChunkVectorT &chunks) const { std::vector contents; std::vector relocSites = listRelocSites(chunks); PageOffsetT blocks = groupByPage(relocSites); @@ -711,9 +712,8 @@ BaseRelocChunk::groupByPage(const std::vector &relocSites) const { } // Create the content of a relocation block. -std::vector -BaseRelocChunk::createBaseRelocBlock(uint64_t pageAddr, - const std::vector &offsets) { +std::vector BaseRelocChunk::createBaseRelocBlock( + uint64_t pageAddr, const std::vector &offsets) const { // Relocation blocks should be padded with IMAGE_REL_I386_ABSOLUTE to be // aligned to a DWORD size boundary. uint32_t size = llvm::RoundUpToAlignment(