void PrettyPrinter::VisitModuleLiteral(ModuleLiteral* node) { VisitBlock(node->body()); }
void CompField::VisitStatement(StmtBase *stmt) { nbASSERT(stmt != NULL , "stmt cannot be NULL"); //Start STATEMENT CHECK: //if this statement it's not GEN -> means that can't be a DEFFLD! -> we must "close" compattable-fixed-field-list!!!! if(stmt->Kind!=STMT_GEN) StartCheck(NULL); //End of STATEMENT CHECK switch(stmt->Kind) { case STMT_GEN: //here we recognize FIELD DEFINITIONS -> DEFFLD { #ifdef DEBUG_COMPACT_FIELDS PrintStmt(stmt,"Debug_Statement_Gen.txt"); #endif VisitTree(stmt->Forest); }break; case STMT_JUMP: case STMT_JUMP_FIELD: { VisitJump((StmtJump*)stmt); }break; case STMT_CASE: //Gettin inside a Case! New "Context" { VisitCase((StmtCase*)stmt, false); }break; case STMT_SWITCH: //Gettin inside a SWITCH! New "Context" { VisitSwitch((StmtSwitch*)stmt); }break; case STMT_IF: //Gettin inside an IF! New "Context" { VisitIf((StmtIf*)stmt); }break; case STMT_LOOP: //only <loop type="times2repeat"> { VisitLoop((StmtLoop*)stmt); }break; case STMT_WHILE: //LOOP SIZE -> (CONVERTED) -> STATEMENT WHILE -> i'll convert loop in one variable FIELD (if can) { //if this is Loop-Size (converted in pdlparser to stmtWhile!) -> try compatting, otherwise not! only visit if(((StmtWhile*)stmt)->isLoopSize==true) { checkingloop++; //Integer USED TO IDENTIFY if This LOOP is the first one or it's an Inner-Loop m_loopcomp=1; if(checkingloop>1) //fields used inside LOOP expression-> If InnerLoop ->need to check it - Otherwise not! UpdateMapField((StmtWhile*)stmt); //ADD field-expr to Local-MAP of Used fields VisitWhileDo((StmtWhile*)stmt); //Visit inside this WHILE if(AllCompattable((StmtWhile*)stmt))//check if the validity of these fields end here or if at least one is also referentiated later { #ifdef DEBUG_COMPACT_FIELDS PrintFieldsMap(&m_DefUseLocal,"Debug_List_of_Fields_Used_insideLoop_Compattable.txt"); #endif /****TRANSFORM LOOP IN A VARIABLE-FIELD****/ TransformLoop((StmtWhile*)stmt); } CleanTempMap(&m_symboltemp); //Clean Used Fields of this loop CleanTempMap(&m_DefUseLocal); //Clean Used Fields Defined inside this loop checkingloop--; } else { VisitWhileDo((StmtWhile*)stmt); //Visit inside this WHILE } }break; case STMT_DO_WHILE: //Gettin inside a WHILE! New "Context" { VisitDoWhile((StmtWhile*)stmt); }break; case STMT_BLOCK: //Gettin inside a Block! New "Context" { VisitBlock((StmtBlock*)stmt); }break; case STMT_BREAK: case STMT_CONTINUE: //If Break or Continue (Inside Loops) -> Can't Compact this!! Don't know Total Size!! (Offset) { //TEMP!! THIS loop must be added to NeverLOOP LIST!!? //AddNeverCompattableLoop(actualoop,&m_symboltemp); m_loopcomp=0; }break; case STMT_LABEL: case STMT_FINFOST: case STMT_COMMENT: { //Do nothing }break; default: nbASSERT(false, "COMPACT_STMT: CANNOT BE HERE!"); break; } }