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

Mateusz MikuĊ‚a via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 03:10:04 PDT 2020


mati865 added inline comments.


================
Comment at: lld/tools/lld/lld.cpp:96
+
+  return LLD_DEFAULT_LD_LLD_BACKEND == "MINGW" ? true : false;
 }
----------------
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.


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