diff gen/llvmhelpers.cpp @ 339:385a18242485 trunk

[svn r360] Another mostly rewrite of DtoArrayInit. Should be much more robust now, and probably faster code generated for the most common cases too! Fixed issues with slice initialization (!!!) of multidimensional static arrays. Attempt to fix issue with referencing nested 'this' pointers introduced in DMD 1.033 merge.
author lindquist
date Sun, 13 Jul 2008 01:29:49 +0200
parents 7086a84ab3d6
children a7a26f538d6e
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Sat Jul 12 23:56:56 2008 +0200
+++ b/gen/llvmhelpers.cpp	Sun Jul 13 01:29:49 2008 +0200
@@ -3,6 +3,7 @@
 
 #include "mars.h"
 #include "init.h"
+#include "id.h"
 
 #include "gen/tollvm.h"
 #include "gen/llvmhelpers.h"
@@ -465,6 +466,16 @@
     LLValue* ptr = DtoNestedContext(func);
     assert(ptr && "nested var, but no context");
 
+    // if the nested var is a this pointer it's a class member and not a magic struct
+    // so we're done here!
+    // this happens since 1.033 for some reason... always correct ?
+    if (vd->ident == Id::This)
+    {
+        return ptr;
+    }
+
+    // handle a "normal" nested variable
+
     // we must cast here to be sure. nested classes just have a void*
     ptr = DtoBitCast(ptr, func->ir.irFunc->nestedVar->getType());