[lld] [lld-macho] icf objc stubs (PR #79730)

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 16:51:18 PST 2024


================
@@ -332,10 +333,17 @@ class ObjCStubsSection final : public SyntheticSection {
   void setUp();
 
   static constexpr llvm::StringLiteral symbolPrefix = "_objc_msgSend$";
+  static bool isObjCStubSymbol(Symbol *sym);
+  static StringRef getMethName(Symbol *sym);
 
 private:
   std::vector<Defined *> symbols;
-  std::vector<uint32_t> offsets;
+  // Existing mapping from methname to selref (0 index is assumed).
+  llvm::StringMap<InputSection *> methnameToselref;
+  // Newly created mapping from methname to the pair of index (selref) and
+  // offset (methname).
+  llvm::MapVector<StringRef, std::pair<uint32_t, uint32_t>>
+      methnameToidxOffsetPair;
----------------
int3 wrote:

This can also be a `CachedHashStringRef` key

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


More information about the llvm-commits mailing list