Merge pull request #395 from klickverbot/remove-disableoptimization

Remove CastExp::disableOptimization.
This commit is contained in:
David Nadlinger
2013-06-11 11:34:35 -07:00
4 changed files with 0 additions and 28 deletions

View File

@@ -9052,9 +9052,6 @@ CastExp::CastExp(Loc loc, Expression *e, Type *t)
{
to = t;
this->mod = ~0;
#if IN_LLVM
disableOptimization = false;
#endif
}
#if DMDV2
@@ -9065,9 +9062,6 @@ CastExp::CastExp(Loc loc, Expression *e, unsigned mod)
{
to = NULL;
this->mod = mod;
#if IN_LLVM
disableOptimization = false;
#endif
}
#endif

View File

@@ -1345,7 +1345,6 @@ struct CastExp : UnaExp
#if IN_LLVM
DValue* toElem(IRState* irs);
llvm::Constant *toConstElem(IRState *irs);
bool disableOptimization;
#endif
};

View File

@@ -3798,16 +3798,7 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
arguments = new Expressions();
if (dup)
arguments->push(getTypeInfo(sc));
// LDC repaint array type to void[]
if (n->ty != Tvoid) {
CastExp *exp = new CastExp(e->loc, e, e->type);
exp->type = Type::tvoid->arrayOf();
exp->disableOptimization = true;
e = exp;
}
arguments->push(e);
if (!dup)
arguments->push(new IntegerExp(0, size, Type::tsize_t));
e = new CallExp(e->loc, ec, arguments);
@@ -3846,14 +3837,6 @@ Expression *TypeArray::dotExp(Scope *sc, Expression *e, Identifier *ident)
ec = new VarExp(0, adSort_fd);
e = e->castTo(sc, n->arrayOf()); // convert to dynamic array
arguments = new Expressions();
// LDC repaint array type to void[]
if (n->ty != Tvoid) {
CastExp *exp = new CastExp(e->loc, e, e->type);
exp->type = Type::tvoid->arrayOf();
exp->disableOptimization = true;
e = exp;
}
arguments->push(e);
// LDC, we don't support the getInternalTypeInfo
// optimization arbitrarily, not yet at least...

View File

@@ -578,10 +578,6 @@ Expression *CallExp::optimize(int result, bool keepLvalue)
Expression *CastExp::optimize(int result, bool keepLvalue)
{
#if IN_LLVM
if (disableOptimization)
return this;
#endif
//printf("CastExp::optimize(result = %d) %s\n", result, toChars());
//printf("from %s to %s\n", type->toChars(), to->toChars());
//printf("from %s\n", type->toChars());