Mercurial > projects > ldc
changeset 381:6590ec13f14d
Fixed root cause for Invalid BitCasts. DtoCanLoad continues to return false
for aggregates even though llvm 2.4svn could load them.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Wed, 23 Jul 2008 17:56:09 +0200 |
parents | 2bf65352fb28 |
children | 26e0a50c1902 |
files | gen/tollvm.cpp gen/typinf.cpp |
diffstat | 2 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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; }
--- 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; }