ast *optimizeRRCRLC (ast *);
ast *optimizeGetHbit (ast *);
ast *backPatchLabels (ast *, symbol *, symbol *);
+void PA(ast *t);
int inInitMode = 0;
memmap *GcurMemmap=NULL; /* points to the memmap that's currently active */
FILE *codeOutFile;
ex = newAst_VALUE (symbolVal (name)); /* create name */
ex = newNode (FUNCTION, ex, body);
ex->values.args = FUNC_ARGS(name->type);
-
+ ex->decorated=1;
+ if (options.dump_tree) PA(ex);
if (fatalError)
{
werror (E_FUNC_NO_CODE, name->name);
}
if (tree->opval.op == BLOCK) {
symbol *decls = tree->values.sym;
+ INDENT(indent+4,outfile);
fprintf(outfile,"{\n");
while (decls) {
INDENT(indent+4,outfile);
decls = decls->next;
}
ast_print(tree->right,outfile,indent+4);
+ INDENT(indent+4,outfile);
fprintf(outfile,"}\n");
return;
}
/* ifx Statement */
/*----------------------------*/
case IFX:
- ast_print(tree->left,outfile,indent);
- INDENT(indent,outfile);
fprintf(outfile,"IF (%p) \n",tree);
+ ast_print(tree->left,outfile,indent+4);
if (tree->trueLabel) {
INDENT(indent,outfile);
- fprintf(outfile,"NE(==) 0 goto %s\n",tree->trueLabel->name);
+ fprintf(outfile,"NE(!=) 0 goto %s\n",tree->trueLabel->name);
}
if (tree->falseLabel) {
INDENT(indent,outfile);
fprintf(outfile,"EQ(==) 0 goto %s\n",tree->falseLabel->name);
}
- ast_print(tree->right,outfile,indent);
+ ast_print(tree->right,outfile,indent+4);
return ;
/*------------------------------------------------------------------*/
/*----------------------------*/
int dump_range; /* dump after live range analysis */
int dump_pack; /* dump after register packing */
int dump_rassgn; /* dump after register assignment */
+ int dump_tree; /* dump front-end tree before lowering to iCode */
int cc_only; /* compile only flag */
int intlong_rent; /* integer & long support routines reentrant */
int float_rent; /* floating point routines are reentrant */
{ 0, "--dumpliverange", &options.dump_range, NULL },
{ 0, "--dumpregpack", &options.dump_pack, NULL },
{ 0, "--dumpregassign", &options.dump_rassgn, NULL },
+ { 0, "--dumptree", &options.dump_tree, NULL },
{ 0, OPTION_DUMP_ALL, NULL, "Dump the internal structure at all stages" },
{ 0, OPTION_XRAM_LOC, NULL, "<nnnn> External Ram start location" },
{ 0, OPTION_IRAM_SIZE, NULL, "<nnnn> Internal Ram size" },