[lld] r296686 - Inline a function that is too short to be an independent function.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 1 14:02:17 PST 2017


Author: ruiu
Date: Wed Mar  1 16:02:17 2017
New Revision: 296686

URL: http://llvm.org/viewvc/llvm-project?rev=296686&view=rev
Log:
Inline a function that is too short to be an independent function.

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

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=296686&r1=296685&r2=296686&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Mar  1 16:02:17 2017
@@ -1692,13 +1692,6 @@ GdbIndexSection<ELFT>::GdbIndexSection()
     : SyntheticSection(0, SHT_PROGBITS, 1, ".gdb_index"),
       StringPool(llvm::StringTableBuilder::ELF) {}
 
-template <class ELFT> void GdbIndexSection<ELFT>::parseDebugSections() {
-  for (InputSectionBase *S : InputSections)
-    if (InputSection *IS = dyn_cast<InputSection>(S))
-      if (IS->OutSec && IS->Name == ".debug_info")
-        readDwarf(IS);
-}
-
 // Iterative hash function for symbol's name is described in .gdb_index format
 // specification. Note that we use one for version 5 to 7 here, it is different
 // for version 4.
@@ -1709,8 +1702,8 @@ static uint32_t hash(StringRef Str) {
   return R;
 }
 
-template <class ELFT> void GdbIndexSection<ELFT>::readDwarf(InputSection *I) {
-  GdbIndexBuilder<ELFT> Builder(I);
+template <class ELFT> void GdbIndexSection<ELFT>::readDwarf(InputSection *Sec) {
+  GdbIndexBuilder<ELFT> Builder(Sec);
   if (ErrorCount)
     return;
 
@@ -1748,7 +1741,11 @@ template <class ELFT> void GdbIndexSecti
     return;
   Finalized = true;
 
-  parseDebugSections();
+  for (InputSectionBase *S : InputSections)
+    if (InputSection *IS = dyn_cast<InputSection>(S))
+      if (IS->OutSec && IS->Name == ".debug_info")
+        readDwarf(IS);
+
   SymbolTable.finalizeContents();
 
   // GdbIndex header consist from version fields

Modified: lld/trunk/ELF/SyntheticSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=296686&r1=296685&r2=296686&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.h (original)
+++ lld/trunk/ELF/SyntheticSections.h Wed Mar  1 16:02:17 2017
@@ -524,8 +524,7 @@ public:
   std::vector<AddressEntry<ELFT>> AddressArea;
 
 private:
-  void parseDebugSections();
-  void readDwarf(InputSection *I);
+  void readDwarf(InputSection *Sec);
 
   uint32_t CuTypesOffset;
   uint32_t SymTabOffset;




More information about the llvm-commits mailing list