Predefine version D_X32 for 64-bit targets with 32-bit pointer size

This commit is contained in:
Martin Kinkelin 2021-08-14 18:52:23 +02:00
parent a6cc5cde38
commit ec5fd799b9
2 changed files with 3 additions and 0 deletions

View file

@ -728,6 +728,8 @@ void registerPredefinedTargetVersions() {
// Set versions for arch bitwidth
if (gDataLayout->getPointerSizeInBits() == 64) {
VersionCondition::addPredefinedGlobalIdent("D_LP64");
} else if (triple.isArch64Bit()) {
VersionCondition::addPredefinedGlobalIdent("D_X32");
} else if (triple.isArch16Bit()) {
VersionCondition::addPredefinedGlobalIdent("D_P16");
}

View file

@ -9,6 +9,7 @@ static assert(size_t.sizeof == 4);
static assert(ptrdiff_t.sizeof == 4);
version (D_LP64) static assert(0);
version (D_X32) { /* expected */ } else static assert(0);
bool equals(string lhs, string rhs)
{