diff gen/classes.cpp @ 1253:752bed475b75

Fixed classinfo.interfaces for .. interfaces!
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Tue, 21 Apr 2009 20:19:53 +0200
parents 7c1b55db4ff3
children ec1d9dc1d32a
line wrap: on
line diff
--- a/gen/classes.cpp	Tue Apr 21 19:32:22 2009 +0200
+++ b/gen/classes.cpp	Tue Apr 21 20:19:53 2009 +0200
@@ -58,18 +58,22 @@
     // emit the ClassZ symbol
     LLGlobalVariable* ClassZ = irstruct->getClassInfoSymbol();
 
+    // emit the interfaceInfosZ symbol if necessary
+    if (cd->vtblInterfaces && cd->vtblInterfaces->dim > 0)
+        irstruct->getInterfaceArraySymbol(); // initializer is applied when it's built
+
     // interface only emit typeinfo and classinfo
-    if (!cd->isInterfaceDeclaration())
+    if (cd->isInterfaceDeclaration())
+    {
+        irstruct->initializeInterface();
+    }
+    else
     {
         // emit the initZ symbol
         LLGlobalVariable* initZ = irstruct->getInitSymbol();
         // emit the vtblZ symbol
         LLGlobalVariable* vtblZ = irstruct->getVtblSymbol();
 
-        // emit the interfaceInfosZ symbol if necessary
-        if (cd->vtblInterfaces && cd->vtblInterfaces->dim > 0)
-            irstruct->getInterfaceArraySymbol(); // initializer is applied when it's built
-
         // perform definition
         if (needs_def)
         {