diff gen/structs.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 a15ccbf7451d
line wrap: on
line diff
--- a/gen/structs.cpp	Sun Sep 28 21:09:21 2008 +0200
+++ b/gen/structs.cpp	Wed Oct 01 18:32:31 2008 +0200
@@ -29,7 +29,9 @@
     DtoResolveDsymbol(si->ad);
 
     const llvm::StructType* structtype = isaStruct(ts->ir.type->get());
-    Logger::cout() << "llvm struct type: " << *structtype << '\n';
+
+    if (Logger::enabled())
+        Logger::cout() << "llvm struct type: " << *structtype << '\n';
 
     assert(si->value.dim == si->vars.dim);
 
@@ -61,8 +63,11 @@
     const LLType* llt = getPtrToType(DtoType(t));
     const LLType* st = getPtrToType(DtoType(sd->type));
 
-    Logger::cout() << "ptr = " << *ptr << '\n';
-    Logger::cout() << "st  = " << *st << '\n';
+    if (Logger::enabled())
+    {
+        Logger::cout() << "ptr = " << *ptr << '\n';
+        Logger::cout() << "st  = " << *st << '\n';
+    }
 
     if (ptr->getType() != st) {
         assert(sd->ir.irStruct->hasUnions);