[PATCH] D105867: [lld-macho] Optimize bind opcodes with multiple passes

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 15:14:12 PDT 2021


int3 added inline comments.


================
Comment at: lld/MachO/Driver.cpp:1144
   config->mapFile = args.getLastArgValue(OPT_map);
+  config->optimize = args::getInteger(args, OPT_O, 0);
   config->outputFile = args.getLastArgValue(OPT_o, "a.out");
----------------
thevinster wrote:
> int3 wrote:
> > LLD-ELF defaults this to 1; I think we should follow suit (and gate the bind opcode optimization to `> 1`)
> I was considering that, but when I looked at the definitions of how clang (https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-o0) uses the `-O` flag, they define -O0 as no optimizations which seemed fitting since we don't do any of it right now. That said, this does deviate from the LLD-ELF conventions and I'm happy to take either approaches if you feel strongly that it should be 1. 
yeah I think we should follow LLD-ELF more closely than we follow clang


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105867



More information about the llvm-commits mailing list