Mercurial > projects > ldc
changeset 825:a70ddd449e7d
Commented some logging that could be '''very''' long, cuts -vv output size of a gtkd gl sample down 1.2GB by 3/4.
Fixed wrong pointer type for multidimension "deep" slicing.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Thu, 04 Dec 2008 16:11:09 +0100 |
parents | b972fec8a5f5 |
children | ea4c6adf8b00 |
files | gen/arrays.cpp gen/classes.cpp gen/toir.cpp |
diffstat | 3 files changed, 20 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/arrays.cpp Thu Dec 04 14:36:11 2008 +0100 +++ b/gen/arrays.cpp Thu Dec 04 16:11:09 2008 +0100 @@ -189,6 +189,13 @@ assert(0 && "unhandled array init"); } + if (Logger::enabled()) + { + Logger::cout() << "ptr = " << *args[0] << std::endl; + Logger::cout() << "dim = " << *args[1] << std::endl; + Logger::cout() << "val = " << *args[2] << std::endl; + } + LLFunction* fn = LLVM_D_GetRuntimeFunction(gIR->module, funcname); assert(fn); if (Logger::enabled())
--- a/gen/classes.cpp Thu Dec 04 14:36:11 2008 +0100 +++ b/gen/classes.cpp Thu Dec 04 16:11:09 2008 +0100 @@ -255,8 +255,8 @@ 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'; +// if (Logger::enabled()) +// Logger::cout() << "final class type: " << *ts->ir.type->get() << '\n'; // pop state gIR->structs.pop_back(); @@ -582,8 +582,8 @@ // refine type llvm::cast<llvm::OpaqueType>(irstruct->vtblInitTy.get())->refineAbstractTypeTo(irstruct->constVtbl->getType()); - if (Logger::enabled()) - Logger::cout() << "vtbl initializer: " << *irstruct->constVtbl << std::endl; +// if (Logger::enabled()) +// Logger::cout() << "vtbl initializer: " << *irstruct->constVtbl << std::endl; } ////////////////////////////////////////////////////////////////////////////// @@ -760,12 +760,12 @@ // refine __initZ global type to the one of the initializer llvm::cast<llvm::OpaqueType>(irstruct->initOpaque.get())->refineAbstractTypeTo(irstruct->constInit->getType()); - if (Logger::enabled()) - { - Logger::cout() << "class " << cd->toChars() << std::endl; - Logger::cout() << "type " << *cd->type->ir.type->get() << std::endl; - Logger::cout() << "initializer " << *irstruct->constInit << std::endl; - } +// if (Logger::enabled()) +// { +// Logger::cout() << "class " << cd->toChars() << std::endl; +// Logger::cout() << "type " << *cd->type->ir.type->get() << std::endl; +// Logger::cout() << "initializer " << *irstruct->constInit << std::endl; +// } gIR->structs.pop_back(); }
--- a/gen/toir.cpp Thu Dec 04 14:36:11 2008 +0100 +++ b/gen/toir.cpp Thu Dec 04 16:11:09 2008 +0100 @@ -1240,6 +1240,9 @@ { TypeSArray* tsa = (TypeSArray*)etype; elen = DtoConstSize_t(tsa->dim->toUInteger()); + + // in this case, we also need to make sure the pointer is cast to the innermost element type + eptr = DtoBitCast(eptr, DtoType(tsa->nextOf()->pointerTo())); } // for normal code the actual array length is what we want! else