[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 03:38:21 PDT 2020


mstorsjo added inline comments.


================
Comment at: lld/tools/lld/lld.cpp:96
+
+  return LLD_DEFAULT_LD_LLD_BACKEND == "MINGW" ? true : false;
 }
----------------
mati865 wrote:
> mstorsjo wrote:
> > Wrap either side in `StringRef()` to get proper behaviour for the `==` - or maybe evaluate it to an int/bool already in cmake to avoid any actual runtime code for this? (Sorry for not picking up on this before.)
> > Sorry for not picking up on this before.
> 
> No problem. I have totally missed the fact this is C string not C++ string.
> 
> > maybe evaluate it to an int/bool already in cmake to avoid any actual runtime code
> 
> Defining something like `LLD_DEFAULT_LD_LLD_BACKEND_MINGW` from CMake is an easy fix but there are other ways to keep generic define: https://godbolt.org/z/c7dvf5
> 
> Which one should I use? For me `strcmp()` seems like good choice here.
As both gcc and clang seem to optimize out the redundant strcmp(), that sounds like a good option to me too.


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