mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-04 19:33:13 +01:00
DMD 2.032 Merge.
This commit is contained in:
@@ -333,6 +333,17 @@ void Expression::buildArrayIdent(OutBuffer *buf, Expressions *arguments)
|
||||
arguments->shift(this);
|
||||
}
|
||||
|
||||
void CastExp::buildArrayIdent(OutBuffer *buf, Expressions *arguments)
|
||||
{
|
||||
Type *tb = type->toBasetype();
|
||||
if (tb->ty == Tarray || tb->ty == Tsarray)
|
||||
{
|
||||
e1->buildArrayIdent(buf, arguments);
|
||||
}
|
||||
else
|
||||
Expression::buildArrayIdent(buf, arguments);
|
||||
}
|
||||
|
||||
void SliceExp::buildArrayIdent(OutBuffer *buf, Expressions *arguments)
|
||||
{
|
||||
buf->writestring("Slice");
|
||||
@@ -417,6 +428,17 @@ Expression *Expression::buildArrayLoop(Arguments *fparams)
|
||||
return e;
|
||||
}
|
||||
|
||||
Expression *CastExp::buildArrayLoop(Arguments *fparams)
|
||||
{
|
||||
Type *tb = type->toBasetype();
|
||||
if (tb->ty == Tarray || tb->ty == Tsarray)
|
||||
{
|
||||
return e1->buildArrayLoop(fparams);
|
||||
}
|
||||
else
|
||||
Expression::buildArrayLoop(fparams);
|
||||
}
|
||||
|
||||
Expression *SliceExp::buildArrayLoop(Arguments *fparams)
|
||||
{
|
||||
Identifier *id = Identifier::generateId("p", fparams->dim);
|
||||
@@ -435,12 +457,14 @@ Expression *AssignExp::buildArrayLoop(Arguments *fparams)
|
||||
/* Evaluate assign expressions right to left
|
||||
*/
|
||||
Expression *ex2 = e2->buildArrayLoop(fparams);
|
||||
#if DMDV2
|
||||
/* Need the cast because:
|
||||
* b = c + p[i];
|
||||
* where b is a byte fails because (c + p[i]) is an int
|
||||
* which cannot be implicitly cast to byte.
|
||||
*/
|
||||
ex2 = new CastExp(0, ex2, e1->type->nextOf());
|
||||
#endif
|
||||
Expression *ex1 = e1->buildArrayLoop(fparams);
|
||||
Argument *param = (Argument *)fparams->data[0];
|
||||
param->storageClass = 0;
|
||||
|
||||
Reference in New Issue
Block a user