[lld] r308297 - [ELF] - Apply clang-format. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 04:55:35 PDT 2017


Author: grimar
Date: Tue Jul 18 04:55:35 2017
New Revision: 308297

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

Modified:
    lld/trunk/ELF/Arch/MipsArchTree.cpp
    lld/trunk/ELF/EhFrame.h
    lld/trunk/ELF/Filesystem.h
    lld/trunk/ELF/GdbIndex.h
    lld/trunk/ELF/ICF.h
    lld/trunk/ELF/InputFiles.h
    lld/trunk/ELF/LTO.h
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/MapFile.h
    lld/trunk/ELF/Memory.h
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.h
    lld/trunk/ELF/Relocations.cpp
    lld/trunk/ELF/Relocations.h
    lld/trunk/ELF/Strings.h
    lld/trunk/ELF/SymbolTable.cpp
    lld/trunk/ELF/SyntheticSections.cpp
    lld/trunk/ELF/Target.h
    lld/trunk/ELF/Threads.h
    lld/trunk/ELF/Thunks.cpp
    lld/trunk/ELF/Writer.cpp
    lld/trunk/ELF/Writer.h

Modified: lld/trunk/ELF/Arch/MipsArchTree.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/MipsArchTree.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/MipsArchTree.cpp (original)
+++ lld/trunk/ELF/Arch/MipsArchTree.cpp Tue Jul 18 04:55:35 2017
@@ -37,7 +37,7 @@ struct FileFlags {
   StringRef Filename;
   uint32_t Flags;
 };
-}
+} // namespace
 
 static StringRef getAbiName(uint32_t Flags) {
   switch (Flags) {
@@ -337,8 +337,8 @@ uint8_t elf::getMipsFpAbiFlag(uint8_t Ol
     return NewFlag;
   if (compareMipsFpAbi(OldFlag, NewFlag) < 0)
     error("target floating point ABI '" + getMipsFpAbiName(OldFlag) +
-          "' is incompatible with '" + getMipsFpAbiName(NewFlag) + "': " +
-          FileName);
+          "' is incompatible with '" + getMipsFpAbiName(NewFlag) +
+          "': " + FileName);
   return OldFlag;
 }
 

Modified: lld/trunk/ELF/EhFrame.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/EhFrame.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/EhFrame.h (original)
+++ lld/trunk/ELF/EhFrame.h Tue Jul 18 04:55:35 2017
@@ -19,7 +19,7 @@ struct EhSectionPiece;
 
 template <class ELFT> size_t readEhRecordSize(InputSectionBase *S, size_t Off);
 template <class ELFT> uint8_t getFdeEncoding(EhSectionPiece *P);
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/Filesystem.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Filesystem.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Filesystem.h (original)
+++ lld/trunk/ELF/Filesystem.h Tue Jul 18 04:55:35 2017
@@ -16,7 +16,7 @@ namespace lld {
 namespace elf {
 void unlinkAsync(StringRef Path);
 std::error_code tryCreateFile(StringRef Path);
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/GdbIndex.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/GdbIndex.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/GdbIndex.h (original)
+++ lld/trunk/ELF/GdbIndex.h Tue Jul 18 04:55:35 2017
@@ -11,8 +11,8 @@
 #define LLD_ELF_GDB_INDEX_H
 
 #include "InputFiles.h"
-#include "llvm/Object/ELF.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
+#include "llvm/Object/ELF.h"
 
 namespace lld {
 namespace elf {

Modified: lld/trunk/ELF/ICF.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ICF.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/ICF.h (original)
+++ lld/trunk/ELF/ICF.h Tue Jul 18 04:55:35 2017
@@ -14,6 +14,6 @@ namespace lld {
 namespace elf {
 template <class ELFT> void doIcf();
 }
-}
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Tue Jul 18 04:55:35 2017
@@ -11,8 +11,8 @@
 #define LLD_ELF_INPUT_FILES_H
 
 #include "Config.h"
-#include "InputSection.h"
 #include "Error.h"
+#include "InputSection.h"
 #include "Symbols.h"
 
 #include "lld/Core/LLVM.h"
@@ -34,7 +34,7 @@ struct DILineInfo;
 namespace lto {
 class InputFile;
 }
-}
+} // namespace llvm
 
 namespace lld {
 namespace elf {

Modified: lld/trunk/ELF/LTO.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.h (original)
+++ lld/trunk/ELF/LTO.h Tue Jul 18 04:55:35 2017
@@ -30,7 +30,7 @@ namespace llvm {
 namespace lto {
 class LTO;
 }
-}
+} // namespace llvm
 
 namespace lld {
 namespace elf {
@@ -51,7 +51,7 @@ private:
   std::vector<SmallString<0>> Buff;
   std::vector<std::unique_ptr<MemoryBuffer>> Files;
 };
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Jul 18 04:55:35 2017
@@ -462,7 +462,7 @@ void LinkerScript::fabricateDefaultComma
   // The Sections with -T<section> have been sorted in order of ascending
   // address. We must lower StartAddr if the lowest -T<section address> as
   // calls to setDot() must be monotonically increasing.
-  for (auto& KV : Config->SectionStartMap)
+  for (auto &KV : Config->SectionStartMap)
     StartAddr = std::min(StartAddr, KV.second);
 
   Commands.push_back(make<SymbolAssignment>(
@@ -752,7 +752,7 @@ void LinkerScript::adjustSectionsAfterSo
       Cmd->MemRegion = findMemoryRegion(Cmd);
       // Handle align (e.g. ".foo : ALIGN(16) { ... }").
       if (Cmd->AlignExpr)
-	Cmd->Sec->updateAlignment(Cmd->AlignExpr().getValue());
+        Cmd->Sec->updateAlignment(Cmd->AlignExpr().getValue());
     }
   }
 

Modified: lld/trunk/ELF/MapFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/MapFile.h (original)
+++ lld/trunk/ELF/MapFile.h Tue Jul 18 04:55:35 2017
@@ -17,7 +17,7 @@ namespace elf {
 struct OutputSectionCommand;
 template <class ELFT>
 void writeMapFile(llvm::ArrayRef<OutputSectionCommand *> Script);
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/Memory.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Memory.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Memory.h (original)
+++ lld/trunk/ELF/Memory.h Tue Jul 18 04:55:35 2017
@@ -61,7 +61,7 @@ inline void freeArena() {
     Alloc->reset();
   BAlloc.Reset();
 }
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Jul 18 04:55:35 2017
@@ -222,16 +222,16 @@ void OutputSectionFactory::addInputSec(I
 
   if (Sec) {
     if (getIncompatibleFlags(Sec->Flags) != getIncompatibleFlags(IS->Flags))
-      error("incompatible section flags for " + Sec->Name +
-            "\n>>> " + toString(IS) + ": 0x" + utohexstr(IS->Flags) +
+      error("incompatible section flags for " + Sec->Name + "\n>>> " +
+            toString(IS) + ": 0x" + utohexstr(IS->Flags) +
             "\n>>> output section " + Sec->Name + ": 0x" +
             utohexstr(Sec->Flags));
     if (Sec->Type != IS->Type) {
       if (canMergeToProgbits(Sec->Type) && canMergeToProgbits(IS->Type))
         Sec->Type = SHT_PROGBITS;
       else
-        error("section type mismatch for " + IS->Name +
-              "\n>>> " + toString(IS) + ": " +
+        error("section type mismatch for " + IS->Name + "\n>>> " +
+              toString(IS) + ": " +
               getELFSectionTypeName(Config->EMachine, IS->Type) +
               "\n>>> output section " + Sec->Name + ": " +
               getELFSectionTypeName(Config->EMachine, Sec->Type));

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Tue Jul 18 04:55:35 2017
@@ -111,8 +111,8 @@ struct SectionKey {
   uint64_t Flags;
   uint32_t Alignment;
 };
-}
-}
+} // namespace elf
+} // namespace lld
 namespace llvm {
 template <> struct DenseMapInfo<lld::elf::SectionKey> {
   static lld::elf::SectionKey getEmptyKey();
@@ -121,7 +121,7 @@ template <> struct DenseMapInfo<lld::elf
   static bool isEqual(const lld::elf::SectionKey &LHS,
                       const lld::elf::SectionKey &RHS);
 };
-}
+} // namespace llvm
 namespace lld {
 namespace elf {
 
@@ -150,5 +150,4 @@ extern std::vector<OutputSectionCommand
 } // namespace elf
 } // namespace lld
 
-
 #endif

Modified: lld/trunk/ELF/Relocations.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.cpp (original)
+++ lld/trunk/ELF/Relocations.cpp Tue Jul 18 04:55:35 2017
@@ -276,7 +276,7 @@ handleTlsRelocation(uint32_t Type, Symbo
     } else {
       C.Relocations.push_back(
           {Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_LE), Type,
-                Offset, Addend, &Body});
+           Offset, Addend, &Body});
     }
     return Target->TlsGdRelaxSkip;
   }
@@ -1028,7 +1028,7 @@ ThunkSection *ThunkCreator::getISThunkSe
   OutputSectionCommand *C = Script->getCmd(TOS);
   std::vector<InputSection *> *Range = nullptr;
   for (BaseCommand *BC : C->Commands)
-    if (auto *ISD = dyn_cast<InputSectionDescription> (BC)) {
+    if (auto *ISD = dyn_cast<InputSectionDescription>(BC)) {
       InputSection *first = ISD->Sections.front();
       InputSection *last = ISD->Sections.back();
       if (IS->OutSecOff >= first->OutSecOff &&
@@ -1050,7 +1050,6 @@ ThunkSection *ThunkCreator::addThunkSect
   return TS;
 }
 
-
 std::pair<Thunk *, bool> ThunkCreator::getThunk(SymbolBody &Body,
                                                 uint32_t Type) {
   auto Res = ThunkedSymbols.insert({&Body, std::vector<Thunk *>()});
@@ -1107,32 +1106,32 @@ bool ThunkCreator::createThunks(
   // We separate the creation of ThunkSections from the insertion of the
   // ThunkSections back into the OutputSection as ThunkSections are not always
   // inserted into the same OutputSection as the caller.
-  forEachExecInputSection(
-      OutputSections, [&](OutputSectionCommand *Cmd,
-                          std::vector<InputSection *> *ISR, InputSection *IS) {
-        for (Relocation &Rel : IS->Relocations) {
-          SymbolBody &Body = *Rel.Sym;
-          if (Thunks.find(&Body) != Thunks.end() ||
-              !Target->needsThunk(Rel.Expr, Rel.Type, IS->File, Body))
-            continue;
-          Thunk *T;
-          bool IsNew;
-          std::tie(T, IsNew) = getThunk(Body, Rel.Type);
-          if (IsNew) {
-            // Find or create a ThunkSection for the new Thunk
-            ThunkSection *TS;
-            if (auto *TIS = T->getTargetInputSection())
-              TS = getISThunkSec(TIS, Cmd->Sec);
-            else
-              TS = getOSThunkSec(Cmd, ISR);
-            TS->addThunk(T);
-            Thunks[T->ThunkSym] = T;
-          }
-          // Redirect relocation to Thunk, we never go via the PLT to a Thunk
-          Rel.Sym = T->ThunkSym;
-          Rel.Expr = fromPlt(Rel.Expr);
-        }
-      });
+  forEachExecInputSection(OutputSections, [&](OutputSectionCommand *Cmd,
+                                              std::vector<InputSection *> *ISR,
+                                              InputSection *IS) {
+    for (Relocation &Rel : IS->Relocations) {
+      SymbolBody &Body = *Rel.Sym;
+      if (Thunks.find(&Body) != Thunks.end() ||
+          !Target->needsThunk(Rel.Expr, Rel.Type, IS->File, Body))
+        continue;
+      Thunk *T;
+      bool IsNew;
+      std::tie(T, IsNew) = getThunk(Body, Rel.Type);
+      if (IsNew) {
+        // Find or create a ThunkSection for the new Thunk
+        ThunkSection *TS;
+        if (auto *TIS = T->getTargetInputSection())
+          TS = getISThunkSec(TIS, Cmd->Sec);
+        else
+          TS = getOSThunkSec(Cmd, ISR);
+        TS->addThunk(T);
+        Thunks[T->ThunkSym] = T;
+      }
+      // Redirect relocation to Thunk, we never go via the PLT to a Thunk
+      Rel.Sym = T->ThunkSym;
+      Rel.Expr = fromPlt(Rel.Expr);
+    }
+  });
   // Merge all created synthetic ThunkSections back into OutputSection
   mergeThunks();
   ++Pass;

Modified: lld/trunk/ELF/Relocations.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Relocations.h (original)
+++ lld/trunk/ELF/Relocations.h Tue Jul 18 04:55:35 2017
@@ -103,7 +103,8 @@ struct RelExprMaskBuilder<Head, Tail...>
 // RelExpr's as a constant bit mask and test for membership with a
 // couple cheap bitwise operations.
 template <RelExpr... Exprs> bool isRelExprOneOf(RelExpr Expr) {
-  assert(0 <= Expr && (int)Expr < 64 && "RelExpr is too large for 64-bit mask!");
+  assert(0 <= Expr && (int)Expr < 64 &&
+         "RelExpr is too large for 64-bit mask!");
   return (uint64_t(1) << Expr) & RelExprMaskBuilder<Exprs...>::build();
 }
 
@@ -178,7 +179,7 @@ template <class ELFT>
 static inline int64_t getAddend(const typename ELFT::Rela &Rel) {
   return Rel.r_addend;
 }
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/Strings.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Strings.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Strings.h (original)
+++ lld/trunk/ELF/Strings.h Tue Jul 18 04:55:35 2017
@@ -73,7 +73,7 @@ llvm::Optional<std::string> demangle(Str
 inline ArrayRef<uint8_t> toArrayRef(StringRef S) {
   return {(const uint8_t *)S.data(), S.size()};
 }
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Jul 18 04:55:35 2017
@@ -172,8 +172,8 @@ template <class ELFT> void SymbolTable<E
 }
 
 // Creates alias for symbol. Used to implement --defsym=ALIAS=SYM.
-template <class ELFT> void SymbolTable<ELFT>::addSymbolAlias(StringRef Alias,
-                                                             StringRef Name) {
+template <class ELFT>
+void SymbolTable<ELFT>::addSymbolAlias(StringRef Alias, StringRef Name) {
   SymbolBody *B = find(Name);
   if (!B) {
     error("-defsym: undefined symbol: " + Name);
@@ -393,9 +393,8 @@ static void warnOrError(const Twine &Msg
 }
 
 static void reportDuplicate(SymbolBody *Sym, InputFile *NewFile) {
-  warnOrError("duplicate symbol: " + toString(*Sym) +
-              "\n>>> defined in " + toString(Sym->File) +
-              "\n>>> defined in " + toString(NewFile));
+  warnOrError("duplicate symbol: " + toString(*Sym) + "\n>>> defined in " +
+              toString(Sym->File) + "\n>>> defined in " + toString(NewFile));
 }
 
 template <class ELFT>
@@ -673,7 +672,8 @@ template <class ELFT> void SymbolTable<E
 // Set symbol versions to symbols. This function handles patterns
 // containing no wildcard characters.
 template <class ELFT>
-void SymbolTable<ELFT>::assignExactVersion(SymbolVersion Ver, uint16_t VersionId,
+void SymbolTable<ELFT>::assignExactVersion(SymbolVersion Ver,
+                                           uint16_t VersionId,
                                            StringRef VersionName) {
   if (Ver.HasWildcard)
     return;

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue Jul 18 04:55:35 2017
@@ -817,9 +817,7 @@ unsigned MipsGotSection::getLocalEntries
          LocalEntries32.size();
 }
 
-void MipsGotSection::finalizeContents() {
-  updateAllocSize();
-}
+void MipsGotSection::finalizeContents() { updateAllocSize(); }
 
 void MipsGotSection::updateAllocSize() {
   PageEntriesNum = 0;
@@ -843,9 +841,7 @@ bool MipsGotSection::empty() const {
   return Config->Relocatable;
 }
 
-uint64_t MipsGotSection::getGp() const {
-  return ElfSym::MipsGp->getVA(0);
-}
+uint64_t MipsGotSection::getGp() const { return ElfSym::MipsGp->getVA(0); }
 
 static uint64_t readUint(uint8_t *Buf) {
   if (Config->Is64)
@@ -1614,7 +1610,7 @@ HashTableSection<ELFT>::HashTableSection
 template <class ELFT> void HashTableSection<ELFT>::finalizeContents() {
   getParent()->Link = InX::DynSymTab->getParent()->SectionIndex;
 
-  unsigned NumEntries = 2;                            // nbucket and nchain.
+  unsigned NumEntries = 2;                       // nbucket and nchain.
   NumEntries += InX::DynSymTab->getNumSymbols(); // The chain entries.
 
   // Create as many buckets as there are symbols.
@@ -1933,9 +1929,7 @@ void GdbIndexSection::writeTo(uint8_t *B
   StringPool.write(Buf);
 }
 
-bool GdbIndexSection::empty() const {
-  return !Out::DebugInfo;
-}
+bool GdbIndexSection::empty() const { return !Out::DebugInfo; }
 
 template <class ELFT>
 EhFrameHeader<ELFT>::EhFrameHeader()
@@ -2218,9 +2212,7 @@ void MergeSyntheticSection::finalizeCont
     finalizeNoTailMerge();
 }
 
-size_t MergeSyntheticSection::getSize() const {
-  return Builder.getSize();
-}
+size_t MergeSyntheticSection::getSize() const { return Builder.getSize(); }
 
 // This function decompresses compressed sections and scans over the input
 // sections to create mergeable synthetic sections. It removes

Modified: lld/trunk/ELF/Target.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Target.h (original)
+++ lld/trunk/ELF/Target.h Tue Jul 18 04:55:35 2017
@@ -157,6 +157,6 @@ static void checkAlignment(uint8_t *Loc,
           lld::toString(Type));
 }
 } // namespace elf
-}
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/Threads.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Threads.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Threads.h (original)
+++ lld/trunk/ELF/Threads.h Tue Jul 18 04:55:35 2017
@@ -82,7 +82,7 @@ inline void parallelForEachN(size_t Begi
   else
     for_each_n(llvm::parallel::seq, Begin, End, Fn);
 }
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif

Modified: lld/trunk/ELF/Thunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Thunks.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Thunks.cpp (original)
+++ lld/trunk/ELF/Thunks.cpp Tue Jul 18 04:55:35 2017
@@ -72,9 +72,7 @@ public:
 
 class ThumbV7ABSLongThunk final : public Thunk {
 public:
-  ThumbV7ABSLongThunk(const SymbolBody &Dest) : Thunk(Dest) {
-    alignment = 2;
-  }
+  ThumbV7ABSLongThunk(const SymbolBody &Dest) : Thunk(Dest) { alignment = 2; }
 
   uint32_t size() const override { return 10; }
   void writeTo(uint8_t *Buf, ThunkSection &IS) const override;
@@ -84,9 +82,7 @@ public:
 
 class ThumbV7PILongThunk final : public Thunk {
 public:
-  ThumbV7PILongThunk(const SymbolBody &Dest) : Thunk(Dest) {
-    alignment = 2;
-  }
+  ThumbV7PILongThunk(const SymbolBody &Dest) : Thunk(Dest) { alignment = 2; }
 
   uint32_t size() const override { return 12; }
   void writeTo(uint8_t *Buf, ThunkSection &IS) const override;
@@ -218,10 +214,10 @@ bool ThumbV7PILongThunk::isCompatibleWit
 // Write MIPS LA25 thunk code to call PIC function from the non-PIC one.
 void MipsThunk::writeTo(uint8_t *Buf, ThunkSection &) const {
   uint64_t S = Destination.getVA();
-  write32(Buf, 0x3c190000, Config->Endianness);                // lui   $25, %hi(func)
+  write32(Buf, 0x3c190000, Config->Endianness); // lui   $25, %hi(func)
   write32(Buf + 4, 0x08000000 | (S >> 2), Config->Endianness); // j     func
-  write32(Buf + 8, 0x27390000, Config->Endianness);            // addiu $25, $25, %lo(func)
-  write32(Buf + 12, 0x00000000, Config->Endianness);           // nop
+  write32(Buf + 8, 0x27390000, Config->Endianness); // addiu $25, $25, %lo(func)
+  write32(Buf + 12, 0x00000000, Config->Endianness); // nop
   Target->relocateOne(Buf, R_MIPS_HI16, S);
   Target->relocateOne(Buf + 8, R_MIPS_LO16, S);
 }
@@ -262,9 +258,7 @@ static Thunk *addThunkArm(uint32_t Reloc
   fatal("unrecognized relocation type");
 }
 
-static Thunk *addThunkMips(SymbolBody &S) {
-  return make<MipsThunk>(S);
-}
+static Thunk *addThunkMips(SymbolBody &S) { return make<MipsThunk>(S); }
 
 Thunk *addThunk(uint32_t RelocType, SymbolBody &S) {
   if (Config->EMachine == EM_ARM)

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Jul 18 04:55:35 2017
@@ -257,7 +257,6 @@ template <class ELFT> void Writer<ELFT>:
   if (ErrorCount)
     return;
 
-
   // Handle -Map option.
   writeMapFile<ELFT>(OutputSectionCommands);
   if (ErrorCount)
@@ -1392,7 +1391,8 @@ OutputSectionCommand *Writer<ELFT>::find
   return nullptr;
 }
 
-template <class ELFT> OutputSection *Writer<ELFT>::findSectionInScript(StringRef Name) {
+template <class ELFT>
+OutputSection *Writer<ELFT>::findSectionInScript(StringRef Name) {
   if (OutputSectionCommand *Cmd = findSectionCommand(Name))
     return Cmd->Sec;
   return nullptr;

Modified: lld/trunk/ELF/Writer.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.h?rev=308297&r1=308296&r2=308297&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.h (original)
+++ lld/trunk/ELF/Writer.h Tue Jul 18 04:55:35 2017
@@ -55,7 +55,7 @@ uint8_t getMipsFpAbiFlag(uint8_t OldFlag
                          llvm::StringRef FileName);
 
 bool isMipsN32Abi(const InputFile *F);
-}
-}
+} // namespace elf
+} // namespace lld
 
 #endif




More information about the llvm-commits mailing list