Skip to content

Commit

Permalink
update compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
9il committed Aug 9, 2023
1 parent 41ee85b commit e888555
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 139 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/compilers.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"dmd-master",
"dmd-latest",
"dmd-beta",
"dmd-2.100.2",
"ldc-master",
"ldc-latest",
"ldc-beta",
"ldc-1.30.1"
"ldc-beta"
]
15 changes: 6 additions & 9 deletions source/mir/bignum/internal/phobos_kernel.d
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,19 @@ Idioms:
*/
module mir.bignum.internal.phobos_kernel;

static if (__VERSION__ > 2100)
version (D_InlineAsm_X86)
static import std.internal.math.biguintx86;
version (D_InlineAsm_X86)
static import std.internal.math.biguintx86;

version (DMD)
{
static if (__VERSION__ > 2100)
version (D_InlineAsm_X86)
version = HaveAsmVersion;
version (D_InlineAsm_X86)
version = HaveAsmVersion;
}

version (LDC)
{
static if (__VERSION__ > 2100)
version (D_InlineAsm_X86)
version = HaveAsmVersion;
version (D_InlineAsm_X86)
version = HaveAsmVersion;

version (ARM)
{
Expand Down
30 changes: 0 additions & 30 deletions source/mir/serde.d
Original file line number Diff line number Diff line change
Expand Up @@ -417,25 +417,11 @@ immutable(string)[] serdeGetKeysIn(T)(const T value) @trusted pure nothrow @nogc

import std.meta: staticMap;
static immutable ret = [staticMap!(.serdeGetKeysIn, EnumMembers!T)];
static if (__VERSION__ < 2093)
{
final switch (value)
{
foreach (i, member; EnumMembers!T)
{
case member:
return ret[i];
}
}
}
else
{
import mir.enums: getEnumIndex;
uint index = void;
if (getEnumIndex(value, index))
return ret[index];
assert(0);
}
}

///
Expand Down Expand Up @@ -527,29 +513,13 @@ string serdeGetKeyOut(T)(const T value)
alias all = __traits(getAttributes, EnumMembers!T[i]);
}}

static if (__VERSION__ < 2093)
{
import std.meta: staticMap;
static immutable ret = [staticMap!(.serdeGetKeyOut, EnumMembers!T)];
final switch (value)
{
foreach (i, member; EnumMembers!T)
{
case member:
return ret[i];
}
}
}
else
{
import std.meta: staticMap;
import mir.enums: getEnumIndex;
static immutable ret = [staticMap!(.serdeGetKeyOut, EnumMembers!T)];
uint index = void;
if (getEnumIndex(value, index))
return ret[index];
assert(0);
}
}

///
Expand Down
93 changes: 0 additions & 93 deletions source/mir/series.d
Original file line number Diff line number Diff line change
Expand Up @@ -2598,96 +2598,3 @@ ref V[K] insert(V, K, IndexIterator, Iterator, size_t N, SliceKind kind)(return
a.insert = s;
assert(a.series == series([1, 2, 3, 4], [3.0, 20, 30, 2]));
}


static if (__VERSION__ < 2078)
//////////////////// OBJECT.d
{

private:

extern (C)
{
// from druntime/src/rt/aaA.d

// size_t _aaLen(in void* p) pure nothrow @nogc;
private void* _aaGetY(void** paa, const TypeInfo_AssociativeArray ti, in size_t valuesize, in void* pkey) pure nothrow;
// inout(void)* _aaGetRvalueX(inout void* p, in TypeInfo keyti, in size_t valuesize, in void* pkey);
inout(void)[] _aaValues(inout void* p, in size_t keysize, in size_t valuesize, const TypeInfo tiValArray) pure nothrow;
inout(void)[] _aaKeys(inout void* p, in size_t keysize, const TypeInfo tiKeyArray) pure nothrow;
void* _aaRehash(void** pp, in TypeInfo keyti) pure nothrow;
void _aaClear(void* p) pure nothrow;

// alias _dg_t = extern(D) int delegate(void*);
// int _aaApply(void* aa, size_t keysize, _dg_t dg);

// alias _dg2_t = extern(D) int delegate(void*, void*);
// int _aaApply2(void* aa, size_t keysize, _dg2_t dg);

// private struct AARange { void* impl; size_t idx; }
alias AARange = ReturnType!(object._aaRange);
AARange _aaRange(void* aa) pure nothrow @nogc @safe;
bool _aaRangeEmpty(AARange r) pure nothrow @nogc @safe;
void* _aaRangeFrontKey(AARange r) pure nothrow @nogc @safe;
void* _aaRangeFrontValue(AARange r) pure nothrow @nogc @safe;
void _aaRangePopFront(ref AARange r) pure nothrow @nogc @safe;

}

auto byKeyValue(T : V[K], K, V)(T aa) pure nothrow @nogc @safe
{
import core.internal.traits : substInout;

static struct Result
{
AARange r;

pure nothrow @nogc:
@property bool empty() @safe { return _aaRangeEmpty(r); }
@property auto front()
{
static struct Pair
{
// We save the pointers here so that the Pair we return
// won't mutate when Result.popFront is called afterwards.
private void* keyp;
private void* valp;

@property ref key() inout
{
auto p = (() @trusted => cast(substInout!K*) keyp) ();
return *p;
};
@property ref value() inout
{
auto p = (() @trusted => cast(substInout!V*) valp) ();
return *p;
};
}
return Pair(_aaRangeFrontKey(r),
_aaRangeFrontValue(r));
}
void popFront() @safe { return _aaRangePopFront(r); }
@property Result save() { return this; }
}

return Result(_aaToRange(aa));
}

auto byKeyValue(T : V[K], K, V)(T* aa) pure nothrow @nogc
{
return (*aa).byKeyValue();
}

// this should never be made public.
private AARange _aaToRange(T: V[K], K, V)(ref T aa) pure nothrow @nogc @safe
{
// ensure we are dealing with a genuine AA.
static if (is(const(V[K]) == const(T)))
alias realAA = aa;
else
const(V[K]) realAA = aa;
return _aaRange(() @trusted { return cast(void*)realAA; } ());
}

}
5 changes: 1 addition & 4 deletions source/mir/string_map.d
Original file line number Diff line number Diff line change
Expand Up @@ -1142,10 +1142,7 @@ version(mir_test)
table["0"] = v0;
table["1"] = v1;
assert(table.keys == ["0", "1"]);
static if (__VERSION__ > 2098) // See https://github.com/libmir/mir-algorithm/runs/6809888795?check_suite_focus=true#step:5:17
{
assert(table.values == [v0, v1]); // TODO: qualify unittest as `pure` when this is inferred `pure`
}
assert(table.values == [v0, v1]); // TODO: qualify unittest as `pure` when this is inferred `pure`
static assert(is(typeof(table.values) == const(C)[]));
}

Expand Down

0 comments on commit e888555

Please sign in to comment.