2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Statistics for Firm.
11 #ifndef FIRM_STAT_FIRMSTAT_H
12 #define FIRM_STAT_FIRMSTAT_H
14 #include "firm_types.h"
18 * Dump a snapshot of the statistic values.
19 * Never called from libFirm should be called from user.
21 * @param fname base name of the statistic output file
22 * @param phase a phase name. Prefix will be firmstat-\<phase\>-
24 FIRM_API void stat_dump_snapshot(const char *fname, const char *phase);
27 * Creates an ir_prog pass for stat_dump_snapshot().
29 * @param name the name of this pass or NULL
30 * @param fname base name of the statistic output file
31 * @param phase a phase name. Prefix will be firmstat-\<phase\>-
33 * @return the newly created ir_prog pass
35 FIRM_API ir_prog_pass_t *stat_dump_snapshot_pass(
36 const char *name, const char *fname, const char *phase);
39 * initialize the statistics module.
40 * Should be called directly after ir_init
42 FIRM_API void firm_init_stat(void);
45 * terminates the statistics module, frees all memory
47 FIRM_API void stat_term(void);
50 * returns 1 if statistic module is active, 0 otherwise
52 FIRM_API int stat_is_active(void);