HomePhabricator

[X32] Add Triple::isX32(), use it.

Authored by hvdijk on Jun 7 2021, 12:48 PM.

Description

[X32] Add Triple::isX32(), use it.

So far, support for x86_64-linux-gnux32 has been handled by explicit
comparisons of Triple.getEnvironment() to GNUX32. This worked as long as
x86_64-linux-gnux32 was the only X32 environment to worry about, but we
now have x86_64-linux-muslx32 as well. To support this, this change adds
an isX32() function and uses it. It replaces all checks for GNUX32 or
MuslX32 by isX32(), except for the following:

  • Triple::isGNUEnvironment() and Triple::isMusl() are supposed to treat GNUX32 and MuslX32 differently.
  • computeTargetTriple() needs to be able to transform triples to add or remove X32 from the environment and needs to map GNU to GNUX32, and Musl to MuslX32.
  • getMultiarchTriple() completely lacks any Musl support and retains the explicit check for GNUX32 as it can only return x86_64-linux-gnux32.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D103777

Details

Committed
hvdijkJun 7 2021, 12:48 PM
Reviewer
MaskRay
Differential Revision
D103777: [X32] Add Triple::isX32(), use it.
Parents
rG6de45b9e6a2c: [clang] Fix reading long doubles with va_arg on x86_64 mingw
Branches
Unknown
Tags
Unknown