mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-17 17:29:02 +02:00
Merge DMD r243: some harmonization with D2 dmd
--- dmd/aggregate.h | 24 ++++- dmd/attrib.c | 63 ++++++---- dmd/attrib.h | 10 +- dmd/declaration.h | 5 +- dmd/func.c | 337 ++++++++++++++++++++++------------------------------- dmd/mars.c | 2 +- dmd/mars.h | 7 + dmd/mtype.h | 13 ++- dmd/parse.c | 32 ++++- dmd/parse.h | 14 ++- dmd/scope.h | 2 +- 11 files changed, 263 insertions(+), 246 deletions(-)
This commit is contained in:
32
dmd/parse.c
32
dmd/parse.c
@@ -149,7 +149,7 @@ Array *Parser::parseDeclDefs(int once)
|
||||
Array *a;
|
||||
Array *aelse;
|
||||
enum PROT prot;
|
||||
unsigned stc;
|
||||
StorageClass stc;
|
||||
Condition *condition;
|
||||
unsigned char *comment;
|
||||
|
||||
@@ -286,6 +286,7 @@ Array *Parser::parseDeclDefs(int once)
|
||||
case TOKpure: stc = STCpure; goto Lstc;
|
||||
case TOKref: stc = STCref; goto Lstc;
|
||||
case TOKtls: stc = STCtls; goto Lstc;
|
||||
case TOKgshared: stc = STCgshared; goto Lstc;
|
||||
//case TOKmanifest: stc = STCmanifest; goto Lstc;
|
||||
#endif
|
||||
|
||||
@@ -514,6 +515,23 @@ Array *Parser::parseDeclDefs(int once)
|
||||
return decldefs;
|
||||
}
|
||||
|
||||
/*********************************************
|
||||
* Give error on conflicting storage classes.
|
||||
*/
|
||||
|
||||
#if DMDV2
|
||||
void Parser::composeStorageClass(StorageClass stc)
|
||||
{
|
||||
StorageClass u = stc;
|
||||
u &= STCconst | STCimmutable | STCmanifest;
|
||||
if (u & (u - 1))
|
||||
error("conflicting storage class %s", Token::toChars(token.value));
|
||||
u = stc;
|
||||
u &= STCgshared | STCshared | STCtls;
|
||||
if (u & (u - 1))
|
||||
error("conflicting storage class %s", Token::toChars(token.value));
|
||||
}
|
||||
#endif
|
||||
|
||||
/********************************************
|
||||
* Parse declarations after an align, protection, or extern decl.
|
||||
@@ -767,7 +785,7 @@ Condition *Parser::parseStaticIfCondition()
|
||||
* Current token is 'this'.
|
||||
*/
|
||||
|
||||
CtorDeclaration *Parser::parseCtor()
|
||||
Dsymbol *Parser::parseCtor()
|
||||
{
|
||||
CtorDeclaration *f;
|
||||
Arguments *arguments;
|
||||
@@ -945,7 +963,7 @@ Arguments *Parser::parseParameters(int *pvarargs)
|
||||
Identifier *ai = NULL;
|
||||
Type *at;
|
||||
Argument *a;
|
||||
unsigned storageClass;
|
||||
StorageClass storageClass = 0;
|
||||
Expression *ae;
|
||||
|
||||
storageClass = STCin; // parameter is "in" by default
|
||||
@@ -1323,7 +1341,7 @@ Lerr:
|
||||
* Parse template parameter list.
|
||||
*/
|
||||
|
||||
TemplateParameters *Parser::parseTemplateParameterList()
|
||||
TemplateParameters *Parser::parseTemplateParameterList(int flag)
|
||||
{
|
||||
TemplateParameters *tpl = new TemplateParameters();
|
||||
|
||||
@@ -2082,8 +2100,8 @@ Type *Parser::parseDeclarator(Type *t, Identifier **pident, TemplateParameters *
|
||||
|
||||
Array *Parser::parseDeclarations()
|
||||
{
|
||||
enum STC storage_class;
|
||||
enum STC stc;
|
||||
StorageClass storage_class;
|
||||
StorageClass stc;
|
||||
Type *ts;
|
||||
Type *t;
|
||||
Type *tfirst;
|
||||
@@ -2338,7 +2356,7 @@ Array *Parser::parseDeclarations()
|
||||
*/
|
||||
|
||||
#if DMDV2
|
||||
Array *Parser::parseAutoDeclarations(unsigned storageClass, unsigned char *comment)
|
||||
Array *Parser::parseAutoDeclarations(StorageClass storageClass, unsigned char *comment)
|
||||
{
|
||||
Array *a = new Array;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user