Fix regression from AST checkin that caused perf. warnings to be issued for stdlib code.

This commit is contained in:
Matt Pharr
2011-10-06 19:42:18 -07:00
parent 53dd65fa2e
commit 4a2cbf2c4e
2 changed files with 1 additions and 4 deletions

View File

@@ -521,11 +521,8 @@ DefineStdlib(SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *mod
// definitions added. Disable emission of performance warnings for // definitions added. Disable emission of performance warnings for
// now, since the user doesn't care about any of that in the stdlib // now, since the user doesn't care about any of that in the stdlib
// implementation... // implementation...
bool epf = g->emitPerfWarnings;
g->emitPerfWarnings = false;
extern char stdlib_code[]; extern char stdlib_code[];
yy_scan_string(stdlib_code); yy_scan_string(stdlib_code);
yyparse(); yyparse();
g->emitPerfWarnings = epf;
} }
} }

View File

@@ -295,7 +295,7 @@ Warning(SourcePos p, const char *fmt, ...) {
void void
PerformanceWarning(SourcePos p, const char *fmt, ...) { PerformanceWarning(SourcePos p, const char *fmt, ...) {
if (!g->emitPerfWarnings) if (!g->emitPerfWarnings || strcmp(p.name, "stdlib.ispc") == 0)
return; return;
va_list args; va_list args;