Make DtoIndexAggregate return a DLValue (#4112)

This commit is contained in:
Nicholas Wilson 2022-09-04 21:34:31 +08:00 committed by GitHub
parent 78c37450d6
commit 7d8638c27a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 13 deletions

View file

@ -1878,7 +1878,7 @@ FuncDeclaration *getParentFunc(Dsymbol *sym) {
return nullptr;
}
LLValue *DtoIndexAggregate(LLValue *src, AggregateDeclaration *ad,
DLValue *DtoIndexAggregate(LLValue *src, AggregateDeclaration *ad,
VarDeclaration *vd) {
IF_LOG Logger::println("Indexing aggregate field %s:", vd->toPrettyChars());
LOG_SCOPE;
@ -1924,7 +1924,7 @@ LLValue *DtoIndexAggregate(LLValue *src, AggregateDeclaration *ad,
val = DtoBitCast(val, DtoPtrToType(vd->type));
IF_LOG Logger::cout() << "Value: " << *val << '\n';
return val;
return new DLValue(vd->type, val);
}
unsigned getFieldGEPIndex(AggregateDeclaration *ad, VarDeclaration *vd) {