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:
Martin Kinkelin 2020-10-26 03:34:31 +01:00
parent ad9f9b51a2
commit ec9caae7fc
9 changed files with 24 additions and 33 deletions

View file

@ -578,18 +578,21 @@ void DtoDeclareFunction(FuncDeclaration *fdecl, const bool willDefine) {
bool defineAtEnd = false;
bool defineAsAvailableExternally = false;
if (willDefine) {
// will be defined anyway after declaration
} else if (defineOnDeclare(fdecl)) {
Logger::println("Function is inside a linkonce_odr template, will be "
"defined after declaration.");
if (fdecl->semanticRun < PASSsemantic3done) {
// this can e.g. happen for special __xtoHash member functions
Logger::println("Function hasn't had sema3 run yet, running it now.");
const bool semaSuccess = fdecl->functionSemantic3();
assert(semaSuccess);
Module::runDeferredSemantic3();
}
IF_LOG Logger::println("Function is inside a linkonce_odr template, will "
"be defined after declaration.");
defineAtEnd = true;
} else if (defineAsExternallyAvailable(*fdecl)) {
IF_LOG Logger::println("Function is an externally_available inline "
"candidate, will be defined after declaration.");
Logger::println("Function is an externally_available inline candidate, "
"will be defined after declaration.");
defineAtEnd = true;
defineAsAvailableExternally = true;
}