diff gen/aa.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 03d7c4aac654
line wrap: on
line diff
--- a/gen/aa.cpp	Sun Sep 28 21:09:21 2008 +0200
+++ b/gen/aa.cpp	Wed Oct 01 18:32:31 2008 +0200
@@ -105,12 +105,16 @@
     llvm::Function* func = LLVM_D_GetRuntimeFunction(gIR->module, "_aaIn");
     const llvm::FunctionType* funcTy = func->getFunctionType();
 
-    Logger::cout() << "_aaIn = " << *func << '\n';
+    if (Logger::enabled())
+        Logger::cout() << "_aaIn = " << *func << '\n';
 
     // aa param
     LLValue* aaval = aa->getRVal();
-    Logger::cout() << "aaval: " << *aaval << '\n';
-    Logger::cout() << "totype: " << *funcTy->getParamType(0) << '\n';
+    if (Logger::enabled())
+    {
+        Logger::cout() << "aaval: " << *aaval << '\n';
+        Logger::cout() << "totype: " << *funcTy->getParamType(0) << '\n';
+    }
     aaval = DtoBitCast(aaval, funcTy->getParamType(0));
 
     // keyti param
@@ -143,12 +147,16 @@
     llvm::Function* func = LLVM_D_GetRuntimeFunction(gIR->module, "_aaDel");
     const llvm::FunctionType* funcTy = func->getFunctionType();
 
-    Logger::cout() << "_aaDel = " << *func << '\n';
+    if (Logger::enabled())
+        Logger::cout() << "_aaDel = " << *func << '\n';
 
     // aa param
     LLValue* aaval = aa->getRVal();
-    Logger::cout() << "aaval: " << *aaval << '\n';
-    Logger::cout() << "totype: " << *funcTy->getParamType(0) << '\n';
+    if (Logger::enabled())
+    {
+        Logger::cout() << "aaval: " << *aaval << '\n';
+        Logger::cout() << "totype: " << *funcTy->getParamType(0) << '\n';
+    }
     aaval = DtoBitCast(aaval, funcTy->getParamType(0));
 
     // keyti param