[hackers] [scc] [cc2] Add a ONOP statement for every label || Roberto E. Vargas Caballero
commit 25458d1f56c528c6838f840c289b0cd91301cd19
Author: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
AuthorDate: Sat Apr 23 17:20:24 2016 +0200
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Sat Apr 23 17:20:24 2016 +0200
[cc2] Add a ONOP statement for every label
This nop statement helps to have some statement in the same position
where the label is set. We do not depend of being the last statement
or setting some variable for the next statement.
diff --git a/cc2/parser.c b/cc2/parser.c
index c85b281..f8448bb 100644
--- a/cc2/parser.c
+++ b/cc2/parser.c
_AT_@ -569,20 +569,6 @@ flddecl(void)
}
static void
-labeldcl(void)
-{
- Node *np;
- Symbol *sym;
-
- np = pop();
- sym = np->u.sym;
- delnode(np);
- nextline();
- stmtp->label = sym;
- sym->u.nlabel = stmtp;
-}
-
-static void
addstmt(Node *np)
{
if (!curfun->u.nlabel)
_AT_@ -593,6 +579,20 @@ addstmt(Node *np)
}
static void
+labeldcl(void)
+{
+ Node *np;
+ Symbol *sym;
+
+ np = pop();
+ np->op = ONOP;
+ sym = np->u.sym;
+ sym->kind = SLABEL;
+ np->label = sym;
+ addstmt(np);
+}
+
+static void
stmt(void)
{
Node *np;
Received on Sun Apr 24 2016 - 17:29:37 CEST
This archive was generated by hypermail 2.3.0
: Sun Apr 24 2016 - 17:36:19 CEST