Remove optimizer syntax copies where they weren't proven to be necessary.

Copying without calling semantic() leads to issues for more complicated
expressions.
This commit is contained in:
Christian Kamm
2009-01-18 14:14:40 +01:00
parent 2814c2ab44
commit 6594665d5d

View File

@@ -365,7 +365,6 @@ Expression *CastExp::optimize(int result)
if (e1->op == TOKnull &&
(type->ty == Tpointer || type->ty == Tclass))
{
e1 = e1->syntaxCopy();
e1->type = type;
return e1;
}
@@ -381,7 +380,6 @@ Expression *CastExp::optimize(int result)
cdto = type->isClassHandle();
if (cdto->isBaseOf(cdfrom, &offset) && offset == 0)
{
e1 = e1->syntaxCopy();
e1->type = type;
return e1;
}
@@ -396,7 +394,6 @@ Expression *CastExp::optimize(int result)
if (type->size() == e1->type->size() &&
type->toBasetype()->ty != Tsarray)
{
e1 = e1->syntaxCopy();
e1->type = type;
return e1;
}