Cleaning up tests and printing for demo

This commit is contained in:
2017-05-11 21:16:08 -04:00
parent 34d26554bf
commit 2921430e45
5 changed files with 17 additions and 17 deletions

View File

@@ -1061,8 +1061,6 @@ Module::AddFunctionDeclaration(const std::string &name,
const Type *ret = eft->GetReturnType();
if (Type::EqualForReplacement(ret, pt)) {
printf("Replaced return type %s\n",
ret->GetString().c_str());
ret = PolyType::ReplaceType(ret, *te);
}
@@ -1998,11 +1996,13 @@ lPrintPolyFunctionWrappers(FILE *file, const std::vector<std::string> &funcs) {
for (size_t j=0; j<poly.size(); j++) {
const FunctionType *ftype = CastType<FunctionType>(poly[j]->type);
Assert(ftype);
std::string decl = ftype->GetCDeclaration(funcs[i]);
fprintf(file, " %s {\n", decl.c_str());
if (ftype->isExported || ftype->isExternC) {
std::string decl = ftype->GetCDeclaration(funcs[i]);
fprintf(file, " %s {\n", decl.c_str());
std::string call = ftype->GetCCall(poly[j]->name);
fprintf(file, " return %s;\n }\n", call.c_str());
std::string call = ftype->GetCCall(poly[j]->name);
fprintf(file, " return %s;\n }\n", call.c_str());
}
}
}