1 /*-------------------------------------------------------------------------
2 SDCCpeeph.h - Header file for The peep hole optimizer: for interpreting
5 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1999)
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 In other words, you are welcome to use, share and improve this program.
22 You are forbidden to forbid anyone else to use, share and improve
23 what you give them. Help stamp out software-hoarding!
24 -------------------------------------------------------------------------*/
29 #define MAX_PATTERN_LEN 128
31 struct asmLineNode; /* defined in each port */
34 typedef struct lineNode
38 unsigned int isInline:1;
39 unsigned int isComment:1;
40 unsigned int isDebug:1;
41 unsigned int isLabel:1;
42 unsigned int visited:1;
43 struct asmLineNode *aln;
44 struct lineNode *prev;
45 struct lineNode *next;
49 typedef struct peepRule
53 unsigned int restart:1;
56 struct peepRule *next;
62 char name[SDCC_NAME_MAX + 1];
64 /* needed for deadMove: */
70 bool isLabelDefinition (const char *line, const char **start, int *len,
73 extern hTab *labelHash;
74 labelHashEntry *getLabelRef (const char *label, lineNode *head);
76 void printLine (lineNode *, struct dbuf_s *);
77 lineNode *newLineNode (const char *);
78 lineNode *connectLine (lineNode *, lineNode *);
79 void initPeepHole (void);
80 void peepHole (lineNode **);