mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-31 11:30:05 +02:00
Merged DMD 1.042.
This commit is contained in:
25
dmd/attrib.c
25
dmd/attrib.c
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user