Be able to determine if two types can be converted without requiring an Expr *.

The Expr::TypeConv() method has been replaced with both a
CanConvertTypes() routine that indicates whether one type
can be converted to another and a TypeConvertExpr()
routine that provides the same functionality as
Expr::TypeConv() used to.
This commit is contained in:
Matt Pharr
2011-10-30 14:12:12 -07:00
parent d5a8538192
commit e009c0a61d
5 changed files with 231 additions and 176 deletions

View File

@@ -256,8 +256,8 @@ Module::AddGlobalVariable(Symbol *sym, Expr *initExpr, bool isConst) {
// ExprList; they don't have types per se / can't type
// convert themselves anyway.)
if (dynamic_cast<ExprList *>(initExpr) == NULL)
initExpr = initExpr->TypeConv(sym->type, "initializer");
initExpr = TypeConvertExpr(initExpr, sym->type, "initializer");
if (initExpr != NULL) {
initExpr = initExpr->Optimize();
// Fingers crossed, now let's see if we've got a