mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 02:45:25 +03:00
Replace DtoIsTemplateInstance() by Dsymbol::isInstantiated()
The semantics were almost identical, except for DtoIsTemplateInstance() checking the specified Dsymbol and its parents, while isInstantiated() starts from its parent and ignores the symbol itself. After a quick glance, we seem to have fed it with {Aggregate,Func,Var} Declarations only, so should be fine with the default front-end variant.
This commit is contained in:
parent
ad9f9b51a2
commit
ec9caae7fc
9 changed files with 24 additions and 33 deletions
|
@ -795,18 +795,8 @@ DValue *DtoPaintType(Loc &loc, DValue *val, Type *to) {
|
|||
* TEMPLATE HELPERS
|
||||
******************************************************************************/
|
||||
|
||||
TemplateInstance *DtoIsTemplateInstance(Dsymbol *s) {
|
||||
for (; s; s = s->parent) {
|
||||
if (auto ti = s->isTemplateInstance()) {
|
||||
if (!ti->isTemplateMixin())
|
||||
return ti;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool defineOnDeclare(Dsymbol* s) {
|
||||
return global.params.linkonceTemplates && DtoIsTemplateInstance(s);
|
||||
return global.params.linkonceTemplates && s->isInstantiated();
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue