Remove const call to take_front

Summary:
take_front() is a const member of StringRef. Calling it does nothing.
This suggests that this line of code is useless, deleting it.
But it's good to double check, what was the original intention here?

(cherry picked from FBD21697637)
This commit is contained in:
Xun Li 2020-05-21 16:25:05 -07:00 committed by Maksim Panchenko
parent 8729171182
commit 8a680745dd
2 changed files with 2 additions and 1 deletions

View File

@ -272,6 +272,7 @@ public:
return reinterpret_cast<const uint8_t *>(getContents().data());
}
StringRef getContents() const { return Contents; }
void clearContents() { Contents = {}; }
bool hasSectionRef() const { return Section != SectionRef(); }
SectionRef getSectionRef() const { return Section; }

View File

@ -2580,7 +2580,7 @@ void RewriteInstance::emitAndLink() {
if (BC->HasRelocations) {
// The section is going to be regenerated from scratch.
// Empty the contents, but keep the section reference.
EHFrameSection->getContents().take_front(0);
EHFrameSection->clearContents();
} else {
// Make .eh_frame relocatable.
relocateEHFrameSection();