| 2217 | } |
| 2218 | |
| 2219 | void SimulateVisitor::sv_simulateLabels ( const ExprBlock * expr, SimNode_Block * block, const das_map<int32_t,uint32_t> & ofsmap ) { |
| 2220 | if ( expr->maxLabelIndex!=-1 ) { |
| 2221 | block->totalLabels = expr->maxLabelIndex + 1; |
| 2222 | block->labels = (uint32_t *) context.code->allocate(block->totalLabels * sizeof(uint32_t)); |
| 2223 | for ( uint32_t i=0, is=block->totalLabels; i!=is; ++i ) { |
| 2224 | block->labels[i] = -1U; |
| 2225 | } |
| 2226 | for ( auto & it : ofsmap ) { |
| 2227 | block->labels[it.first] = it.second; |
| 2228 | } |
| 2229 | } |
| 2230 | } |
| 2231 | |
| 2232 | ExpressionPtr SimulateVisitor::visit(ExprBlock * expr) { |
| 2233 | das_map<int32_t,uint32_t> ofsmap; |