Mercurial > projects > ldc
diff gen/functions.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 | fbb1a366cfbc |
children | df196c8dea26 |
line wrap: on
line diff
--- a/gen/functions.cpp Sun Sep 28 21:09:21 2008 +0200 +++ b/gen/functions.cpp Wed Oct 01 18:32:31 2008 +0200 @@ -164,11 +164,16 @@ // handle lazy args if (arg->storageClass & STClazy) { - Logger::cout() << "for lazy got: " << *paramvec.back() << '\n'; + if (Logger::enabled()) + Logger::cout() << "for lazy got: " << *paramvec.back() << '\n'; + TypeFunction *ltf = new TypeFunction(NULL, arg->type, 0, LINKd); TypeDelegate *ltd = new TypeDelegate(ltf); at = getPtrToType(DtoType(ltd)); - Logger::cout() << "lazy updated to: " << *at << '\n'; + + if (Logger::enabled()) + Logger::cout() << "lazy updated to: " << *at << '\n'; + paramvec.back() = at; // lazy doesn't need byval as the delegate is not visible to the user } @@ -289,6 +294,8 @@ Logger::println("DtoResolveFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars()); LOG_SCOPE; + //printf("resolve function: %s\n", fdecl->toPrettyChars()); + if (fdecl->parent) if (TemplateInstance* tinst = fdecl->parent->isTemplateInstance()) { @@ -391,6 +398,8 @@ Logger::println("DtoDeclareFunction(%s): %s", fdecl->toPrettyChars(), fdecl->loc.toChars()); LOG_SCOPE; + //printf("declare function: %s\n", fdecl->toPrettyChars()); + // intrinsic sanity check if (fdecl->llvmInternal == LLVMintrinsic && fdecl->fbody) { error(fdecl->loc, "intrinsics cannot have function bodies"); @@ -530,7 +539,8 @@ else assert(func->getLinkage() != llvm::GlobalValue::InternalLinkage); - Logger::cout() << "func decl: " << *func << '\n'; + if (Logger::enabled()) + Logger::cout() << "func decl: " << *func << '\n'; } //////////////////////////////////////////////////////////////////////////////////////////