1 /*------------------------------------------------------------------------- 2 SDCCpeeph.h - Header file for The peep hole optimizer: for interpreting 3 the peep hole rules 4 5 Copyright (C) 1999, Sandeep Dutta . sandeep.dutta@usa.net 6 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. 11 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. 16 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 -------------------------------------------------------------------------*/ 21 22 #ifndef SDCCPEEPH_H 23 #define SDCCPEEPH_H 1 24 25 #include "SDCCgen.h" 26 27 #define MAX_PATTERN_LEN 256 28 29 typedef struct peepRule 30 { 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; 38 } 39 peepRule; 40 41 typedef struct 42 { 43 char name[SDCC_NAME_MAX + 1]; 44 int refCount; 45 /* needed for deadMove: */ 46 bool passedLabel; 47 int jmpToCount; 48 } 49 labelHashEntry; 50 51 bool isLabelDefinition (const char *line, const char **start, int *len, 52 bool isPeepRule); 53 54 extern hTab *labelHash; 55 labelHashEntry *getLabelRef (const char *label, lineNode *head); 56 57 void initPeepHole (void); 58 void peepHole (lineNode **); 59 60 const char * StrStr (const char * str1, const char * str2); 61 62 #endif 63