Revision 27bfd83c tcg/tcg.c

b/tcg/tcg.c
450 450
            s->nb_temps++;
451 451
        }
452 452
    }
453

  
454
#if defined(CONFIG_DEBUG_TCG)
455
    s->temps_in_use++;
456
#endif
453 457
    return idx;
454 458
}
455 459

  
......
475 479
    TCGTemp *ts;
476 480
    int k;
477 481

  
482
#if defined(CONFIG_DEBUG_TCG)
483
    s->temps_in_use--;
484
    if (s->temps_in_use < 0) {
485
        fprintf(stderr, "More temporaries freed than allocated!\n");
486
    }
487
#endif
488

  
478 489
    assert(idx >= s->nb_globals && idx < s->nb_temps);
479 490
    ts = &s->temps[idx];
480 491
    assert(ts->temp_allocated != 0);
......
528 539
    return t0;
529 540
}
530 541

  
542
#if defined(CONFIG_DEBUG_TCG)
543
void tcg_clear_temp_count(void)
544
{
545
    TCGContext *s = &tcg_ctx;
546
    s->temps_in_use = 0;
547
}
548

  
549
int tcg_check_temp_count(void)
550
{
551
    TCGContext *s = &tcg_ctx;
552
    if (s->temps_in_use) {
553
        /* Clear the count so that we don't give another
554
         * warning immediately next time around.
555
         */
556
        s->temps_in_use = 0;
557
        return 1;
558
    }
559
    return 0;
560
}
561
#endif
562

  
531 563
void tcg_register_helper(void *func, const char *name)
532 564
{
533 565
    TCGContext *s = &tcg_ctx;

Also available in: Unified diff