From 44931493f63ee52b50c2321bfc4286bb3ccca0cc Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 23 Jul 2008 17:56:09 +0200 Subject: [PATCH] Fixed root cause for Invalid BitCasts. DtoCanLoad continues to return false for aggregates even though llvm 2.4svn could load them. --- gen/tollvm.cpp | 3 ++- gen/typinf.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index af022115..f78712d1 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -549,7 +549,8 @@ void DtoStore(LLValue* src, LLValue* dst) 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 --git a/gen/typinf.cpp b/gen/typinf.cpp index e74af3fe..e44a4d05 100644 --- a/gen/typinf.cpp +++ b/gen/typinf.cpp @@ -128,8 +128,8 @@ Expression *Type::getTypeInfo(Scope *sc) } } 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; }