mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-09 12:32:33 +03:00
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:
parent
e3e2f4b2e9
commit
c1c285782d
5 changed files with 34 additions and 80 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue