changeset 464:e381e082d5cb

Fixed problem with using the variable names _arguments and _argptr in non D-style vararg functions. Fixed problem with compiling with LLVM 2.3
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 03 Aug 2008 16:10:00 +0200
parents 3a5d6ff8c70f
children 5bd9a617d297
files gen/toir.cpp gen/tollvm.cpp
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gen/toir.cpp	Sat Aug 02 22:54:46 2008 +0200
+++ b/gen/toir.cpp	Sun Aug 03 16:10:00 2008 +0200
@@ -60,19 +60,17 @@
         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
--- a/gen/tollvm.cpp	Sat Aug 02 22:54:46 2008 +0200
+++ b/gen/tollvm.cpp	Sun Aug 03 16:10:00 2008 +0200
@@ -556,7 +556,7 @@
 {
     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;
 }