comparison gen/toobj.cpp @ 737:041c1596d217

Removed warnings on ignored aligns. Only do aligment on packed structs, align(1) struct Packed { ... } Changed the way struct/class fields are added, first small part of cleaning up these... Make struct/class/union fields aware of any anonymous struct/union they might be part of, not yet really useful, but part of getting better union support.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 28 Oct 2008 15:41:09 +0100
parents eee9efe5b51f
children dc8b8b7ea0c1
comparison
equal deleted inserted replaced
736:e4e50f4b58cd 737:041c1596d217
989 if (static_local) 989 if (static_local)
990 DtoConstInitGlobal(this); 990 DtoConstInitGlobal(this);
991 else 991 else
992 gIR->constInitList.push_back(this); 992 gIR->constInitList.push_back(this);
993 } 993 }
994
995 // inside aggregate declaration. declare a field.
996 else 994 else
997 { 995 {
998 Logger::println("Aggregate var declaration: '%s' offset=%d", toChars(), offset); 996 assert(ir.irField != 0);
999 997 }
1000 const LLType* _type = DtoType(type);
1001 this->ir.irField = new IrField(this);
1002
1003 // add the field in the IRStruct
1004 gIR->topstruct()->offsets.insert(std::make_pair(offset, IrStruct::Offset(this, _type)));
1005 }
1006
1007 Logger::println("VarDeclaration::toObjFile is done"); 998 Logger::println("VarDeclaration::toObjFile is done");
1008 } 999 }
1009 1000
1010 /* ================================================================== */ 1001 /* ================================================================== */
1011 1002