[lld] r267212 - Move uintX_t typedef to the class definition. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 22 13:41:07 PDT 2016


Author: ruiu
Date: Fri Apr 22 15:41:07 2016
New Revision: 267212

URL: http://llvm.org/viewvc/llvm-project?rev=267212&view=rev
Log:
Move uintX_t typedef to the class definition. NFC.

Now it is doable because LinkerScript is a template class.

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

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=267212&r1=267211&r2=267212&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Fri Apr 22 15:41:07 2016
@@ -217,8 +217,6 @@ findSection(ArrayRef<OutputSectionBase<E
 template <class ELFT>
 void LinkerScript<ELFT>::assignAddresses(
     ArrayRef<OutputSectionBase<ELFT> *> Sections) {
-  typedef typename ELFT::uint uintX_t;
-
   // Orphan sections are sections present in the input files which
   // are not explicitly placed into the output file by the linker script.
   // We place orphan sections at end of file.

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=267212&r1=267211&r2=267212&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Fri Apr 22 15:41:07 2016
@@ -75,6 +75,8 @@ extern ScriptConfiguration *ScriptConfig
 
 // This is a runner of the linker script.
 template <class ELFT> class LinkerScript {
+  typedef typename ELFT::uint uintX_t;
+
 public:
   StringRef getOutputSection(InputSectionBase<ELFT> *S);
   ArrayRef<uint8_t> getFiller(StringRef Name);
@@ -94,7 +96,7 @@ private:
   uint64_t parsePrimary(ArrayRef<StringRef> &Tokens);
   uint64_t parseExpr1(ArrayRef<StringRef> &Tokens, uint64_t Lhs, int MinPrec);
   uint64_t parseTernary(ArrayRef<StringRef> &Tokens, uint64_t Cond);
-  typename ELFT::uint Dot;
+  uintX_t Dot;
 };
 
 // Variable template is a C++14 feature, so we can't template




More information about the llvm-commits mailing list