]> git.gag.com Git - fw/sdcc/blobdiff - src/pic/pcodepeep.c
* src/pic/*.[ch]: removed dead/replaced code, no functional changes
[fw/sdcc] / src / pic / pcodepeep.c
index d80d8f3f4cb13838d8445fdb85e3821ca02b9791..129158937e6f6e782c6f669e0a0e5dc533c6afe0 100644 (file)
 
 #define IS_PCCOMMENT(x) ( x && (x->type==PC_COMMENT))
 
-/****************************************************************/
-/*
-* rootRules - defined in SDCCpeep.c
-*  This is a pointer to the (parsed) peephole rules that are
-* defined in peep.def.
-*/
-
-//extern peepRule *rootRules;
-
-
-
 
 /****************************************************************/
 /****************************************************************/
@@ -62,32 +51,6 @@ typedef struct pCodePeepSnippets
 
 static pCodePeepSnippets  *peepSnippets=NULL;
 
-/****************************************************************/
-/*                                                              */
-/* curPeep                                                      */
-/*                                                              */
-/****************************************************************/
-
-//static pCodePeep          *curPeep=NULL;
-
-/****************************************************************/
-/*                                                              */
-/* curBlock                                                     */
-/*                                                              */
-/****************************************************************/
-
-//static pBlock             *curBlock=NULL;
-
-
-/****************************************************************/
-/*                                                              */
-/* max wild cards in a peep rule                                */
-/*                                                              */
-/****************************************************************/
-
-//static int                sMaxWildVar   = 0;
-//static int                sMaxWildMnem  = 0;
-
 
 typedef struct pCodeToken 
 {
@@ -126,9 +89,6 @@ typedef struct parsedPattern {
 
 #define MAX_PARSEDPATARR 50
 static parsedPattern parsedPatArr[MAX_PARSEDPATARR];
-#if 0
-static unsigned int parsedPatIdx=0;
-#endif
 
 typedef enum {
        PCP_LABEL=1,
@@ -367,10 +327,6 @@ static void * cvt_altpat_mnem0a(void *pp, pCodeWildBlock *pcwb)
        DFPRINTF((stderr,"altpat_mnem0a wild mnem # %d\n",  p[0].pct[1].tok.n));
        
        /* Save the index of the maximum wildcard mnemonic */
-       
-       //if(p[0].pct[1].tok.n > sMaxWildVar)
-       //  sMaxWildMnem = p[0].pct[1].tok.n;
-       
        if(p[0].pct[1].tok.n > pcwb->nwildpCodes)
                pcwb->nwildpCodes = p[0].pct[1].tok.n;
        
@@ -478,9 +434,6 @@ static void * cvt_altpat_mnem1a(void *pp,pCodeWildBlock *pcwb)
                newpCodeOpWild(p[1].pct[1].tok.n, pcwb, pcosubtype)));
        
        /* Save the index of the maximum wildcard variable */
-       //if(p[1].pct[1].tok.n > sMaxWildVar)
-       //  sMaxWildVar = p[1].pct[1].tok.n;
-       
        if(p[1].pct[1].tok.n > pcwb->nvars)
                pcwb->nvars = p[1].pct[1].tok.n;
        
@@ -619,9 +572,6 @@ static void * cvt_altpat_mnem2a(void *pp,pCodeWildBlock *pcwb)
                newpCodeOpWild(p[1].pct[1].tok.n, pcwb, pcosubtype)));
        
        /* Save the index of the maximum wildcard variable */
-       //if(p[1].pct[1].tok.n > sMaxWildVar)
-       //  sMaxWildVar = p[1].pct[1].tok.n;
-       
        if(p[1].pct[1].tok.n > pcwb->nvars)
                pcwb->nvars = p[1].pct[1].tok.n;
        
@@ -1126,8 +1076,6 @@ static int parseTokens(pCodeWildBlock *pcwb, pCode **pcret)
                                //  pc->print(stderr,pc);
                                //if(pc && pc->destruct) pc->destruct(pc); dumps core?
                                
-                               //if(curBlock && pc)
-                               //addpCode2pBlock(curBlock, pc);
                                if(pc) {
                                        if (pcret) {
                                                *pcret = pc;
@@ -1189,29 +1137,6 @@ static void peepRuleBlock2pCodeBlock(lineNode *ln, pCodeWildBlock *pcwb)
        }
 }
 
-#if 0
-/*-----------------------------------------------------------------*/
-/*                                                                 */
-/*-----------------------------------------------------------------*/
-static pCode *AssembleLine(char *line)
-{
-       pCode *pc=NULL;
-       
-       if(!line || !*line) {
-               fprintf(stderr,"WARNING returning NULL in AssembleLine\n");
-               return NULL;
-       }
-       
-       tokenizeLineNode(line);
-
-       if(parseTokens(NULL,&pc))
-               fprintf(stderr, "WARNING: unable to assemble line:\n%s\n",line);
-       
-       return pc;
-       
-}
-#endif
-
 /*-----------------------------------------------------------------*/
 /* peepRuleCondition                                               */
 /*-----------------------------------------------------------------*/
@@ -1326,23 +1251,12 @@ void peepRules2pCode(peepRule *rules)
                //DFPRINTF((stderr,"finished target, here it is in pcode form:\n"));
                //printpBlock(stderr, currentRule->target.pb);
                
-               //DFPRINTF((stderr,"target with labels merged:\n"));
-               //pBlockMergeLabels(curBlock);
                pBlockMergeLabels(currentRule->target.pb);
                //printpBlock(stderr, currentRule->replace.pb);
                
-               //#ifdef PCODE_DEBUG
-               //    printpBlock(stderr, curBlock);
-               //#endif
-               //DFPRINTF((stderr,"\nReplaced by:\n"));
-               
-               
                /* Convert the replace block */
                peepRuleBlock2pCodeBlock(pr->replace, &currentRule->replace);
                
-               //DFPRINTF((stderr,"finished replace block, here it is in pcode form:\n"));
-               //printpBlock(stderr, curBlock);
-               
                //DFPRINTF((stderr,"replace with labels merged:\n"));
                
                pBlockMergeLabels(currentRule->replace.pb);
@@ -1376,18 +1290,6 @@ void peepRules2pCode(peepRule *rules)
        
 }
 
-#if 0
-static void printpCodeString(FILE *of, pCode *pc, int max)
-{
-       int i=0;
-       
-       while(pc && (i++<max)) {
-               pc->print(of,pc);
-               pc = pc->next;
-       }
-}
-#endif
-
 /*-----------------------------------------------------------------*/
 /* _DLL * DLL_append                                               */
 /*                                                                 */