Mercurial > projects > ldc
diff gen/structs.h @ 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 | 5a2983f97498 |
children | af7a6faf9406 |
line wrap: on
line diff
--- a/gen/structs.h Sat Nov 29 12:28:10 2008 +0100 +++ b/gen/structs.h Sat Nov 29 21:25:43 2008 +0100 @@ -33,43 +33,4 @@ // index a struct one level LLValue* DtoIndexStruct(LLValue* src, StructDeclaration* sd, VarDeclaration* vd); -struct DUnionField -{ - unsigned offset; - size_t size; - std::vector<const LLType*> types; - LLConstant* init; - size_t initsize; - - DUnionField() { - offset = 0; - size = 0; - init = NULL; - initsize = 0; - } -}; - -struct DUnionIdx -{ - unsigned idx,idxos; - LLConstant* c; - - DUnionIdx() - : idx(0), c(0) {} - DUnionIdx(unsigned _idx, unsigned _idxos, LLConstant* _c) - : idx(_idx), idxos(_idxos), c(_c) {} - bool operator<(const DUnionIdx& i) const { - return (idx < i.idx) || (idx == i.idx && idxos < i.idxos); - } -}; - -class DUnion -{ - std::vector<DUnionField> fields; - bool ispacked; -public: - DUnion(); - LLConstant* getConst(std::vector<DUnionIdx>& in); -}; - #endif