From 9ad88ef713ba227f701a0b3f69ccd1d694fae5f1 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Tue, 11 Jun 2013 18:14:13 +0200 Subject: [PATCH] Remove CastExp::disableOptimization. --- dmd2/expression.c | 6 ------ dmd2/expression.h | 1 - dmd2/mtype.c | 17 ----------------- dmd2/optimize.c | 4 ---- 4 files changed, 28 deletions(-) diff --git a/dmd2/expression.c b/dmd2/expression.c index 7605c48e..c60814d1 100644 --- a/dmd2/expression.c +++ b/dmd2/expression.c @@ -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 diff --git a/dmd2/expression.h b/dmd2/expression.h index 1ee6cf80..e1a84a56 100644 --- a/dmd2/expression.h +++ b/dmd2/expression.h @@ -1345,7 +1345,6 @@ struct CastExp : UnaExp #if IN_LLVM DValue* toElem(IRState* irs); llvm::Constant *toConstElem(IRState *irs); - bool disableOptimization; #endif }; diff --git a/dmd2/mtype.c b/dmd2/mtype.c index 526b6581..8cad2251 100644 --- a/dmd2/mtype.c +++ b/dmd2/mtype.c @@ -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... diff --git a/dmd2/optimize.c b/dmd2/optimize.c index 016af0a0..2783ccfe 100644 --- a/dmd2/optimize.c +++ b/dmd2/optimize.c @@ -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());