Adapt to free functions in dmd C++ namespace now

This commit is contained in:
Martin Kinkelin 2024-03-03 19:14:00 +01:00
parent 217888ff47
commit 9041c0bf67
37 changed files with 132 additions and 64 deletions

View file

@ -24,6 +24,8 @@
#include "ir/irfunction.h"
#include "ir/irmodule.h"
using namespace dmd;
// returns the keytype typeinfo
static LLConstant *to_keyti(const Loc &loc, DValue *aa, LLType *targetType) {
// keyti param
@ -60,8 +62,8 @@ DLValue *DtoAAIndex(const Loc &loc, Type *type, DValue *aa, DValue *key,
// call runtime
LLValue *ret;
if (lvalue) {
LLValue *rawAATI =
DtoTypeInfoOf(loc, aa->type->unSharedOf()->mutableOf(), /*base=*/false);
auto t = mutableOf(unSharedOf(aa->type));
LLValue *rawAATI = DtoTypeInfoOf(loc, t, /*base=*/false);
LLValue *castedAATI = DtoBitCast(rawAATI, funcTy->getParamType(1));
LLValue *valsize = DtoConstSize_t(getTypeAllocSize(DtoType(type)));
ret = gIR->CreateCallOrInvoke(func, aaval, castedAATI, valsize, pkey,