[lld] r313588 - Rename EhSectionPiece::ID -> EhSectionPiece::Sec.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 16:07:33 PDT 2017


Author: ruiu
Date: Mon Sep 18 16:07:33 2017
New Revision: 313588

URL: http://llvm.org/viewvc/llvm-project?rev=313588&view=rev
Log:
Rename EhSectionPiece::ID -> EhSectionPiece::Sec.

ID sounds like an identifier, but this is actually a pointer to a section.

Modified:
    lld/trunk/ELF/EhFrame.cpp
    lld/trunk/ELF/InputSection.h
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/EhFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/EhFrame.cpp?rev=313588&r1=313587&r2=313588&view=diff
==============================================================================
--- lld/trunk/ELF/EhFrame.cpp (original)
+++ lld/trunk/ELF/EhFrame.cpp Mon Sep 18 16:07:33 2017
@@ -154,8 +154,7 @@ template <class ELFT> void EhReader<ELFT
 }
 
 template <class ELFT> uint8_t elf::getFdeEncoding(EhSectionPiece *P) {
-  auto *IS = static_cast<InputSectionBase *>(P->ID);
-  return EhReader<ELFT>(IS, P->data()).getFdeEncoding();
+  return EhReader<ELFT>(P->Sec, P->data()).getFdeEncoding();
 }
 
 template <class ELFT> uint8_t EhReader<ELFT>::getFdeEncoding() {

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=313588&r1=313587&r2=313588&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Mon Sep 18 16:07:33 2017
@@ -262,16 +262,15 @@ private:
 };
 
 struct EhSectionPiece {
-  EhSectionPiece(size_t Off, InputSectionBase *ID, uint32_t Size,
+  EhSectionPiece(size_t Off, InputSectionBase *Sec, uint32_t Size,
                  unsigned FirstRelocation)
-      : InputOff(Off), ID(ID), Size(Size),
-        FirstRelocation(FirstRelocation) {}
+      : InputOff(Off), Sec(Sec), Size(Size), FirstRelocation(FirstRelocation) {}
 
-  ArrayRef<uint8_t> data() { return {ID->Data.data() + this->InputOff, Size}; }
+  ArrayRef<uint8_t> data() { return {Sec->Data.data() + this->InputOff, Size}; }
 
   size_t InputOff;
   ssize_t OutputOff = -1;
-  InputSectionBase *ID;
+  InputSectionBase *Sec;
   uint32_t Size;
   unsigned FirstRelocation;
 };

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=313588&r1=313587&r2=313588&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Mon Sep 18 16:07:33 2017
@@ -405,7 +405,7 @@ template <class ELFT>
 template <class RelTy>
 CieRecord *EhFrameSection<ELFT>::addCie(EhSectionPiece &Piece,
                                         ArrayRef<RelTy> Rels) {
-  auto *Sec = cast<EhInputSection>(Piece.ID);
+  auto *Sec = cast<EhInputSection>(Piece.Sec);
   const endianness E = ELFT::TargetEndianness;
   if (read32<E>(Piece.data().data() + 4) != 0)
     fatal(toString(Sec) + ": CIE expected at beginning of .eh_frame");
@@ -433,7 +433,7 @@ template <class ELFT>
 template <class RelTy>
 bool EhFrameSection<ELFT>::isFdeLive(EhSectionPiece &Piece,
                                      ArrayRef<RelTy> Rels) {
-  auto *Sec = cast<EhInputSection>(Piece.ID);
+  auto *Sec = cast<EhInputSection>(Piece.Sec);
   unsigned FirstRelI = Piece.FirstRelocation;
 
   // An FDE should point to some function because FDEs are to describe




More information about the llvm-commits mailing list