X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCpeeph.h;h=0c1b2f85ed2ae75e5f25267a376db5156c9fbdfb;hb=bb226788dab3832b0ec0cda70874ce3fce4eebc6;hp=8ada22285ce4353626d5a48a7d90135df1b4276a;hpb=07cbddd43b4358d9f193bdccc860d7563e2aab93;p=fw%2Fsdcc diff --git a/src/SDCCpeeph.h b/src/SDCCpeeph.h index 8ada2228..0c1b2f85 100644 --- a/src/SDCCpeeph.h +++ b/src/SDCCpeeph.h @@ -38,6 +38,8 @@ typedef struct lineNode unsigned int isInline:1; unsigned int isComment:1; unsigned int isDebug:1; + unsigned int isLabel:1; + unsigned int visited:1; struct asmLineNode *aln; struct lineNode *prev; struct lineNode *next; @@ -55,8 +57,24 @@ typedef struct peepRule } peepRule; -void printLine (lineNode *, FILE *); -lineNode *newLineNode (char *); +typedef struct + { + char name[SDCC_NAME_MAX + 1]; + int refCount; + /* needed for deadMove: */ + bool passedLabel; + int jmpToCount; + } +labelHashEntry; + +bool isLabelDefinition (const char *line, const char **start, int *len, + bool isPeepRule); + +extern hTab *labelHash; +labelHashEntry *getLabelRef (const char *label, lineNode *head); + +void printLine (lineNode *, struct dbuf_s *); +lineNode *newLineNode (const char *); lineNode *connectLine (lineNode *, lineNode *); void initPeepHole (void); void peepHole (lineNode **);