[PATCH] D91147: AArch64: classify Triple::aarch64_32 as AArch64

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 11 12:21:55 PST 2020


dexonsmith added inline comments.


================
Comment at: clang/lib/Driver/ToolChain.cpp:1066
   if (getTriple().getArch() == llvm::Triple::x86_64 ||
-      getTriple().isAArch64() || getTriple().isRISCV())
+      (getTriple().isAArch64() && getTriple().isArch64Bit()) ||
+      getTriple().isRISCV())
----------------
Is there a short-form we'd want for this?

Here are two ideas:
```
// getTriple().isAArch64_64() and getTriple().isAArch64_32()
bool Triple::isAArch64_64() { return isAArch64() && isArch64Bit(); }
bool Triple::isAArch64_32() { return isAArch64() && isArch32Bit(); }

// getTriple().isAArch64(64) and getTriple().isAArch64(32)
bool Triple::isAArch64(int Bits) {
  assert(Bits == 32 || Bits == 64);
  if (!isAArch64())
    return false;
  return isArch64Bit() ? Bits == 64 : Bits == 32;
}
```
Or do you think it's better as-is?


================
Comment at: llvm/include/llvm/ADT/Triple.h:715
 
   /// Tests whether the target is AArch64 (little and big endian).
   bool isAArch64() const {
----------------
Should the comment be changed?


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

https://reviews.llvm.org/D91147



More information about the cfe-commits mailing list