Reduce imports in intrange.d

This commit is contained in:
Dennis Korpel 2024-11-12 12:38:08 +01:00 committed by Nicholas Wilson
parent 33cd3b3981
commit 9ffda54fe1

View file

@ -13,10 +13,9 @@ module dmd.intrange;
import core.stdc.stdio; import core.stdc.stdio;
import dmd.astenums; import dmd.astenums : Tdchar;
import dmd.mtype; import dmd.mtype : Type;
import dmd.expression; import dmd.globals : uinteger_t;
import dmd.globals;
private uinteger_t copySign(uinteger_t x, bool sign) @safe private uinteger_t copySign(uinteger_t x, bool sign) @safe
{ {
@ -322,7 +321,7 @@ struct IntRange
static IntRange fromType(Type type, bool isUnsigned) static IntRange fromType(Type type, bool isUnsigned)
{ {
if (!type.isIntegral() || type.toBasetype().ty == Tvector) if (!type.isIntegral() || type.toBasetype().isTypeVector())
return widest(); return widest();
uinteger_t mask = type.sizemask(); uinteger_t mask = type.sizemask();
@ -444,7 +443,7 @@ struct IntRange
IntRange _cast(Type type) IntRange _cast(Type type)
{ {
if (!type.isIntegral() || type.toBasetype().ty == Tvector) if (!type.isIntegral() || type.toBasetype().isTypeVector())
return this; return this;
else if (!type.isUnsigned()) else if (!type.isUnsigned())
return castSigned(type.sizemask()); return castSigned(type.sizemask());
@ -456,7 +455,7 @@ struct IntRange
IntRange castUnsigned(Type type) IntRange castUnsigned(Type type)
{ {
if (!type.isIntegral() || type.toBasetype().ty == Tvector) if (!type.isIntegral() || type.toBasetype().isTypeVector())
return castUnsigned(ulong.max); return castUnsigned(ulong.max);
else if (type.toBasetype().ty == Tdchar) else if (type.toBasetype().ty == Tdchar)
return castDchar(); return castDchar();
@ -504,7 +503,7 @@ struct IntRange
union_ = true; union_ = true;
} }
ref const(IntRange) dump(const(char)* funcName, Expression e) const return ref const(IntRange) dump(Exp)(const(char)* funcName, Exp e) const return
{ {
printf("[(%c)%#018llx, (%c)%#018llx] @ %s ::: %s\n", printf("[(%c)%#018llx, (%c)%#018llx] @ %s ::: %s\n",
imin.negative?'-':'+', cast(ulong)imin.value, imin.negative?'-':'+', cast(ulong)imin.value,