[PATCH] D91418: [LLD][ELF] Rename lld elf driver main function

Reshabh Sharma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 08:14:36 PST 2020


rksharma updated this revision to Diff 306418.
rksharma added a comment.

`link` seems to be a more consistent name as pointed out by @MaskRay 
Can we ignore its clash with `lld::*::link` as the general intent with setting a breakpoint at `main` is to trap the `main` function and not the `lld::elf::LinkerDriver::main` which may not be true for `link`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91418/new/

https://reviews.llvm.org/D91418

Files:
  lld/ELF/Driver.cpp
  lld/ELF/Driver.h


Index: lld/ELF/Driver.h
===================================================================
--- lld/ELF/Driver.h
+++ lld/ELF/Driver.h
@@ -26,7 +26,7 @@
 
 class LinkerDriver {
 public:
-  void main(ArrayRef<const char *> args);
+  void link(ArrayRef<const char *> args);
   void addFile(StringRef path, bool withLOption);
   void addLibrary(StringRef name);
 
Index: lld/ELF/Driver.cpp
===================================================================
--- lld/ELF/Driver.cpp
+++ lld/ELF/Driver.cpp
@@ -111,7 +111,7 @@
 
   config->progName = args[0];
 
-  driver->main(args);
+  driver->link(args);
 
   // Exit immediately if we don't need to return to the caller.
   // This saves time because the overhead of calling destructors
@@ -454,7 +454,7 @@
       error("unknown -z value: " + StringRef(arg->getValue()));
 }
 
-void LinkerDriver::main(ArrayRef<const char *> argsArr) {
+void LinkerDriver::link(ArrayRef<const char *> argsArr) {
   ELFOptTable parser;
   opt::InputArgList args = parser.parse(argsArr.slice(1));
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91418.306418.patch
Type: text/x-patch
Size: 1027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201119/cfbc458e/attachment.bin>


More information about the llvm-commits mailing list