Diff reduction: Remove Scope::ignoreTemplates and friends.

It is unused since my change to the way codegen is
driven. If we want to optimize template codegen again,
we should do it properly, contributing the changes back
to DMD.
This commit is contained in:
David Nadlinger
2013-10-18 23:09:50 +02:00
committed by Kai Nacke
parent 5ac894c32d
commit 01b6d55770
6 changed files with 0 additions and 19 deletions

View File

@@ -7088,7 +7088,6 @@ void TypeTypeof::resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol
Scope *sc2 = sc->push();
sc2->intypeof = 1;
sc2->speculative = true;
sc2->ignoreTemplates++;
sc2->flags |= sc->flags & SCOPEstaticif;
unsigned oldspecgag = global.speculativeGag;
if (global.gag)

View File

@@ -79,7 +79,6 @@ Scope::Scope()
this->intypeof = 0;
this->speculative = 0;
this->parameterSpecialization = 0;
this->ignoreTemplates = 0;
this->callSuper = 0;
this->flags = 0;
this->lastdc = NULL;
@@ -131,7 +130,6 @@ Scope::Scope(Scope *enclosing)
this->intypeof = enclosing->intypeof;
this->speculative = enclosing->speculative;
this->parameterSpecialization = enclosing->parameterSpecialization;
this->ignoreTemplates = enclosing->ignoreTemplates;
this->callSuper = enclosing->callSuper;
this->flags = (enclosing->flags & (SCOPEcontract | SCOPEdebug));
this->lastdc = NULL;

View File

@@ -95,10 +95,6 @@ struct Scope
int noaccesscheck; // don't do access checks
int needctfe; // inside a ctfe-only expression
#if IN_LLVM
int ignoreTemplates; // set if newly instantiated templates should be ignored when codegen'ing
#endif
unsigned callSuper; // primitive flow analysis for constructors
structalign_t structalign; // alignment for struct members

View File

@@ -55,7 +55,6 @@ void StaticAssert::semantic2(Scope *sc)
ScopeDsymbol *sd = new ScopeDsymbol();
sc = sc->push(sd);
sc->flags |= SCOPEstaticassert;
++sc->ignoreTemplates;
Expression *e = exp->ctfeSemantic(sc);
e = resolveProperties(sc, e);
sc = sc->pop();

View File

@@ -1850,7 +1850,6 @@ Lmatch:
*/
makeParamNamesVisibleInConstraint(paramscope, fargs);
Expression *e = constraint->syntaxCopy();
paramscope->ignoreTemplates++;
paramscope->flags |= SCOPEstaticif;
/* Detect recursive attempts to instantiate this template declaration,
@@ -4780,7 +4779,6 @@ TemplateInstance::TemplateInstance(Loc loc, Identifier *ident)
this->speculative = 0;
#if IN_LLVM
this->ignore = true;
this->emittedInModule = NULL;
#endif
}
@@ -4813,7 +4811,6 @@ TemplateInstance::TemplateInstance(Loc loc, TemplateDeclaration *td, Objects *ti
this->speculative = 0;
#if IN_LLVM
this->ignore = true;
this->emittedInModule = NULL;
#endif
@@ -4960,11 +4957,6 @@ void TemplateInstance::semantic(Scope *sc, Expressions *fargs)
return;
}
#if IN_LLVM
if (!sc->ignoreTemplates)
ignore = false;
#endif
// get the enclosing template instance from the scope tinst
tinst = sc->tinst;
@@ -6309,8 +6301,6 @@ void TemplateInstance::semantic3(Scope *sc)
sc = sc->push(argsym);
sc = sc->push(this);
sc->tinst = this;
if (ignore)
sc->ignoreTemplates++;
int oldgag = global.gag;
int olderrors = global.errors;
/* If this is a speculative instantiation, gag errors.

View File

@@ -353,7 +353,6 @@ struct TemplateInstance : ScopeDsymbol
AliasDeclaration *isAliasDeclaration();
#if IN_LLVM
bool ignore; // true if the instance must be ignored when codegen'ing
Module* emittedInModule; // which module this template instance has been emitted in
void codegen(IRState*);