Merged DMD 1.042.

This commit is contained in:
Tomas Lindquist Olsen
2009-04-03 17:59:34 +02:00
parent 57bf95cb42
commit 3d1f8cc565
38 changed files with 6504 additions and 5232 deletions

View File

@@ -1,6 +1,6 @@
// Compiler implementation of the D programming language
// Copyright (c) 1999-2008 by Digital Mars
// Copyright (c) 1999-2009 by Digital Mars
// All Rights Reserved
// written by Walter Bright
// http://www.digitalmars.com
@@ -322,7 +322,7 @@ void StorageClassDeclaration::semantic(Scope *sc)
sc->stc = stc;
}
void StorageClassDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
void StorageClassDeclaration::stcToCBuffer(OutBuffer *buf, int stc)
{
struct SCstring
{
@@ -350,18 +350,19 @@ void StorageClassDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
// { STCtls, TOKtls },
};
int written = 0;
for (int i = 0; i < sizeof(table)/sizeof(table[0]); i++)
{
if (stc & table[i].stc)
{
if (written)
buf->writeByte(' ');
written = 1;
buf->writestring(Token::toChars(table[i].tok));
buf->writeByte(' ');
}
}
}
void StorageClassDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
stcToCBuffer(buf, stc);
AttribDeclaration::toCBuffer(buf, hgs);
}
@@ -1193,6 +1194,18 @@ void PragmaDeclaration::toObjFile(int multiobj)
name[se->len] = 0;
obj_includelib(name);
}
#if DMDV2
else if (ident == Id::startaddress)
{
assert(args && args->dim == 1);
Expression *e = (Expression *)args->data[0];
Dsymbol *sa = getDsymbol(e);
FuncDeclaration *f = sa->isFuncDeclaration();
assert(f);
Symbol *s = f->toSymbol();
obj_startaddress(s);
}
#endif
AttribDeclaration::toObjFile(multiobj);
}
#endif