[PATCH] D92535: [llvm-link] minor cleanup [NFC]

Sergey Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 20:02:47 PST 2020


sdmitriev created this revision.
sdmitriev added reviewers: jdoerfert, jsjodin, gregrodgers, RaviNarayanaswamy.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
sdmitriev requested review of this revision.

Remove unneeded loadArFile() function parameters.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92535

Files:
  llvm/tools/llvm-link/llvm-link.cpp


Index: llvm/tools/llvm-link/llvm-link.cpp
===================================================================
--- llvm/tools/llvm-link/llvm-link.cpp
+++ llvm/tools/llvm-link/llvm-link.cpp
@@ -144,9 +144,7 @@
 
 static std::unique_ptr<Module> loadArFile(const char *Argv0,
                                           std::unique_ptr<MemoryBuffer> Buffer,
-                                          LLVMContext &Context, Linker &L,
-                                          unsigned OrigFlags,
-                                          unsigned ApplicableFlags) {
+                                          LLVMContext &Context) {
   std::unique_ptr<Module> Result(new Module("ArchiveModule", Context));
   StringRef ArchiveName = Buffer->getBufferIdentifier();
   if (Verbose)
@@ -163,7 +161,7 @@
           << " failed to read name of archive member"
           << ArchiveName << "'\n";
       return nullptr;
-    };
+    }
     std::string ChildName = Ename.get().str();
     if (Verbose)
       errs() << "Parsing member '" << ChildName
@@ -199,9 +197,8 @@
     }
     if (Verbose)
       errs() << "Linking member '" << ChildName << "' of archive library.\n";
-    if (L.linkModules(*Result, std::move(M), ApplicableFlags))
+    if (Linker::linkModules(*Result, std::move(M)))
       return nullptr;
-    ApplicableFlags = OrigFlags;
   } // end for each child
   ExitOnErr(std::move(Err));
   return Result;
@@ -356,8 +353,7 @@
 
     std::unique_ptr<Module> M =
         identify_magic(Buffer->getBuffer()) == file_magic::archive
-            ? loadArFile(argv0, std::move(Buffer), Context, L, Flags,
-                         ApplicableFlags)
+            ? loadArFile(argv0, std::move(Buffer), Context)
             : loadFile(argv0, std::move(Buffer), Context);
     if (!M.get()) {
       errs() << argv0 << ": ";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92535.309132.patch
Type: text/x-patch
Size: 1825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201203/70f3e249/attachment.bin>


More information about the llvm-commits mailing list