[PATCH] D105555: [RISCV][Clang] Compute the default target-abi if it's empty.

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 08:15:08 PDT 2021


jrtc27 added inline comments.


================
Comment at: clang/lib/Basic/Targets/RISCV.cpp:233
+  // Use the explicitly target-feature to compute default ABI.
+  if (getABI().empty()) {
+    bool Is64Bit = getTriple().getArch() == llvm::Triple::riscv64;
----------------
I don't think using the getter makes sense. Currently it's entirely equivalent to just reading ABI so serves little purpose, but in theory there could be additional logic added to it (like asserting it's not empty) that would break this. Given you already assume the name of the field below by assigning to it, just read ABI directly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105555



More information about the llvm-commits mailing list