[PATCH] D87418: [LLD] Allow configuring default ld.lld backend

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 11:50:12 PDT 2020


mstorsjo added inline comments.


================
Comment at: lld/tools/lld/lld.cpp:96
+
+  return strcmp(LLD_DEFAULT_LD_LLD_BACKEND, "MINGW") ? false : true;
 }
----------------
mati865 wrote:
> MaskRay wrote:
> > `return StringRef(LLD_DEFAULT_LD_LLD_BACKEND) == "MINGW";`
> I don't see why this (small) runtime penalty is preferred but I'll update the diff later.
StringRef is both very lightweight and transparent (it's essentially a <const char*, size_t> tuple) so it turns out the compiler can evaluate the whole operator invocation at compile time (tested with GCC 7), boiling down to the same constant as before.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87418



More information about the llvm-commits mailing list