[PATCH] D143120: [llvm] infer rtlib from triple for codegen decisions

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 00:20:14 PST 2023


mstorsjo added inline comments.


================
Comment at: llvm/lib/TargetParser/Triple.cpp:1235
+  return COMPILER_RT;
+}
+
----------------
Depending on the actual use of this function, I think we'd need to be more careful than this, to only return a non-unknown value for the platforms where we're absolutely certain that there can't be any other choice. For platforms like apple and android, this probably is the case - possibly for some of the BSDs as well (not entirely sure).

At least for mingw targets (which do hit the `isGNUEnvironment()` at the top), toolchains with both libgcc and compiler-rt are in active use.

With the only use of `getRTLib()` as suggested in this patch, it's harmless to return libgcc (it'd be equal to returning unknown), but with the function in place, the function may be used in other ways too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143120



More information about the llvm-commits mailing list