Skip to content

Commit

Permalink
merge D2 pull 382
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Sep 16, 2011
1 parent fe308a1 commit 012bbe3
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/backend/cgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ code *genlinnum(code *c,Srcpos srcpos)
cs.Irex = 0;
cs.IFL1 = 0;
cs.IFL2 = 0;
cs.IEV2.Vsrcpos = srcpos;
cs.IEV1.Vsrcpos = srcpos;
return gen(c,&cs);
}

Expand Down Expand Up @@ -505,7 +505,7 @@ code *genadjesp(code *c, int offset)
cs.Iop = ESCAPE | ESCadjesp;
cs.Iflags = 0;
cs.Irex = 0;
cs.IEV2.Vint = offset;
cs.IEV1.Vint = offset;
return gen(c,&cs);
}
else
Expand All @@ -525,7 +525,7 @@ code *genadjfpu(code *c, int offset)
cs.Iop = ESCAPE | ESCadjfpu;
cs.Iflags = 0;
cs.Irex = 0;
cs.IEV2.Vint = offset;
cs.IEV1.Vint = offset;
return gen(c,&cs);
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/backend/cgsched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ STATIC void getinfo(Cinfo *ci,code *c)

case ESCAPE:
if (c->Iop == (ESCAPE | ESCadjfpu))
ci->fpuadjust = c->IEV2.Vint;
ci->fpuadjust = c->IEV1.Vint;
break;

case 0xD0:
Expand Down
10 changes: 5 additions & 5 deletions src/backend/cod3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2766,7 +2766,7 @@ void assignaddrc(code *c)
if (c->Iop == (ESCAPE | ESCadjesp))
{
//printf("adjusting EBPtoESP (%d) by %ld\n",EBPtoESP,c->IEV2.Vint);
EBPtoESP += c->IEV2.Vint;
EBPtoESP += c->IEV1.Vint;
c->Iop = NOP;
}
if (c->Iop == (ESCAPE | ESCframeptr))
Expand Down Expand Up @@ -4089,7 +4089,7 @@ unsigned codout(code *c)
switch (op & 0xFFFF00)
{ case ESClinnum:
/* put out line number stuff */
objlinnum(c->IEV2.Vsrcpos,OFFSET());
objlinnum(c->IEV1.Vsrcpos,OFFSET());
break;
#if SCPP
#if 1
Expand Down Expand Up @@ -4994,7 +4994,7 @@ void code_hydrate(code **pc)
break;

case ESCAPE | ESClinnum:
srcpos_hydrate(&c->IEV2.Vsrcpos);
srcpos_hydrate(&c->IEV1.Vsrcpos);
goto done;

case ESCAPE | ESCctor:
Expand Down Expand Up @@ -5162,7 +5162,7 @@ void code_dehydrate(code **pc)
break;

case ESCAPE | ESClinnum:
srcpos_dehydrate(&c->IEV2.Vsrcpos);
srcpos_dehydrate(&c->IEV1.Vsrcpos);
goto done;

case ESCAPE | ESCctor:
Expand Down Expand Up @@ -5348,7 +5348,7 @@ void code::print()

if ((op & 0xFF) == ESCAPE)
{ if ((op & 0xFF00) == ESClinnum)
{ printf(" linnum = %d\n",c->IEV2.Vsrcpos.Slinnum);
{ printf(" linnum = %d\n",c->IEV1.Vsrcpos.Slinnum);
return;
}
printf(" ESCAPE %d",c->Iop >> 8);
Expand Down
30 changes: 30 additions & 0 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,36 @@ void Parser::composeStorageClass(StorageClass stc)
}
#endif

/***********************************************
* Parse storage class, lexer is on '@'
*/

#if DMDV2
StorageClass Parser::parseAttribute()
{
nextToken();
StorageClass stc = 0;
if (token.value != TOKidentifier)
{
error("identifier expected after @, not %s", token.toChars());
}
else if (token.ident == Id::property)
stc = STCproperty;
else if (token.ident == Id::safe)
stc = STCsafe;
else if (token.ident == Id::trusted)
stc = STCtrusted;
else if (token.ident == Id::system)
stc = STCsystem;
else if (token.ident == Id::disable)
stc = STCdisable;
else
error("valid attribute identifiers are @property, @safe, @trusted, @system, @disable not @%s", token.toChars());
return stc;
}
#endif


/********************************************
* Parse declarations after an align, protection, or extern decl.
*/
Expand Down
5 changes: 5 additions & 0 deletions src/template.c
Original file line number Diff line number Diff line change
Expand Up @@ -3788,7 +3788,12 @@ void TemplateInstance::semantic(Scope *sc)
// (see bugzilla 4302 and 6602).
tempdecl->instances.remove(tempdecl_instance_idx);
if (target_symbol_list)
{
// Because we added 'this' in the last position above, we
// should be able to remove it without messing other indices up.
assert(target_symbol_list->tdata()[target_symbol_list_idx] == this);
target_symbol_list->remove(target_symbol_list_idx);
}
semanticRun = 0;
inst = NULL;
}
Expand Down

0 comments on commit 012bbe3

Please sign in to comment.