Mercurial > projects > ldc
comparison gen/toir.cpp @ 487:d7b2e8777e2b
Make struct literals work with typedefs.
Fixes run/s/struct_initialization_13_A and run/t/typedef_20_A
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 10 Aug 2008 10:40:26 +0200 |
parents | a34078905d01 |
children | 0d286cd9fd08 |
comparison
equal
deleted
inserted
replaced
486:a34078905d01 | 487:d7b2e8777e2b |
---|---|
2170 | 2170 |
2171 LLValue* sptr = DtoAlloca(llt,"tmpstructliteral"); | 2171 LLValue* sptr = DtoAlloca(llt,"tmpstructliteral"); |
2172 | 2172 |
2173 // default init the struct to take care of padding | 2173 // default init the struct to take care of padding |
2174 // and unspecified members | 2174 // and unspecified members |
2175 TypeStruct* ts = (TypeStruct*)type; | 2175 TypeStruct* ts = (TypeStruct*)type->toBasetype(); |
2176 assert(ts->sym); | 2176 assert(ts->sym); |
2177 DtoForceConstInitDsymbol(ts->sym); | 2177 DtoForceConstInitDsymbol(ts->sym); |
2178 assert(ts->sym->ir.irStruct->init); | 2178 assert(ts->sym->ir.irStruct->init); |
2179 DtoAggrCopy(sptr, ts->sym->ir.irStruct->init); | 2179 DtoAggrCopy(sptr, ts->sym->ir.irStruct->init); |
2180 | 2180 |