Fix #198 and #199 by making CTFE on static struct initializers work.

Renamed SymbolDeclaration to StaticStructInitDeclaration to make its usage clearer.
This commit is contained in:
Christian Kamm
2009-02-01 20:20:56 +01:00
parent 07649678db
commit 01f19c466c
9 changed files with 64 additions and 29 deletions

View File

@@ -179,7 +179,7 @@ DValue* VarExp::toElem(IRState* p)
}
return new DFuncValue(fdecl, func);
}
else if (SymbolDeclaration* sdecl = var->isSymbolDeclaration())
else if (StaticStructInitDeclaration* sdecl = var->isStaticStructInitDeclaration())
{
// this seems to be the static initialiser for structs
Type* sdecltype = sdecl->type->toBasetype();
@@ -205,7 +205,7 @@ LLConstant* VarExp::toConstElem(IRState* p)
{
Logger::print("VarExp::toConstElem: %s | %s\n", toChars(), type->toChars());
LOG_SCOPE;
if (SymbolDeclaration* sdecl = var->isSymbolDeclaration())
if (StaticStructInitDeclaration* sdecl = var->isStaticStructInitDeclaration())
{
// this seems to be the static initialiser for structs
Type* sdecltype = sdecl->type->toBasetype();