From: Rui Ueyama Date: Tue, 22 Nov 2016 01:10:34 +0000 (+0000) Subject: Remove a parameter from getOutputLoc and rename for readability. NFC. X-Git-Tag: llvmorg-4.0.0-rc1~3948 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee18d957643180e201ecfe5277b068db43090e2d;p=platform%2Fupstream%2Fllvm.git Remove a parameter from getOutputLoc and rename for readability. NFC. llvm-svn: 287605 --- diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index e563dd3..75821d5 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -261,9 +261,8 @@ BuildIdSection::BuildIdSection() } // Returns the location of the build-id hash value in the output. -template -uint8_t *BuildIdSection::getOutputLoc(uint8_t *Start) { - return Start + this->OutSec->Offset + this->OutSecOff + HeaderSize; +template size_t BuildIdSection::getOutputOffset() { + return this->OutSec->Offset + this->OutSecOff + HeaderSize; } template size_t BuildIdSection::getHashSize() { @@ -316,7 +315,7 @@ void BuildIdSection::computeHash( else std::for_each(Chunks.begin(), Chunks.end(), Fn); - HashFn(HashList, getOutputLoc(Data.begin())); + HashFn(HashList, Data.data() + getOutputOffset()); } template @@ -344,11 +343,11 @@ void BuildIdSection::writeBuildId(MutableArrayRef Buf) { }); break; case BuildIdKind::Uuid: - if (getRandomBytes(getOutputLoc(Buf.data()), HashSize)) + if (getRandomBytes(Buf.data() + getOutputOffset(), HashSize)) error("entropy source failure"); break; case BuildIdKind::Hexstring: - memcpy(this->getOutputLoc(Buf.data()), Config->BuildIdVector.data(), + memcpy(Buf.data() + getOutputOffset(), Config->BuildIdVector.data(), Config->BuildIdVector.size()); break; default: diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index e305ee8..60f8811 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -97,7 +97,7 @@ private: static const unsigned HeaderSize = 16; size_t getHashSize(); - uint8_t *getOutputLoc(uint8_t *Start); + size_t getOutputOffset(); void computeHash(llvm::MutableArrayRef Buf,