Update svn merge history.
[sdcc.git] / sdcc / src / SDCCpeeph.h
blobaa291cde4a401ac19cc4fa69a25a2a890d29827d
1 /*-------------------------------------------------------------------------
2 SDCCpeeph.h - Header file for The peep hole optimizer: for interpreting
3 the peep hole rules
5 Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net
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
10 later version.
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.
20 -------------------------------------------------------------------------*/
22 #ifndef SDCCPEEPH_H
23 #define SDCCPEEPH_H 1
25 #include "SDCCgen.h"
27 #define MAX_PATTERN_LEN 256
29 typedef struct peepRule
31 lineNode *match;
32 lineNode *replace;
33 unsigned int restart:1;
34 unsigned int barrier:1;
35 char *cond;
36 hTab *vars;
37 struct peepRule *next;
39 peepRule;
41 typedef struct
43 char name[SDCC_NAME_MAX + 1];
44 int refCount;
45 /* needed for deadMove: */
46 bool passedLabel;
47 int jmpToCount;
49 labelHashEntry;
51 bool isLabelDefinition (const char *line, const char **start, int *len,
52 bool isPeepRule);
54 extern hTab *labelHash;
55 labelHashEntry *getLabelRef (const char *label, lineNode *head);
57 void initPeepHole (void);
58 void peepHole (lineNode **);
60 const char * StrStr (const char * str1, const char * str2);
62 #endif