Mercurial > projects > ldc
diff gen/toobj.cpp @ 622:26fce59fe80a
Wrapped all the most potentially expensive logging calls in a conditional to only do work when actually requested.
Commented some logging calls that could potentially write out many megabytes of type dumps.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 01 Oct 2008 18:32:31 +0200 |
parents | e235b80c92bc |
children | e83ba4ae4878 |
line wrap: on
line diff
--- a/gen/toobj.cpp Sun Sep 28 21:09:21 2008 +0200 +++ b/gen/toobj.cpp Wed Oct 01 18:32:31 2008 +0200 @@ -61,10 +61,10 @@ Logger::enable(); } - Logger::cout() << "Generating module: " << (md ? md->toChars() : toChars()) << '\n'; + Logger::println("Generating module: %s\n", (md ? md->toChars() : toChars())); LOG_SCOPE; - //printf("codegen: %s\n", srcfile->toChars()); + printf("codegen: %s\n", srcfile->toChars()); // start by deleting the old object file deleteObjFile(); @@ -652,7 +652,8 @@ llvm::GlobalVariable* gvar = new llvm::GlobalVariable(_type,_isconst,_linkage,NULL,_name,gIR->module); this->ir.irGlobal->value = gvar; - Logger::cout() << *gvar << '\n'; + if (Logger::enabled()) + Logger::cout() << *gvar << '\n'; if (static_local) DtoConstInitGlobal(this);