Removed the 'needsstorage' thing from Dsymbol. Arguments are not always given storage when applicable. This is not longer treat specially

in this regard. Code for accessing nested variables and contexts rewritten. Probably more. Fairly well tested.
This commit is contained in:
Tomas Lindquist Olsen
2008-08-04 02:59:34 +02:00
parent b0a5f554d6
commit daad516579
17 changed files with 232 additions and 259 deletions

View File

@@ -621,9 +621,6 @@ VarDeclaration::VarDeclaration(Loc loc, Type *type, Identifier *id, Initializer
onstack = 0;
canassign = 0;
value = NULL;
// LLVMDC
needsStorage = false;
}
Dsymbol *VarDeclaration::syntaxCopy(Dsymbol *s)
@@ -645,8 +642,6 @@ Dsymbol *VarDeclaration::syntaxCopy(Dsymbol *s)
sv = new VarDeclaration(loc, type ? type->syntaxCopy() : NULL, ident, init);
sv->storage_class = storage_class;
// LLVMDC
sv->needsStorage = needsStorage;
}
#ifdef _DH
// Syntax copy for header file

View File

@@ -266,9 +266,6 @@ struct VarDeclaration : Declaration
// Eliminate need for dynamic_cast
VarDeclaration *isVarDeclaration() { return (VarDeclaration *)this; }
// LLVMDC
bool needsStorage;
};
/**************************************************************/

View File

@@ -3628,7 +3628,6 @@ Expression *SymOffExp::semantic(Scope *sc)
if (v)
{
v->checkNestedReference(sc, loc);
v->needsStorage = true;
}
return this;
}
@@ -3777,7 +3776,6 @@ Expression *VarExp::modifiableLvalue(Scope *sc, Expression *e)
if (v && v->canassign == 0 &&
(var->isConst() || (global.params.Dversion > 1 && var->isFinal())))
error("cannot modify final variable '%s'", var->toChars());
v->needsStorage = true;
if (var->isCtorinit())
{ // It's only modifiable if inside the right constructor
@@ -5991,10 +5989,6 @@ Expression *AddrExp::semantic(Scope *sc)
e = e->semantic(sc);
return e;
}
else if (v)
{
v->needsStorage = true;
}
}
else if (e1->op == TOKarray)
{

View File

@@ -796,11 +796,6 @@ void FuncDeclaration::semantic3(Scope *sc)
if (v->storage_class & STClazy)
v->storage_class |= STCin;
v->semantic(sc2);
#if IN_LLVM
// LLVMDC: the argument needs an addres if we want to attach debug info to it.
if (global.params.symdebug)
v->needsStorage = true;
#endif
if (!sc2->insert(v))
error("parameter %s.%s is already defined", toChars(), v->toChars());
else