ELF2: Move Writer class to the top of the file. NFC.

llvm-svn: 251195
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 640d963..66c8e09 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -26,16 +26,6 @@
 using namespace lld::elf2;
 
 namespace {
-
-static uint32_t toPhdrFlags(uint64_t Flags) {
-  uint32_t Ret = PF_R;
-  if (Flags & SHF_WRITE)
-    Ret |= PF_W;
-  if (Flags & SHF_EXECINSTR)
-    Ret |= PF_X;
-  return Ret;
-}
-
 // The writer writes a SymbolTable result to a file.
 template <class ELFT> class Writer {
 public:
@@ -612,6 +602,15 @@
   return Sec->getFlags() & SHF_ALLOC;
 }
 
+static uint32_t toPhdrFlags(uint64_t Flags) {
+  uint32_t Ret = PF_R;
+  if (Flags & SHF_WRITE)
+    Ret |= PF_W;
+  if (Flags & SHF_EXECINSTR)
+    Ret |= PF_X;
+  return Ret;
+}
+
 // Visits all sections to create PHDRs and to assign incremental,
 // non-overlapping addresses to output sections.
 template <class ELFT> void Writer<ELFT>::assignAddresses() {