X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCClabel.c;h=0b6f7c0ea1b1f56ad8585e1820c10869579f178c;hb=f0be1f29144f92632436c652a47b7f29dcefb86a;hp=5c26ce6739381c4b6e41874126b4cae62374e45d;hpb=29779804200986ce903b5086441b49265a122dc5;p=fw%2Fsdcc diff --git a/src/SDCClabel.c b/src/SDCClabel.c index 5c26ce67..0b6f7c0e 100644 --- a/src/SDCClabel.c +++ b/src/SDCClabel.c @@ -28,7 +28,7 @@ hTab *labelRef = NULL; hTab *labelDef = NULL; /*-----------------------------------------------------------------*/ -/* buildLabelRefTable - creates an hashTable of label referneces */ +/* buildLabelRefTable - creates an hashTable of label references */ /*-----------------------------------------------------------------*/ void buildLabelRefTable (iCode * ic) @@ -83,7 +83,7 @@ labelGotoNext (iCode * ic) if (loop->op == GOTO && /* if this is a goto */ loop->next && /* and we have a next one */ loop->next->op == LABEL && /* next one is a label */ - loop->next->argLabel.label->key == loop->argLabel.label->key) /* same label */ + loop->next->label->key == loop->label->key) /* same label */ { loop->prev->next = loop->next; /* get this out of the chain */ loop->next->prev = loop->prev; @@ -121,7 +121,9 @@ labelIfx (iCode * ic) { /* get rid of this if */ - werror (W_CONTROL_FLOW, loop->filename, loop->lineno); + if (!options.lessPedantic) { + werror (W_CONTROL_FLOW, loop->filename, loop->lineno); + } loop->prev->next = loop->next; loop->next->prev = loop->prev; hTabDeleteItem (&labelRef, @@ -136,7 +138,9 @@ labelIfx (iCode * ic) IC_FALSE (loop)->key == IC_LABEL (loop->next)->key) { /* get rid of this if */ - werror (W_CONTROL_FLOW, loop->filename, loop->lineno); + if (!options.lessPedantic) { + werror (W_CONTROL_FLOW, loop->filename, loop->lineno); + } loop->prev->next = loop->next; loop->next->prev = loop->prev; hTabDeleteItem (&labelRef, @@ -156,8 +160,9 @@ labelIfx (iCode * ic) ((IC_TRUE (loop) && IC_TRUE (loop)->key == IC_LABEL (loop->next)->key) || (IC_FALSE (loop) && IC_FALSE (loop)->key == IC_LABEL (loop->next)->key))) { - - werror (W_CONTROL_FLOW, loop->filename, loop->lineno); + if (!options.lessPedantic) { + werror (W_CONTROL_FLOW, loop->filename, loop->lineno); + } loop->prev->next = loop->next; loop->next->prev = loop->prev; hTabDeleteItem (&labelRef, @@ -281,7 +286,7 @@ labelGotoGoto (iCode * ic) stat->next != loop) { - symbol *repLabel = stat->next->argLabel.label; /* replace with label */ + symbol *repLabel = stat->next->label; /* replace with label */ /* if they are the same then continue */ if (repLabel->key == sLabel->key) @@ -294,7 +299,7 @@ labelGotoGoto (iCode * ic) case GOTO: /* for a goto statement */ hTabDeleteItem (&labelRef, (IC_LABEL (loop))->key, loop, DELETE_ITEM, NULL); - loop->argLabel.label = repLabel; + loop->label = repLabel; hTabAddItem (&labelRef, repLabel->key, loop); break; @@ -322,7 +327,7 @@ labelGotoGoto (iCode * ic) } /*-----------------------------------------------------------------*/ -/* labelUnrefLabel - remove unreferneced labels */ +/* labelUnrefLabel - remove unreferenced labels */ /*-----------------------------------------------------------------*/ int labelUnrefLabel (iCode * ic) @@ -336,9 +341,6 @@ labelUnrefLabel (iCode * ic) /* if this is a label */ if (loop->op == LABEL) { - set *refs; - - refs = NULL; if (((IC_LABEL (loop))->key == returnLabel->key) || ((IC_LABEL (loop))->key == entryLabel->key)) continue;