// executing, so create a switch on task ID, because waiting elements
// generated by this stall site should be inserted into possibly a
// different memory queue index, depending on which task type it is
- output.println(" // potential stall site ");
- output.println(" switch( runningSESE->classID ) {");
+ // update: only generate the switch statement if there is at least
+ // one non-empty case that will go in it!
+ boolean atLeastOneCase = false;
// create a case for each class of task that might be executing
Iterator<FlatSESEEnterNode> taskItr = oooa.getPossibleExecutingRBlocks( fn ).iterator();
continue;
}
+ if( atLeastOneCase == false ) {
+ atLeastOneCase = true;
+ output.println(" // potential stall site ");
+ output.println(" switch( runningSESE->classID ) {");
+ }
+
output.println(" case "+parent.getIdentifier()+": {");
if( state.RCR ) {
}
output.println(" } break; // end case "+parent.getIdentifier());
}
- output.println(" } // end stall site switch");
+
+ if( atLeastOneCase ) {
+ output.println(" } // end stall site switch");
+ }
}
}
// based on task ID, each type of task has a different index
// scheme for its memory queue's, and the cases here drop the
// new task instance in the right bucket
-
- output.println(" // add new task instance to current task's memory queues if needed ");
- output.println(" switch( runningSESE->classID ) {");
+ boolean atLeastOneCase = false;
// create a case for each class of task that might be executing
Iterator<FlatSESEEnterNode> taskItr = oooa.getPossibleExecutingRBlocks( fsen ).iterator();
continue;
}
+ if( atLeastOneCase == false ) {
+ atLeastOneCase = true;
+ output.println(" // add new task instance to current task's memory queues if needed ");
+ output.println(" switch( runningSESE->classID ) {");
+ }
+
output.println(" case "+parent.getIdentifier()+": {");
output.println(" REntry* rentry=NULL;");
output.println(" INTPTR* pointer=NULL;");
output.println(" } break; // end case "+parent.getIdentifier());
output.println();
}
- output.println(" } // end stall site switch");
+
+ if( atLeastOneCase ) {
+ output.println(" } // end stall site switch");
+ }
}
if( state.COREPROF ) {