From dedc0f4829449673d82b715d53f4c63398843567 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Sun, 3 Aug 2008 16:10:00 +0200 Subject: [PATCH] Fixed problem with using the variable names _arguments and _argptr in non D-style vararg functions. Fixed problem with compiling with LLVM 2.3 --- gen/toir.cpp | 6 ++---- gen/tollvm.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index e558cb3c..e4a91927 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -60,19 +60,17 @@ DValue* VarExp::toElem(IRState* p) Logger::println("VarDeclaration %s", vd->toChars()); // _arguments - if (vd->ident == Id::_arguments) + if (vd->ident == Id::_arguments && p->func()->_arguments) { Logger::println("Id::_arguments"); LLValue* v = p->func()->_arguments; - assert(v); return new DVarValue(type, vd, v, true); } // _argptr - else if (vd->ident == Id::_argptr) + else if (vd->ident == Id::_argptr && p->func()->_argptr) { Logger::println("Id::_argptr"); LLValue* v = p->func()->_argptr; - assert(v); return new DVarValue(type, vd, v, true); } // _dollar diff --git a/gen/tollvm.cpp b/gen/tollvm.cpp index 137d9597..469ee45b 100644 --- a/gen/tollvm.cpp +++ b/gen/tollvm.cpp @@ -556,7 +556,7 @@ bool DtoCanLoad(LLValue* ptr) { if (isaPointer(ptr->getType())) { const LLType* data = ptr->getType()->getContainedType(0); - return data->isFirstClassType() && !data->isAggregateType(); + return data->isFirstClassType() && !(isaStruct(data) || isaArray(data)); } return false; }