X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic%2Fgen.c;h=20fc81a2b790381d3062027774b56b58278794cc;hb=4d711df34233a47f093f6d6a3e8840b17d577887;hp=c8a8fc64f686c5d0aad6f521e8a0ab6cf3c4f5f0;hpb=06590a0f2e7a8144c7e2374b23f88b2fdd431418;p=fw%2Fsdcc diff --git a/src/pic/gen.c b/src/pic/gen.c index c8a8fc64..20fc81a2 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -1124,11 +1124,8 @@ pCodeOp *popGetWithString(char *str) pCodeOp *popRegFromString(char *str) { - pCodeOp *pcop = Safe_calloc(1,sizeof(pCodeOpReg) ); - pcop->type = PO_GPR_REGISTER; - - PCOR(pcop)->rIdx = -1; - PCOR(pcop)->r = NULL; + pCodeOp *pcop = Safe_calloc(1,sizeof(pCodeOp) ); + pcop->type = PO_DIR; DEBUGpic14_emitcode(";","%d",__LINE__); pcop->name = Safe_strdup( ( (str) ? str : "BAD STRING")); @@ -7603,9 +7600,9 @@ static void genFarPointerGet (operand *left, } /*-----------------------------------------------------------------*/ -/* pic14_emitcodePointerGet - gget value from code space */ +/* genCodePointerGet - get value from code space */ /*-----------------------------------------------------------------*/ -static void pic14_emitcodePointerGet (operand *left, +static void genCodePointerGet (operand *left, operand *result, iCode *ic) { int size, offset ; @@ -7765,7 +7762,7 @@ static void genPointerGet (iCode *ic) break; case CPOINTER: - pic14_emitcodePointerGet (left,result,ic); + genCodePointerGet (left,result,ic); break; case GPOINTER: @@ -8390,8 +8387,11 @@ static void genPointerSet (iCode *ic) case GPOINTER: genGenPointerSet (right,result,ic); break; - } + default: + werror (E_INTERNAL_ERROR, __FILE__, __LINE__, + "genPointerSet: illegal pointer type"); + } } /*-----------------------------------------------------------------*/ @@ -9167,18 +9167,19 @@ void genpic14Code (iCode *lic) addpBlock(pb); /* if debug information required */ -/* if (options.debug && currFunc) { */ - if (currFunc) { + if (options.debug && currFunc) { + if (currFunc) { cdbSymbol(currFunc,cdbFile,FALSE,TRUE); _G.debugLine = 1; if (IS_STATIC(currFunc->etype)) { - pic14_emitcode("",";F%s$%s$0$0 %d",moduleName,currFunc->name,__LINE__); - //addpCode2pBlock(pb,newpCodeLabel(moduleName,currFunc->name)); + pic14_emitcode("",";F%s$%s$0$0 %d",moduleName,currFunc->name,__LINE__); + //addpCode2pBlock(pb,newpCodeLabel(moduleName,currFunc->name)); } else { - pic14_emitcode("",";G$%s$0$0 %d",currFunc->name,__LINE__); - //addpCode2pBlock(pb,newpCodeLabel(NULL,currFunc->name)); + pic14_emitcode("",";G$%s$0$0 %d",currFunc->name,__LINE__); + //addpCode2pBlock(pb,newpCodeLabel(NULL,currFunc->name)); } _G.debugLine = 0; + } } @@ -9395,14 +9396,15 @@ void genpic14Code (iCode *lic) /* now we are ready to call the peep hole optimizer */ if (!options.nopeep) { - printf("peep hole optimizing\n"); - peepHole (&lineHead); + peepHole (&lineHead); } /* now do the actual printing */ printLine (lineHead,codeOutFile); - printf("printing pBlock\n\n"); +#ifdef PCODE_DEBUG + DFPRINTF((stderr,"printing pBlock\n\n")); printpBlock(stdout,pb); +#endif return; }