comparison 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
comparison
equal deleted inserted replaced
619:722630261d62 622:26fce59fe80a
59 if (llvmForceLogging && !logenabled) 59 if (llvmForceLogging && !logenabled)
60 { 60 {
61 Logger::enable(); 61 Logger::enable();
62 } 62 }
63 63
64 Logger::cout() << "Generating module: " << (md ? md->toChars() : toChars()) << '\n'; 64 Logger::println("Generating module: %s\n", (md ? md->toChars() : toChars()));
65 LOG_SCOPE; 65 LOG_SCOPE;
66 66
67 //printf("codegen: %s\n", srcfile->toChars()); 67 printf("codegen: %s\n", srcfile->toChars());
68 68
69 // start by deleting the old object file 69 // start by deleting the old object file
70 deleteObjFile(); 70 deleteObjFile();
71 71
72 // create a new ir state 72 // create a new ir state
650 std::string _name(mangle()); 650 std::string _name(mangle());
651 651
652 llvm::GlobalVariable* gvar = new llvm::GlobalVariable(_type,_isconst,_linkage,NULL,_name,gIR->module); 652 llvm::GlobalVariable* gvar = new llvm::GlobalVariable(_type,_isconst,_linkage,NULL,_name,gIR->module);
653 this->ir.irGlobal->value = gvar; 653 this->ir.irGlobal->value = gvar;
654 654
655 Logger::cout() << *gvar << '\n'; 655 if (Logger::enabled())
656 Logger::cout() << *gvar << '\n';
656 657
657 if (static_local) 658 if (static_local)
658 DtoConstInitGlobal(this); 659 DtoConstInitGlobal(this);
659 else 660 else
660 gIR->constInitList.push_back(this); 661 gIR->constInitList.push_back(this);