diff gen/functions.cpp @ 329:8c1dc3e705da trunk

[svn r350] Fixed incorrect function types for lazy arguments. looks like lazy arguments have never even worked :o well.. now they should.
author lindquist
date Fri, 11 Jul 2008 01:34:04 +0200
parents 7086a84ab3d6
children 20446d22f832
line wrap: on
line diff
--- a/gen/functions.cpp	Fri Jul 11 00:17:00 2008 +0200
+++ b/gen/functions.cpp	Fri Jul 11 01:34:04 2008 +0200
@@ -141,6 +141,17 @@
             paramvec.push_back(at);
         }
 
+        // handle lazy args
+        if (arg->storageClass & STClazy)
+        {
+            Logger::cout() << "for lazy got: " << *paramvec.back() << '\n';
+            TypeFunction *ltf = new TypeFunction(NULL, arg->type, 0, LINKd);
+            TypeDelegate *ltd = new TypeDelegate(ltf);
+            at = getPtrToType(DtoType(ltd));
+            Logger::cout() << "lazy updated to: " << *at << '\n';
+            paramvec.back() = at;
+        }
+
         if (arg->llvmByVal)
             nbyval++;
     }