X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCpeeph.h;h=0c1b2f85ed2ae75e5f25267a376db5156c9fbdfb;hb=80972b2e54c9b88f11c27b878874fd2a6a681391;hp=24425238f191b9995497367b76e9a1b830f7ae4e;hpb=ad2cc9865b197e7ac98468cccd2085baa1532f0d;p=fw%2Fsdcc diff --git a/src/SDCCpeeph.h b/src/SDCCpeeph.h index 24425238..0c1b2f85 100644 --- a/src/SDCCpeeph.h +++ b/src/SDCCpeeph.h @@ -28,6 +28,9 @@ #define MAX_PATTERN_LEN 128 +struct asmLineNode; /* defined in each port */ +struct lineNode; + typedef struct lineNode { char *line; @@ -35,6 +38,9 @@ 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; } @@ -51,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 **);