mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-01 12:33:13 +01:00
Removed unused and broken template instantiation origin detection.
Having something like this would be useful in determining whether to define a given template symbol during codegen, but the frontend sometimes produces TemplateInstances in a scope where sc->tinst has not been semantic'd, thus breaking the chaining mechanism.
This commit is contained in:
@@ -4778,11 +4778,10 @@ TemplateInstance::TemplateInstance(Loc loc, Identifier *ident)
|
||||
this->havetempdecl = 0;
|
||||
this->enclosing = NULL;
|
||||
this->speculative = 0;
|
||||
this->ignore = true;
|
||||
|
||||
#if IN_LLVM
|
||||
this->ignore = true;
|
||||
this->emittedInModule = NULL;
|
||||
this->tmodule = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -4812,12 +4811,10 @@ TemplateInstance::TemplateInstance(Loc loc, TemplateDeclaration *td, Objects *ti
|
||||
this->havetempdecl = 1;
|
||||
this->enclosing = NULL;
|
||||
this->speculative = 0;
|
||||
this->ignore = true;
|
||||
|
||||
#if IN_LLVM
|
||||
this->tinst = NULL;
|
||||
this->ignore = true;
|
||||
this->emittedInModule = NULL;
|
||||
this->tmodule = NULL;
|
||||
#endif
|
||||
|
||||
assert(tempdecl->scope);
|
||||
@@ -4962,10 +4959,11 @@ void TemplateInstance::semantic(Scope *sc, Expressions *fargs)
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#if IN_LLVM
|
||||
if (!sc->ignoreTemplates)
|
||||
ignore = false;
|
||||
|
||||
#endif
|
||||
|
||||
// get the enclosing template instance from the scope tinst
|
||||
tinst = sc->tinst;
|
||||
@@ -4980,17 +4978,6 @@ void TemplateInstance::semantic(Scope *sc, Expressions *fargs)
|
||||
return;
|
||||
}
|
||||
semanticRun = PASSsemantic;
|
||||
#if IN_LLVM
|
||||
// get the enclosing template instance from the scope tinst
|
||||
tinst = sc->tinst;
|
||||
|
||||
// get the module of the outermost enclosing instantiation
|
||||
if (tinst)
|
||||
tmodule = tinst->tmodule;
|
||||
else
|
||||
tmodule = sc->module;
|
||||
//printf("%s in %s\n", toChars(), tmodule->toChars());
|
||||
#endif
|
||||
|
||||
#if LOG
|
||||
printf("\tdo semantic\n");
|
||||
|
||||
@@ -354,7 +354,6 @@ struct TemplateInstance : ScopeDsymbol
|
||||
|
||||
#if IN_LLVM
|
||||
bool ignore; // true if the instance must be ignored when codegen'ing
|
||||
Module* tmodule; // module from outermost enclosing template instantiation
|
||||
Module* emittedInModule; // which module this template instance has been emitted in
|
||||
|
||||
void codegen(Ir*);
|
||||
|
||||
Reference in New Issue
Block a user