[lld] [lld][ELF] Handle archive special casing in Input Sections (PR #119293)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 22:12:45 PST 2024


================
@@ -406,12 +406,25 @@ static inline StringRef getFilename(const InputFile *file) {
   return file ? file->getNameForScript() : StringRef();
 }
 
+static inline StringRef getArchiveName(const InputFile *file) {
+  return file ? static_cast<StringRef>(file->archiveName) : StringRef();
----------------
MaskRay wrote:

Actually, `file` is guaranteed to be non-nullptr. I am refactoring the caller to take a reference instead of a pointer to make this clear. Just delete this function

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


More information about the llvm-commits mailing list