@@ -305,8 +305,7 @@ static void free_pb_graph(t_pb_graph_node* pb_graph_node) {
305
305
306
306
static void free_pb_type (t_pb_type* pb_type) {
307
307
vtr::free (pb_type->name );
308
- if (pb_type->blif_model )
309
- vtr::free (pb_type->blif_model );
308
+ vtr::free (pb_type->blif_model );
310
309
311
310
for (int i = 0 ; i < pb_type->num_modes ; ++i) {
312
311
for (int j = 0 ; j < pb_type->modes [i].num_pb_type_children ; ++j) {
@@ -320,55 +319,34 @@ static void free_pb_type(t_pb_type* pb_type) {
320
319
vtr::free (pb_type->modes [i].interconnect [j].name );
321
320
322
321
for (int k = 0 ; k < pb_type->modes [i].interconnect [j].num_annotations ; ++k) {
323
- if (pb_type->modes [i].interconnect [j].annotations [k].clock )
324
- vtr::free (pb_type->modes [i].interconnect [j].annotations [k].clock );
325
- if (pb_type->modes [i].interconnect [j].annotations [k].input_pins ) {
326
- vtr::free (pb_type->modes [i].interconnect [j].annotations [k].input_pins );
327
- }
328
- if (pb_type->modes [i].interconnect [j].annotations [k].output_pins ) {
329
- vtr::free (pb_type->modes [i].interconnect [j].annotations [k].output_pins );
330
- }
322
+ vtr::free (pb_type->modes [i].interconnect [j].annotations [k].clock );
323
+ vtr::free (pb_type->modes [i].interconnect [j].annotations [k].input_pins );
324
+ vtr::free (pb_type->modes [i].interconnect [j].annotations [k].output_pins );
331
325
}
332
326
delete[] pb_type->modes [i].interconnect [j].annotations ;
333
- if (pb_type->modes [i].interconnect [j].interconnect_power )
334
- delete pb_type->modes [i].interconnect [j].interconnect_power ;
327
+ delete pb_type->modes [i].interconnect [j].interconnect_power ;
335
328
}
336
- if (pb_type->modes [i].interconnect )
337
- delete[] pb_type->modes [i].interconnect ;
338
- if (pb_type->modes [i].mode_power )
339
- delete (pb_type->modes [i].mode_power );
329
+ delete[] pb_type->modes [i].interconnect ;
330
+ delete (pb_type->modes [i].mode_power );
340
331
}
341
- if (pb_type-> modes )
342
- delete[] pb_type->modes ;
332
+
333
+ delete[] pb_type->modes ;
343
334
344
335
for (int i = 0 ; i < pb_type->num_annotations ; ++i) {
345
-
346
- if (pb_type->annotations [i].input_pins ) {
347
- vtr::free (pb_type->annotations [i].input_pins );
348
- }
349
- if (pb_type->annotations [i].output_pins ) {
350
- vtr::free (pb_type->annotations [i].output_pins );
351
- }
352
- if (pb_type->annotations [i].clock ) {
353
- vtr::free (pb_type->annotations [i].clock );
354
- }
355
- }
356
- if (pb_type->annotations ) {
357
- delete[] pb_type->annotations ;
336
+ vtr::free (pb_type->annotations [i].input_pins );
337
+ vtr::free (pb_type->annotations [i].output_pins );
338
+ vtr::free (pb_type->annotations [i].clock );
358
339
}
340
+ delete[] pb_type->annotations ;
341
+
359
342
360
- if (pb_type->pb_type_power ) {
361
- delete pb_type->pb_type_power ;
362
- }
343
+ delete pb_type->pb_type_power ;
344
+
363
345
364
346
for (int i = 0 ; i < pb_type->num_ports ; ++i) {
365
347
vtr::free (pb_type->ports [i].name );
366
- if (pb_type->ports [i].port_class ) {
367
- vtr::free (pb_type->ports [i].port_class );
368
- }
369
- if (pb_type->ports [i].port_power ) {
370
- delete pb_type->ports [i].port_power ;
371
- }
348
+ vtr::free (pb_type->ports [i].port_class );
349
+ delete pb_type->ports [i].port_power ;
372
350
}
373
351
delete[] pb_type->ports ;
374
352
}
@@ -619,15 +597,9 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
619
597
lut_pb_type->modes [1 ].pb_type_children );
620
598
/* moved annotations to child so delete old annotations */
621
599
for (i = 0 ; i < lut_pb_type->num_annotations ; i++) {
622
- if (lut_pb_type->annotations [i].input_pins ) {
623
- vtr::free (lut_pb_type->annotations [i].input_pins );
624
- }
625
- if (lut_pb_type->annotations [i].output_pins ) {
626
- vtr::free (lut_pb_type->annotations [i].output_pins );
627
- }
628
- if (lut_pb_type->annotations [i].clock ) {
629
- vtr::free (lut_pb_type->annotations [i].clock );
630
- }
600
+ vtr::free (lut_pb_type->annotations [i].input_pins );
601
+ vtr::free (lut_pb_type->annotations [i].output_pins );
602
+ vtr::free (lut_pb_type->annotations [i].clock );
631
603
}
632
604
lut_pb_type->num_annotations = 0 ;
633
605
delete[] lut_pb_type->annotations ;
0 commit comments