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:
David Nadlinger
2013-06-16 18:21:36 +02:00
parent 6a1fef81f4
commit 480d05c76e
2 changed files with 5 additions and 19 deletions

View File

@@ -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");

View File

@@ -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*);