[PATCH] D113075: [lld-macho] Use separate tablegen file for LC_LINKER_OPTION

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 19:55:39 PDT 2021


keith added inline comments.


================
Comment at: lld/MachO/DriverUtils.cpp:54
 
+namespace LCLinkerOptInfo {
+// Create prefix string literals used in LCLinkerOptions.td
----------------
keith wrote:
> int3 wrote:
> > keith wrote:
> > > I assume there is another, better, way for me to define 2 OptTables in the same file, I would appreciate pointers!
> > idk if there are more elegant ways of working with OptTables, but I was wondering if it would be simpler to not use an OptTable altogether. Given that there are only two unique prefixes that we need to check for, we could do it by hand -- something like `if (s.startswith("-l")) { ... }`.
> Yea I was considering that too. I do think that would be much simpler. It looks like we're only missing 2 so it shouldn't grow much https://github.com/keith/ld64/blob/2ff40b093f1b20dad35d48480da016bc380707dd/src/ld/Resolver.cpp#L324-L363
Submitted https://reviews.llvm.org/D113235 for discussion


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113075



More information about the llvm-commits mailing list