diff --git a/module.cpp b/module.cpp index c7b2a424..c7725b2f 100644 --- a/module.cpp +++ b/module.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2010-2011, Intel Corporation + Copyright (c) 2010-2012, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1027,21 +1027,6 @@ lPrintFunctionDeclarations(FILE *file, const std::vector &funcs) { } -static void -lPrintExternGlobals(FILE *file, const std::vector &externGlobals) { - for (unsigned int i = 0; i < externGlobals.size(); ++i) { - Symbol *sym = externGlobals[i]; - if (lRecursiveCheckValidParamType(sym->type)) - Warning(sym->pos, "Not emitting declaration for symbol \"%s\" into " - "generated header file since it (or some of its members) " - "has types that are illegal in exported symbols.", - sym->name.c_str()); - else - fprintf(file, "extern %s;\n", sym->type->GetCDeclaration(sym->name).c_str()); - } -} - - static bool lIsExported(const Symbol *sym) { const FunctionType *ft = dynamic_cast(sym->type); @@ -1058,12 +1043,6 @@ lIsExternC(const Symbol *sym) { } -static bool -lIsExternGlobal(const Symbol *sym) { - return sym->storageClass == SC_EXTERN || sym->storageClass == SC_EXTERN_C; -} - - bool Module::writeHeader(const char *fn) { FILE *f = fopen(fn, "w"); @@ -1116,13 +1095,6 @@ Module::writeHeader(const char *fn) { lGetExportedParamTypes(externCFuncs, &exportedStructTypes, &exportedEnumTypes, &exportedVectorTypes); - // And do the same for the 'extern' globals - std::vector externGlobals; - symbolTable->GetMatchingVariables(lIsExternGlobal, &externGlobals); - for (unsigned int i = 0; i < externGlobals.size(); ++i) - lGetExportedTypes(externGlobals[i]->type, &exportedStructTypes, - &exportedEnumTypes, &exportedVectorTypes); - // And print them lEmitVectorTypedefs(exportedVectorTypes, f); lEmitEnumDecls(exportedEnumTypes, f); @@ -1149,15 +1121,6 @@ Module::writeHeader(const char *fn) { // end namespace fprintf(f, "\n#ifdef __cplusplus\n}\n#endif // __cplusplus\n"); - // and only now emit externs for globals, outside of the ispc namespace - if (externGlobals.size() > 0) { - fprintf(f, "\n"); - fprintf(f, "///////////////////////////////////////////////////////////////////////////\n"); - fprintf(f, "// Globals declared \"extern\" from ispc code\n"); - fprintf(f, "///////////////////////////////////////////////////////////////////////////\n"); - lPrintExternGlobals(f, externGlobals); - } - // end guard fprintf(f, "\n#endif // %s\n", guard.c_str());