[lld] [lld-macho][NFC] Refactor ObjCSelRefsSection out of ObjCStubsSection (PR #83878)

Kyungwoo Lee via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 17:18:27 PST 2024


================
@@ -315,6 +315,25 @@ class StubHelperSection final : public SyntheticSection {
   Defined *dyldPrivate = nullptr;
 };
 
+class ObjCSelRefsSection final : public SyntheticSection {
+public:
+  ObjCSelRefsSection();
+  void initialize();
+
+  // This SyntheticSection does not do its own writing, but instead uses the
+  // creates SyntheticInputSection's and inserts them into inputSections
+  uint64_t getSize() const override { return 0; }
+  bool isNeeded() const override { return false; }
+  void writeTo(uint8_t *buf) const override {}
+
+  ConcatInputSection *getSelRefForMethName(StringRef methName);
+  ConcatInputSection *makeSelRef(StringRef methName);
----------------
kyulee-com wrote:

Okay. To make these more consistent, you can also shorten `getSelRefForMethName` into `getSelRef`.

https://github.com/llvm/llvm-project/pull/83878


More information about the llvm-commits mailing list