mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-03 19:13:15 +01:00
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.
This commit is contained in:
@@ -189,6 +189,13 @@ void DtoArrayInit(Loc& loc, DValue* array, DValue* value)
|
||||
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())
|
||||
|
||||
@@ -255,8 +255,8 @@ 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';
|
||||
// if (Logger::enabled())
|
||||
// Logger::cout() << "final class type: " << *ts->ir.type->get() << '\n';
|
||||
|
||||
// pop state
|
||||
gIR->structs.pop_back();
|
||||
@@ -582,8 +582,8 @@ static void init_class_vtbl_initializer(ClassDeclaration* cd)
|
||||
// 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 @@ void DtoConstInitClass(ClassDeclaration* cd)
|
||||
// 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();
|
||||
}
|
||||
|
||||
@@ -1240,6 +1240,9 @@ DValue* SliceExp::toElem(IRState* p)
|
||||
{
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user