Typechecking fixes, moved some printing behind debug flag

This commit is contained in:
2017-05-10 23:12:48 -04:00
parent ab29965d75
commit d020107d91
7 changed files with 44 additions and 17 deletions

View File

@@ -651,8 +651,10 @@ Function::ExpandPolyArguments(SymbolTable *symbolTable) const {
const FunctionType *func = CastType<FunctionType>(sym->type);
printf("%s before replacing anything:\n", sym->name.c_str());
code->Print(0);
if (g->debugPrint) {
printf("%s before replacing anything:\n", sym->name.c_str());
code->Print(0);
}
for (size_t i=0; i<versions.size(); i++) {
const FunctionType *ft = CastType<FunctionType>(versions[i]->type);
@@ -665,13 +667,15 @@ Function::ExpandPolyArguments(SymbolTable *symbolTable) const {
ncode = (Stmt*)TranslatePoly(ncode, from,
ft->GetParameterType(j)->GetBaseType());
printf("%s after replacing %s with %s:\n\n",
sym->name.c_str(), from->GetString().c_str(),
ft->GetParameterType(j)->GetBaseType()->GetString().c_str());
if (g->debugPrint) {
printf("%s after replacing %s with %s:\n\n",
sym->name.c_str(), from->GetString().c_str(),
ft->GetParameterType(j)->GetBaseType()->GetString().c_str());
ncode->Print(0);
ncode->Print(0);
printf("------------------------------------------\n\n");
printf("------------------------------------------\n\n");
}
}
}