Mercurial > projects > ldc
comparison gen/structs.cpp @ 171:95f07e3f8bb9 trunk
[svn r187] Fixed missing definitions of instances of imported struct template declarations.
author | lindquist |
---|---|
date | Tue, 06 May 2008 05:25:53 +0200 |
parents | 2df270e1ba59 |
children | db9890b3fb64 |
comparison
equal
deleted
inserted
replaced
170:6476da35a0fe | 171:95f07e3f8bb9 |
---|---|
173 if (gIR->irDsymbol[sd].resolved) return; | 173 if (gIR->irDsymbol[sd].resolved) return; |
174 gIR->irDsymbol[sd].resolved = true; | 174 gIR->irDsymbol[sd].resolved = true; |
175 | 175 |
176 Logger::println("DtoResolveStruct(%s): %s", sd->toChars(), sd->loc.toChars()); | 176 Logger::println("DtoResolveStruct(%s): %s", sd->toChars(), sd->loc.toChars()); |
177 LOG_SCOPE; | 177 LOG_SCOPE; |
178 | |
179 if (sd->prot() == PROTprivate && sd->getModule() != gIR->dmodule) | |
180 Logger::println("using a private struct from outside its module"); | |
178 | 181 |
179 TypeStruct* ts = (TypeStruct*)DtoDType(sd->type); | 182 TypeStruct* ts = (TypeStruct*)DtoDType(sd->type); |
180 | 183 |
181 IrStruct* irstruct = new IrStruct(ts); | 184 IrStruct* irstruct = new IrStruct(ts); |
182 gIR->irDsymbol[sd].irStruct = irstruct; | 185 gIR->irDsymbol[sd].irStruct = irstruct; |
335 llvm::GlobalValue::LinkageTypes _linkage = DtoExternalLinkage(sd); | 338 llvm::GlobalValue::LinkageTypes _linkage = DtoExternalLinkage(sd); |
336 llvm::GlobalVariable* initvar = new llvm::GlobalVariable(gIR->irType[ts].type->get(), true, _linkage, NULL, initname, gIR->module); | 339 llvm::GlobalVariable* initvar = new llvm::GlobalVariable(gIR->irType[ts].type->get(), true, _linkage, NULL, initname, gIR->module); |
337 gIR->irDsymbol[sd].irStruct->init = initvar; | 340 gIR->irDsymbol[sd].irStruct->init = initvar; |
338 | 341 |
339 gIR->constInitList.push_back(sd); | 342 gIR->constInitList.push_back(sd); |
340 if (sd->getModule() == gIR->dmodule) | 343 if (DtoIsTemplateInstance(sd) || sd->getModule() == gIR->dmodule) |
341 gIR->defineList.push_back(sd); | 344 gIR->defineList.push_back(sd); |
342 } | 345 } |
343 | 346 |
344 ////////////////////////////////////////////////////////////////////////////////////////// | 347 ////////////////////////////////////////////////////////////////////////////////////////// |
345 | 348 |