Streamline DSliceValue

All DValues are now required to have a (main) LL value, which allows
to conveniently refactor the DValue hierarchy.

DSliceValue now represents a LL struct instead of separate values for
length and pointer.
This commit is contained in:
Martin 2016-05-31 21:02:13 +02:00
parent e3e2f4b2e9
commit c1c285782d
5 changed files with 34 additions and 80 deletions

View file

@ -699,8 +699,8 @@ DValue *DtoPaintType(Loc &loc, DValue *val, Type *to) {
assert(at->ty == Tarray);
Type *elem = at->nextOf()->pointerTo();
if (DSliceValue *slice = val->isSlice()) {
return new DSliceValue(to, slice->len,
DtoBitCast(slice->ptr, DtoType(elem)));
return new DSliceValue(to, slice->getLength(),
DtoBitCast(slice->getPtr(), DtoType(elem)));
}
if (val->isLVal()) {
LLValue *ptr = val->getLVal();