From c99ed9161d8680f68fa364211323ff589ba409c4 Mon Sep 17 00:00:00 2001 From: Dennis Korpel Date: Tue, 12 Nov 2024 12:38:08 +0100 Subject: [PATCH] Reduce imports in intrange.d --- compiler/src/dmd/intrange.d | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/compiler/src/dmd/intrange.d b/compiler/src/dmd/intrange.d index 51f28013f22b..5f1b162e1adb 100644 --- a/compiler/src/dmd/intrange.d +++ b/compiler/src/dmd/intrange.d @@ -13,10 +13,9 @@ module dmd.intrange; import core.stdc.stdio; -import dmd.astenums; -import dmd.mtype; -import dmd.expression; -import dmd.globals; +import dmd.astenums : Tdchar; +import dmd.mtype : Type; +import dmd.globals : uinteger_t; private uinteger_t copySign(uinteger_t x, bool sign) @safe { @@ -322,7 +321,7 @@ struct IntRange static IntRange fromType(Type type, bool isUnsigned) { - if (!type.isIntegral() || type.toBasetype().ty == Tvector) + if (!type.isIntegral() || type.toBasetype().isTypeVector()) return widest(); uinteger_t mask = type.sizemask(); @@ -444,7 +443,7 @@ struct IntRange IntRange _cast(Type type) { - if (!type.isIntegral() || type.toBasetype().ty == Tvector) + if (!type.isIntegral() || type.toBasetype().isTypeVector()) return this; else if (!type.isUnsigned()) return castSigned(type.sizemask()); @@ -456,7 +455,7 @@ struct IntRange IntRange castUnsigned(Type type) { - if (!type.isIntegral() || type.toBasetype().ty == Tvector) + if (!type.isIntegral() || type.toBasetype().isTypeVector()) return castUnsigned(ulong.max); else if (type.toBasetype().ty == Tdchar) return castDchar(); @@ -504,7 +503,7 @@ struct IntRange 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", imin.negative?'-':'+', cast(ulong)imin.value,