Ensure all logging of llvm values/types is only called when -vv is passed

This commit is contained in:
Tomas Lindquist Olsen 2008-11-29 23:39:04 +01:00
parent d522fef71f
commit dcf3c96f65
2 changed files with 11 additions and 6 deletions

View file

@ -247,6 +247,7 @@ void DtoResolveClass(ClassDeclaration* cd)
llvm::cast<llvm::OpaqueType>(irstruct->vtblTy.get())->refineAbstractTypeTo(LLArrayType::get(getVoidPtrType(), cd->vtbl.dim));
// log
if (Logger::enabled())
Logger::cout() << "final class type: " << *ts->ir.type->get() << '\n';
// pop state

View file

@ -430,11 +430,14 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
}
#if 1
if (Logger::enabled())
{
Logger::println("%lu params passed", args.size());
for (int i=0; i<args.size(); ++i) {
assert(args[i]);
Logger::cout() << "arg["<<i<<"] = " << *args[i] << '\n';
}
}
#endif
// void returns cannot not be named
@ -442,6 +445,7 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
if (callableTy->getReturnType() != LLType::VoidTy)
varname = "tmp";
if (Logger::enabled())
Logger::cout() << "Calling: " << *callable << '\n';
// call the function