[lld] r284705 - [ELF] - Applied clang format. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 01:36:43 PDT 2016


Author: grimar
Date: Thu Oct 20 03:36:42 2016
New Revision: 284705

URL: http://llvm.org/viewvc/llvm-project?rev=284705&view=rev
Log:
[ELF] - Applied clang format. NFC.

Modified:
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/InputFiles.cpp
    lld/trunk/ELF/InputFiles.h
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/LTO.cpp
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/MarkLive.cpp
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.h
    lld/trunk/ELF/Relocations.cpp
    lld/trunk/ELF/SymbolTable.cpp
    lld/trunk/ELF/Symbols.h
    lld/trunk/ELF/Target.cpp
    lld/trunk/ELF/Writer.cpp
    lld/trunk/ELF/Writer.h

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Thu Oct 20 03:36:42 2016
@@ -235,8 +235,8 @@ static void checkOptions(opt::InputArgLi
   }
 }
 
-static StringRef
-getString(opt::InputArgList &Args, unsigned Key, StringRef Default = "") {
+static StringRef getString(opt::InputArgList &Args, unsigned Key,
+                           StringRef Default = "") {
   if (auto *Arg = Args.getLastArg(Key))
     return Arg->getValue();
   return Default;
@@ -265,8 +265,8 @@ static bool hasZOption(opt::InputArgList
   return false;
 }
 
-static uint64_t
-getZOptionValue(opt::InputArgList &Args, StringRef Key, uint64_t Default) {
+static uint64_t getZOptionValue(opt::InputArgList &Args, StringRef Key,
+                                uint64_t Default) {
   for (auto *Arg : Args.filtered(OPT_z)) {
     StringRef Value = Arg->getValue();
     size_t Pos = Value.find("=");

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Thu Oct 20 03:36:42 2016
@@ -718,7 +718,7 @@ static Symbol *createBitcodeSymbol(Dense
     if (!Keep)
       return Symtab<ELFT>::X->addUndefined(NameRef, Binding, Visibility, Type,
                                            CanOmitFromDynSym, F);
-}
+  }
 
   if (Flags & BasicSymbolRef::SF_Undefined)
     return Symtab<ELFT>::X->addUndefined(NameRef, Binding, Visibility, Type,

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Thu Oct 20 03:36:42 2016
@@ -162,7 +162,8 @@ public:
     return *SymbolBodies[SymbolIndex];
   }
 
-  template <typename RelT> SymbolBody &getRelocTargetSym(const RelT &Rel) const {
+  template <typename RelT>
+  SymbolBody &getRelocTargetSym(const RelT &Rel) const {
     uint32_t SymIndex = Rel.getSymbol(Config->Mips64EL);
     return getSymbolBody(SymIndex);
   }
@@ -260,8 +261,7 @@ class BitcodeFile : public InputFile {
 public:
   explicit BitcodeFile(MemoryBufferRef M);
   static bool classof(const InputFile *F) { return F->kind() == BitcodeKind; }
-  template <class ELFT>
-  void parse(llvm::DenseSet<StringRef> &ComdatGroups);
+  template <class ELFT> void parse(llvm::DenseSet<StringRef> &ComdatGroups);
   ArrayRef<Symbol *> getSymbols() { return Symbols; }
   std::unique_ptr<llvm::lto::InputFile> Obj;
 

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Thu Oct 20 03:36:42 2016
@@ -173,9 +173,8 @@ InputSectionBase<ELFT>::getOffset(const
   return getOffset(Sym.Value);
 }
 
-template<class ELFT>
-InputSectionBase<ELFT>*
-InputSectionBase<ELFT>::getLinkOrderDep() const {
+template <class ELFT>
+InputSectionBase<ELFT> *InputSectionBase<ELFT>::getLinkOrderDep() const {
   const Elf_Shdr *Hdr = getSectionHdr();
   if ((Hdr->sh_flags & SHF_LINK_ORDER) && Hdr->sh_link != 0)
     return getFile()->getSections()[Hdr->sh_link];
@@ -199,8 +198,7 @@ InputSectionBase<ELFT> *InputSection<ELF
   return Sections[this->Header->sh_info];
 }
 
-template <class ELFT>
-void InputSection<ELFT>::addThunk(const Thunk<ELFT> *T) {
+template <class ELFT> void InputSection<ELFT>::addThunk(const Thunk<ELFT> *T) {
   Thunks.push_back(T);
 }
 
@@ -452,7 +450,7 @@ void InputSectionBase<ELFT>::relocate(ui
       // Patch a nop (0x60000000) to a ld.
       if (BufLoc + 8 <= BufEnd && read32be(BufLoc + 4) == 0x60000000)
         write32be(BufLoc + 4, 0xe8410028); // ld %r2, 40(%r1)
-      // fallthrough
+    // fallthrough
     default:
       Target->relocateOne(BufLoc, Type, SymVA);
       break;
@@ -540,8 +538,7 @@ static unsigned getReloc(IntTy Begin, In
 
 // .eh_frame is a sequence of CIE or FDE records.
 // This function splits an input section into records and returns them.
-template <class ELFT>
-void EhInputSection<ELFT>::split() {
+template <class ELFT> void EhInputSection<ELFT>::split() {
   // Early exit if already split.
   if (!this->Pieces.empty())
     return;
@@ -705,7 +702,7 @@ typename ELFT::uint MergeInputSection<EL
 
 // Create a map from input offsets to output offsets for all section pieces.
 // It is called after finalize().
-template <class ELFT> void  MergeInputSection<ELFT>::finalizePieces() {
+template <class ELFT> void MergeInputSection<ELFT>::finalizePieces() {
   OffsetMap.reserve(this->Pieces.size());
   for (SectionPiece &Piece : this->Pieces) {
     if (!Piece.Live)

Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Thu Oct 20 03:36:42 2016
@@ -65,7 +65,7 @@ static std::unique_ptr<lto::LTO> createL
 
   if (Config->SaveTemps)
     checkError(Conf.addSaveTemps(std::string(Config->OutputFile) + ".",
-                            /*UseInputModulePath*/ true));
+                                 /*UseInputModulePath*/ true));
 
   lto::ThinBackend Backend;
   if (Config->ThinLtoJobs != -1u)

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Oct 20 03:36:42 2016
@@ -240,7 +240,7 @@ LinkerScript<ELFT>::createInputSectionLi
   }
 
   // After we created final list we should now set OutSec pointer to null,
-  // instead of -1. Otherwise we may get a crash when writing relocs, in 
+  // instead of -1. Otherwise we may get a crash when writing relocs, in
   // case section is discarded by linker script
   for (InputSectionBase<ELFT> *S : Ret)
     S->OutSec = nullptr;

Modified: lld/trunk/ELF/MarkLive.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MarkLive.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/MarkLive.cpp (original)
+++ lld/trunk/ELF/MarkLive.cpp Thu Oct 20 03:36:42 2016
@@ -44,8 +44,7 @@ using namespace lld::elf;
 namespace {
 // A resolved relocation. The Sec and Offset fields are set if the relocation
 // was resolved to an offset within a section.
-template <class ELFT>
-struct ResolvedReloc {
+template <class ELFT> struct ResolvedReloc {
   InputSectionBase<ELFT> *Sec;
   typename ELFT::uint Offset;
 };

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Thu Oct 20 03:36:42 2016
@@ -93,8 +93,7 @@ GotSection<ELFT>::GotSection()
   this->Header.sh_addralign = Target->GotEntrySize;
 }
 
-template <class ELFT>
-void GotSection<ELFT>::addEntry(SymbolBody &Sym) {
+template <class ELFT> void GotSection<ELFT>::addEntry(SymbolBody &Sym) {
   Sym.GotIndex = Entries.size();
   Entries.push_back(&Sym);
 }
@@ -294,7 +293,7 @@ template <class ELFT> void GotSection<EL
   auto AddEntry = [&](const MipsGotEntry &SA) {
     uint8_t *Entry = Buf;
     Buf += sizeof(uintX_t);
-    const SymbolBody* Body = SA.first;
+    const SymbolBody *Body = SA.first;
     uintX_t VA = Body->template getVA<ELFT>(SA.second);
     writeUint<ELFT>(Entry, VA);
   };
@@ -1396,8 +1395,7 @@ template <class ELFT> void SymbolTableSe
     S.Symbol->DynsymIndex = ++I;
 }
 
-template <class ELFT>
-void SymbolTableSection<ELFT>::addSymbol(SymbolBody *B) {
+template <class ELFT> void SymbolTableSection<ELFT>::addSymbol(SymbolBody *B) {
   Symbols.push_back({B, StrTabSec.addString(B->getName(), false)});
 }
 

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Thu Oct 20 03:36:42 2016
@@ -187,7 +187,7 @@ private:
   // GOT entries should have one-to-one mapping with dynamic symbols table.
   // But we use the same container's types for both kind of GOT entries
   // to handle them uniformly.
-  typedef std::pair<const SymbolBody*, uintX_t> MipsGotEntry;
+  typedef std::pair<const SymbolBody *, uintX_t> MipsGotEntry;
   typedef std::vector<MipsGotEntry> MipsGotEntries;
   llvm::DenseMap<MipsGotEntry, size_t> MipsGotMap;
   MipsGotEntries MipsLocal;
@@ -288,9 +288,7 @@ public:
   typename Base::Kind getKind() const override { return Base::SymTable; }
   static bool classof(const Base *B) { return B->getKind() == Base::SymTable; }
 
-  ArrayRef<SymbolTableEntry> getSymbols() const {
-    return Symbols;
-  }
+  ArrayRef<SymbolTableEntry> getSymbols() const { return Symbols; }
 
   unsigned NumLocals = 0;
   StringTableSection<ELFT> &StrTabSec;

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Thu Oct 20 03:36:42 2016
@@ -271,7 +271,7 @@ static int32_t findMipsPairedAddend(cons
            readSignedLo16<E>(Buf + RI->r_offset);
   }
   warn("can't find matching " + getRelName(Type) + " relocation for " +
-          getRelName(Rel->getType(Config->Mips64EL)));
+       getRelName(Rel->getType(Config->Mips64EL)));
   return 0;
 }
 
@@ -444,8 +444,8 @@ static RelExpr adjustExpr(const elf::Obj
   // the refered symbol can be preemepted to refer to the executable.
   if (Config->Shared || (Config->Pic && !isRelExpr(Expr))) {
     StringRef Name = getSymbolName(File, Body);
-    error("can't create dynamic relocation " + getRelName(Type) +
-          " against " + (Name.empty() ? "readonly segment" : "symbol " + Name));
+    error("can't create dynamic relocation " + getRelName(Type) + " against " +
+          (Name.empty() ? "readonly segment" : "symbol " + Name));
     return Expr;
   }
   if (Body.getVisibility() != STV_DEFAULT) {
@@ -578,7 +578,8 @@ static void scanRelocs(InputSectionBase<
     SymbolBody &Body = File.getRelocTargetSym(RI);
     uint32_t Type = RI.getType(Config->Mips64EL);
 
-    // We only report undefined symbols if they are referenced somewhere in the code.
+    // We only report undefined symbols if they are referenced somewhere in the
+    // code.
     if (!Body.isLocal() && Body.isUndefined() && !Body.symbol()->isWeak())
       reportUndefined(Body);
 

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Thu Oct 20 03:36:42 2016
@@ -246,8 +246,7 @@ SymbolTable<ELFT>::insert(StringRef &Nam
     S->IsUsedInRegularObj = true;
   if (!WasInserted && S->body()->Type != SymbolBody::UnknownType &&
       ((Type == STT_TLS) != S->body()->isTls()))
-    error("TLS attribute mismatch for symbol: " +
-          conflictMsg(S->body(), File));
+    error("TLS attribute mismatch for symbol: " + conflictMsg(S->body(), File));
 
   return {S, WasInserted};
 }

Modified: lld/trunk/ELF/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.h (original)
+++ lld/trunk/ELF/Symbols.h Thu Oct 20 03:36:42 2016
@@ -439,8 +439,7 @@ struct Symbol {
   llvm::AlignedCharArrayUnion<
       DefinedCommon, DefinedRegular<llvm::object::ELF64LE>,
       DefinedSynthetic<llvm::object::ELF64LE>, Undefined,
-      SharedSymbol<llvm::object::ELF64LE>, LazyArchive, LazyObject>
-      Body;
+      SharedSymbol<llvm::object::ELF64LE>, LazyArchive, LazyObject> Body;
 
   SymbolBody *body() { return reinterpret_cast<SymbolBody *>(Body.buffer); }
   const SymbolBody *body() const { return const_cast<Symbol *>(this)->body(); }

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Thu Oct 20 03:36:42 2016
@@ -185,8 +185,7 @@ public:
   void writePltHeader(uint8_t *Buf) const override;
   void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
                 int32_t Index, unsigned RelOff) const override;
-  RelExpr getThunkExpr(RelExpr Expr, uint32_t RelocType,
-                       const InputFile &File,
+  RelExpr getThunkExpr(RelExpr Expr, uint32_t RelocType, const InputFile &File,
                        const SymbolBody &S) const override;
   void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override;
 };
@@ -203,8 +202,7 @@ public:
   void writePltHeader(uint8_t *Buf) const override;
   void writePlt(uint8_t *Buf, uint64_t GotEntryAddr, uint64_t PltEntryAddr,
                 int32_t Index, unsigned RelOff) const override;
-  RelExpr getThunkExpr(RelExpr Expr, uint32_t RelocType,
-                       const InputFile &File,
+  RelExpr getThunkExpr(RelExpr Expr, uint32_t RelocType, const InputFile &File,
                        const SymbolBody &S) const override;
   void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override;
   bool usesOnlyLowPageBits(uint32_t Type) const override;
@@ -266,9 +264,7 @@ bool TargetInfo::isTlsInitialExecRel(uin
 
 bool TargetInfo::isTlsLocalDynamicRel(uint32_t Type) const { return false; }
 
-bool TargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const {
-  return false;
-}
+bool TargetInfo::isTlsGlobalDynamicRel(uint32_t Type) const { return false; }
 
 RelExpr TargetInfo::adjustRelaxExpr(uint32_t Type, const uint8_t *Data,
                                     RelExpr Expr) const {
@@ -1046,26 +1042,33 @@ void PPC64TargetInfo::writePlt(uint8_t *
   // be a pointer to the function descriptor in the .opd section. Using
   // this scheme is simpler, but requires an extra indirection per PLT dispatch.
 
-  write32be(Buf,      0xf8410028);                   // std %r2, 40(%r1)
-  write32be(Buf + 4,  0x3d620000 | applyPPCHa(Off)); // addis %r11, %r2, X at ha
-  write32be(Buf + 8,  0xe98b0000 | applyPPCLo(Off)); // ld %r12, X at l(%r11)
-  write32be(Buf + 12, 0xe96c0000);                   // ld %r11,0(%r12)
-  write32be(Buf + 16, 0x7d6903a6);                   // mtctr %r11
-  write32be(Buf + 20, 0xe84c0008);                   // ld %r2,8(%r12)
-  write32be(Buf + 24, 0xe96c0010);                   // ld %r11,16(%r12)
-  write32be(Buf + 28, 0x4e800420);                   // bctr
+  write32be(Buf, 0xf8410028);                       // std %r2, 40(%r1)
+  write32be(Buf + 4, 0x3d620000 | applyPPCHa(Off)); // addis %r11, %r2, X at ha
+  write32be(Buf + 8, 0xe98b0000 | applyPPCLo(Off)); // ld %r12, X at l(%r11)
+  write32be(Buf + 12, 0xe96c0000);                  // ld %r11,0(%r12)
+  write32be(Buf + 16, 0x7d6903a6);                  // mtctr %r11
+  write32be(Buf + 20, 0xe84c0008);                  // ld %r2,8(%r12)
+  write32be(Buf + 24, 0xe96c0010);                  // ld %r11,16(%r12)
+  write32be(Buf + 28, 0x4e800420);                  // bctr
 }
 
 static std::pair<uint32_t, uint64_t> toAddr16Rel(uint32_t Type, uint64_t Val) {
   uint64_t V = Val - PPC64TocOffset;
   switch (Type) {
-  case R_PPC64_TOC16: return {R_PPC64_ADDR16, V};
-  case R_PPC64_TOC16_DS: return {R_PPC64_ADDR16_DS, V};
-  case R_PPC64_TOC16_HA: return {R_PPC64_ADDR16_HA, V};
-  case R_PPC64_TOC16_HI: return {R_PPC64_ADDR16_HI, V};
-  case R_PPC64_TOC16_LO: return {R_PPC64_ADDR16_LO, V};
-  case R_PPC64_TOC16_LO_DS: return {R_PPC64_ADDR16_LO_DS, V};
-  default: return {Type, Val};
+  case R_PPC64_TOC16:
+    return {R_PPC64_ADDR16, V};
+  case R_PPC64_TOC16_DS:
+    return {R_PPC64_ADDR16_DS, V};
+  case R_PPC64_TOC16_HA:
+    return {R_PPC64_ADDR16_HA, V};
+  case R_PPC64_TOC16_HI:
+    return {R_PPC64_ADDR16_HI, V};
+  case R_PPC64_TOC16_LO:
+    return {R_PPC64_ADDR16_LO, V};
+  case R_PPC64_TOC16_LO_DS:
+    return {R_PPC64_ADDR16_LO_DS, V};
+  default:
+    return {Type, Val};
   }
 }
 
@@ -1694,7 +1697,7 @@ void ARMTargetInfo::relocateOne(uint8_t
       // BLX (always unconditional) instruction to an ARM Target, select an
       // unconditional BL.
       write32le(Loc, 0xeb000000 | (read32le(Loc) & 0x00ffffff));
-    // fall through as BL encoding is shared with B
+  // fall through as BL encoding is shared with B
   case R_ARM_JUMP24:
   case R_ARM_PC24:
   case R_ARM_PLT32:
@@ -1728,7 +1731,7 @@ void ARMTargetInfo::relocateOne(uint8_t
     }
     // Bit 12 is 0 for BLX, 1 for BL
     write16le(Loc + 2, (read16le(Loc + 2) & ~0x1000) | (Val & 1) << 12);
-    // Fall through as rest of encoding is the same as B.W
+  // Fall through as rest of encoding is the same as B.W
   case R_ARM_THM_JUMP24:
     // Encoding B  T4, BL T1, BLX T2: Val = S:I1:I2:imm10:imm11:0
     // FIXME: Use of I1 and I2 require v6T2ops
@@ -1990,29 +1993,25 @@ static void applyMipsPcReloc(uint8_t *Lo
   write32<E>(Loc, (Instr & ~Mask) | ((V >> SHIFT) & Mask));
 }
 
-template <endianness E>
-static void writeMipsHi16(uint8_t *Loc, uint64_t V) {
+template <endianness E> static void writeMipsHi16(uint8_t *Loc, uint64_t V) {
   uint32_t Instr = read32<E>(Loc);
   uint16_t Res = ((V + 0x8000) >> 16) & 0xffff;
   write32<E>(Loc, (Instr & 0xffff0000) | Res);
 }
 
-template <endianness E>
-static void writeMipsHigher(uint8_t *Loc, uint64_t V) {
+template <endianness E> static void writeMipsHigher(uint8_t *Loc, uint64_t V) {
   uint32_t Instr = read32<E>(Loc);
   uint16_t Res = ((V + 0x80008000) >> 32) & 0xffff;
   write32<E>(Loc, (Instr & 0xffff0000) | Res);
 }
 
-template <endianness E>
-static void writeMipsHighest(uint8_t *Loc, uint64_t V) {
+template <endianness E> static void writeMipsHighest(uint8_t *Loc, uint64_t V) {
   uint32_t Instr = read32<E>(Loc);
   uint16_t Res = ((V + 0x800080008000) >> 48) & 0xffff;
   write32<E>(Loc, (Instr & 0xffff0000) | Res);
 }
 
-template <endianness E>
-static void writeMipsLo16(uint8_t *Loc, uint64_t V) {
+template <endianness E> static void writeMipsLo16(uint8_t *Loc, uint64_t V) {
   uint32_t Instr = read32<E>(Loc);
   write32<E>(Loc, (Instr & 0xffff0000) | (V & 0xffff));
 }
@@ -2045,9 +2044,9 @@ void MipsTargetInfo<ELFT>::writePlt(uint
                                     uint64_t PltEntryAddr, int32_t Index,
                                     unsigned RelOff) const {
   const endianness E = ELFT::TargetEndianness;
-  write32<E>(Buf, 0x3c0f0000);      // lui   $15, %hi(.got.plt entry)
-  write32<E>(Buf + 4, 0x8df90000);  // l[wd] $25, %lo(.got.plt entry)($15)
-                                    // jr    $25
+  write32<E>(Buf, 0x3c0f0000);     // lui   $15, %hi(.got.plt entry)
+  write32<E>(Buf + 4, 0x8df90000); // l[wd] $25, %lo(.got.plt entry)($15)
+                                   // jr    $25
   write32<E>(Buf + 8, isMipsR6<ELFT>() ? 0x03200009 : 0x03200008);
   write32<E>(Buf + 12, 0x25f80000); // addiu $24, $15, %lo(.got.plt entry)
   writeMipsHi16<E>(Buf, GotEntryAddr);

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Oct 20 03:36:42 2016
@@ -51,9 +51,8 @@ private:
   void copyLocalSymbols();
   void addReservedSymbols();
   void createSections();
-  void forEachRelSec(
-      std::function<void(InputSectionBase<ELFT> &, const typename ELFT::Shdr &)>
-          Fn);
+  void forEachRelSec(std::function<void(InputSectionBase<ELFT> &,
+                                        const typename ELFT::Shdr &)> Fn);
   void sortSections();
   void finalizeSections();
   void addPredefinedSections();
@@ -529,14 +528,13 @@ template <class ELFT> static bool isDisc
 }
 
 // Program header entry
-template<class ELFT>
+template <class ELFT>
 PhdrEntry<ELFT>::PhdrEntry(unsigned Type, unsigned Flags) {
   H.p_type = Type;
   H.p_flags = Flags;
 }
 
-template<class ELFT>
-void PhdrEntry<ELFT>::add(OutputSectionBase<ELFT> *Sec) {
+template <class ELFT> void PhdrEntry<ELFT>::add(OutputSectionBase<ELFT> *Sec) {
   Last = Sec;
   if (!First)
     First = Sec;
@@ -1012,8 +1010,7 @@ static typename ELFT::uint computeFlags(
 
 // Decide which program headers to create and which sections to include in each
 // one.
-template <class ELFT>
-std::vector<PhdrEntry<ELFT>> Writer<ELFT>::createPhdrs() {
+template <class ELFT> std::vector<PhdrEntry<ELFT>> Writer<ELFT>::createPhdrs() {
   std::vector<Phdr> Ret;
   auto AddHdr = [&](unsigned Type, unsigned Flags) -> Phdr * {
     Ret.emplace_back(Type, Flags);

Modified: lld/trunk/ELF/Writer.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.h?rev=284705&r1=284704&r2=284705&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.h (original)
+++ lld/trunk/ELF/Writer.h Thu Oct 20 03:36:42 2016
@@ -28,8 +28,7 @@ template <class ELFT> bool isRelroSectio
 // This describes a program header entry.
 // Each contains type, access flags and range of output sections that will be
 // placed in it.
-template<class ELFT>
-struct PhdrEntry {
+template <class ELFT> struct PhdrEntry {
   PhdrEntry(unsigned Type, unsigned Flags);
   void add(OutputSectionBase<ELFT> *Sec);
 




More information about the llvm-commits mailing list