diff gen/todebug.cpp @ 797:340acf1535d0

Removed KDevelop3 project files, CMake can generate them just fine! Fixed function literals in static initializers. Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE. Changed errors to go to stderr instead of stdout. Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sat, 29 Nov 2008 21:25:43 +0100
parents e4e50f4b58cd
children 8e6135be6999
line wrap: on
line diff
--- a/gen/todebug.cpp	Sat Nov 29 12:28:10 2008 +0100
+++ b/gen/todebug.cpp	Sat Nov 29 21:25:43 2008 +0100
@@ -452,14 +452,19 @@
         definedCU = DtoDwarfCompileUnit(sd->getModule());
 
         std::vector<LLConstant*> elems;
-        elems.reserve(ir->offsets.size());
-        for (IrStruct::OffsetMap::iterator i=ir->offsets.begin(); i!=ir->offsets.end(); ++i)
+        if (!ir->aggrdecl->isInterfaceDeclaration()) // plain interfaces don't have one
         {
-            unsigned offset = i->first;
-            IrStruct::Offset& o = i->second;
+            std::vector<VarDeclaration*>& arr = ir->varDecls;
+            size_t narr = arr.size();
+            elems.reserve(narr);
+            for (int k=0; k<narr; k++)
+            {
+                VarDeclaration* vd = arr[k];
+                assert(vd);
 
-            LLGlobalVariable* ptr = dwarfMemberType(o.var->loc.linnum, o.var->type, compileUnit, definedCU, o.var->toChars(), offset);
-            elems.push_back(DBG_CAST(ptr));
+                LLGlobalVariable* ptr = dwarfMemberType(vd->loc.linnum, vd->type, compileUnit, definedCU, vd->toChars(), vd->offset);
+                elems.push_back(DBG_CAST(ptr));
+            }
         }
 
         const LLArrayType* at = LLArrayType::get(DBG_TYPE, elems.size());