Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce imports in intrange.d #17059

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions compiler/src/dmd/intrange.d
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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());
Expand All @@ -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();
Expand Down Expand Up @@ -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,
Expand Down
Loading