[lld] c74eb05 - [lld-macho][nfc] Clean up InputSection constructors

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 16:07:53 PDT 2021


Author: Jez Ng
Date: 2021-08-26T19:07:48-04:00
New Revision: c74eb05f21098b7ee2bea91fd68939db7633cbc4

URL: https://github.com/llvm/llvm-project/commit/c74eb05f21098b7ee2bea91fd68939db7633cbc4
DIFF: https://github.com/llvm/llvm-project/commit/c74eb05f21098b7ee2bea91fd68939db7633cbc4.diff

LOG: [lld-macho][nfc] Clean up InputSection constructors

Added: 
    

Modified: 
    lld/MachO/InputSection.h

Removed: 
    


################################################################################
diff  --git a/lld/MachO/InputSection.h b/lld/MachO/InputSection.h
index a10457087043..656407a55c4b 100644
--- a/lld/MachO/InputSection.h
+++ b/lld/MachO/InputSection.h
@@ -79,10 +79,6 @@ class InputSection {
           sectionKind(kind) {}
   };
 
-  InputSection(Kind kind, StringRef segname, StringRef name)
-      : callSiteCount(0), isFinal(false),
-        shared(make<Shared>(nullptr, name, segname, 0, kind)) {}
-
   InputSection(Kind kind, StringRef segname, StringRef name, InputFile *file,
                ArrayRef<uint8_t> data, uint32_t align, uint32_t flags)
       : align(align), callSiteCount(0), isFinal(false), data(data),
@@ -96,14 +92,16 @@ class InputSection {
 // contents merged before output.
 class ConcatInputSection final : public InputSection {
 public:
-  ConcatInputSection(StringRef segname, StringRef name)
-      : InputSection(ConcatKind, segname, name) {}
-
   ConcatInputSection(StringRef segname, StringRef name, InputFile *file,
                      ArrayRef<uint8_t> data, uint32_t align = 1,
                      uint32_t flags = 0)
       : InputSection(ConcatKind, segname, name, file, data, align, flags) {}
 
+  ConcatInputSection(StringRef segname, StringRef name)
+      : ConcatInputSection(segname, name, /*file=*/nullptr,
+                           /*data=*/{},
+                           /*align=*/1, /*flags=*/0) {}
+
   uint64_t getOffset(uint64_t off) const override { return outSecOff + off; }
   uint64_t getVA() const { return InputSection::getVA(0); }
   // ConcatInputSections are entirely live or dead, so the offset is irrelevant.


        


More information about the llvm-commits mailing list