comparison gen/toir.cpp @ 361:932229a851a4 trunk

[svn r382] In CastExp, after the cast to CastExp.to force the type to be CastExp.type. This is used for c.im for instance, where the cast is to idouble but type is double.
author ChristianK
date Mon, 14 Jul 2008 19:17:25 +0200
parents 926f65e39246
children 4d7495038ae8
comparison
equal deleted inserted replaced
360:9c9544fd769d 361:932229a851a4
1248 Logger::print("CastExp::toElem: %s | %s\n", toChars(), type->toChars()); 1248 Logger::print("CastExp::toElem: %s | %s\n", toChars(), type->toChars());
1249 LOG_SCOPE; 1249 LOG_SCOPE;
1250 1250
1251 DValue* u = e1->toElem(p); 1251 DValue* u = e1->toElem(p);
1252 DValue* v = DtoCast(u, to); 1252 DValue* v = DtoCast(u, to);
1253 // force d type to this->type
1254 v->getType() = type;
1253 1255
1254 if (v->isSlice()) { 1256 if (v->isSlice()) {
1255 // only valid as rvalue! 1257 // only valid as rvalue!
1256 return v; 1258 return v;
1257 } 1259 }