[llvm] [llvm-symbolizer] Recognize AIX big archive (PR #150401)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 23:45:53 PST 2025


================
@@ -216,15 +224,41 @@ class LLVMSymbolizer {
   /// Contains parsed binary for each path, or parsing error.
   std::map<std::string, CachedBinary, std::less<>> BinaryForPath;
 
+  /// Store the archive path for the object file
+  std::unordered_map<const object::ObjectFile *, std::string>
+      ObjectToArchivePath;
+
   /// A list of cached binaries in LRU order.
   simple_ilist<CachedBinary> LRUBinaries;
   /// Sum of the sizes of the cached binaries.
   size_t CacheSize = 0;
 
-  /// Parsed object file for path/architecture pair, where "path" refers
-  /// to Mach-O universal binary.
-  std::map<std::pair<std::string, std::string>, std::unique_ptr<ObjectFile>>
-      ObjectForUBPathAndArch;
+  struct ContainerCacheKey {
+    std::string Path;
+    std::string MemberName;
+    std::string ArchName;
+
+    // Required for map comparison.
+    bool operator<(const ContainerCacheKey &Other) const {
+      return std::tie(Path, MemberName, ArchName) <
+             std::tie(Other.Path, Other.MemberName, Other.ArchName);
+    }
+  };
+
+  /// Parsed object file for path/object/architecture pair, where
+  /// "path" refers to Mach-O universal binary.
+  std::map<ContainerCacheKey, std::unique_ptr<ObjectFile>> ObjectFileCache;
+
+  /// Helper function to load binary.
+  Expected<object::Binary *>
+  loadOrGetBinary(const std::string &OpenPath,
+                  const std::string *FullPathKeyOpt = nullptr);
----------------
midhuncodes7 wrote:

Used `std::optional`

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


More information about the llvm-commits mailing list