Skip to content

Commit

Permalink
genjava: It is possible for a (Values (...)) statement to be left lying
Browse files Browse the repository at this point in the history
around by optimisation passes.  Generate no code for it and move on.
  • Loading branch information
pbroadbery committed Sep 23, 2014
1 parent fb5767a commit 0800f83
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions aldor/aldor/src/java/genjava.c
Expand Up @@ -1443,6 +1443,7 @@ local void gj0SeqGenDefault(GjSeqStore store, Foam foam);
local void gj0SeqSelectMulti(GjSeqStore store, Foam foam);
local void gj0SeqIf(GjSeqStore store, Foam foam);
local void gj0SeqBCall(GjSeqStore store, Foam foam);
local void gj0SeqValues(GjSeqStore store, Foam foam);

local JavaCode gj0SeqSwitchId();

Expand Down Expand Up @@ -1535,6 +1536,9 @@ gj0SeqGen(GjSeqStore seqs, Foam foam)
case FOAM_Cast:
gj0SeqGen(seqs, foam->foamCast.expr);
break;
case FOAM_Values:
gj0SeqValues(seqs, foam);
break;
default:
gj0SeqGenDefault(seqs, foam);
break;
Expand Down Expand Up @@ -1656,6 +1660,17 @@ gj0SeqBCall(GjSeqStore seqs, Foam foam)
gj0SeqStoreAddHalt(seqs, jc);
}

local void
gj0SeqValues(GjSeqStore store, Foam foam)
{
int i;

This comment has been minimized.

Copy link
@pippijn

pippijn Sep 25, 2014

Collaborator

nit: spaces around binary operators.

for (i=0; i<foamArgc(foam); i++) {
FoamTag tag = foamTag(foam->foamValues.argv[i]);
if (tag != FOAM_Loc && tag != FOAM_Lex)
bug("Odd foam found");
}
}

local void
gj0SeqGenDefault(GjSeqStore store, Foam foam)
{
Expand Down

0 comments on commit 0800f83

Please sign in to comment.