Transition type checking to use WalkAST() infrastructure.

This commit is contained in:
Matt Pharr
2011-12-16 11:56:44 -08:00
parent f48a662ed3
commit 701334ccf2
8 changed files with 230 additions and 282 deletions

View File

@@ -263,7 +263,7 @@ Module::AddGlobalVariable(Symbol *sym, Expr *initExpr, bool isConst) {
"global variable \"%s\".", sym->name.c_str());
}
else if (initExpr != NULL) {
initExpr = initExpr->TypeCheck();
initExpr = TypeCheck(initExpr);
if (initExpr != NULL) {
// We need to make sure the initializer expression is
// the same type as the global. (But not if it's an