# HG changeset patch # User Christian Kamm # Date 1216828569 -7200 # Node ID 6590ec13f14d5fb09634ef6c9ae8aa7f496a6dfb # Parent 2bf65352fb283f5e2acf660ab1091570f76a78ca Fixed root cause for Invalid BitCasts. DtoCanLoad continues to return false for aggregates even though llvm 2.4svn could load them. diff -r 2bf65352fb28 -r 6590ec13f14d gen/tollvm.cpp --- a/gen/tollvm.cpp Wed Jul 23 17:55:20 2008 +0200 +++ b/gen/tollvm.cpp Wed Jul 23 17:56:09 2008 +0200 @@ -549,7 +549,8 @@ bool DtoCanLoad(LLValue* ptr) { if (isaPointer(ptr->getType())) { - return ptr->getType()->getContainedType(0)->isFirstClassType(); + const LLType* data = ptr->getType()->getContainedType(0); + return data->isFirstClassType() && !data->isAggregateType(); } return false; } diff -r 2bf65352fb28 -r 6590ec13f14d gen/typinf.cpp --- a/gen/typinf.cpp Wed Jul 23 17:55:20 2008 +0200 +++ b/gen/typinf.cpp Wed Jul 23 17:56:09 2008 +0200 @@ -128,8 +128,8 @@ } } e = new VarExp(0, t->vtinfo); - e = e->addressOf(sc); - e->type = t->vtinfo->type; // do this so we don't get redundant dereference + //e = e->addressOf(sc); + //e->type = t->vtinfo->type; // do this so we don't get redundant dereference return e; }