]>
Commit | Line | Data |
---|---|---|
9fe0cb7d RG |
1 | /* Memory and optimization statistics helpers. |
2 | Copyright (C) 2004, 2007, 2008 | |
b9dcdee4 JH |
3 | Free Software Foundation, Inc. |
4 | Contributed by Cygnus Solutions. | |
5 | ||
6 | This file is part of GCC. | |
7 | ||
8 | GCC is free software; you can redistribute it and/or modify it | |
9 | under the terms of the GNU General Public License as published by | |
9dcd6f09 | 10 | the Free Software Foundation; either version 3, or (at your option) |
b9dcdee4 JH |
11 | any later version. |
12 | ||
13 | GCC is distributed in the hope that it will be useful, but WITHOUT | |
14 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
15 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | |
16 | License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
9dcd6f09 NC |
19 | along with GCC; see the file COPYING3. If not see |
20 | <http://www.gnu.org/licenses/>. */ | |
b9dcdee4 JH |
21 | |
22 | #ifndef GCC_STATISTICS | |
23 | #define GCC_STATISTICS | |
9fe0cb7d | 24 | |
7aa6d18a SB |
25 | #if ! defined GATHER_STATISTICS |
26 | #error GATHER_STATISTICS must be defined | |
27 | #endif | |
28 | ||
29 | #define GCC_MEM_STAT_ARGUMENTS const char * ARG_UNUSED (_loc_name), int ARG_UNUSED (_loc_line), const char * ARG_UNUSED (_loc_function) | |
30 | #if GATHER_STATISTICS | |
31 | #define ALONE_MEM_STAT_DECL GCC_MEM_STAT_ARGUMENTS | |
4cdf5307 | 32 | #define ALONE_FINAL_MEM_STAT_DECL ALONE_MEM_STAT_DECL |
f75709c6 | 33 | #define ALONE_PASS_MEM_STAT _loc_name, _loc_line, _loc_function |
7aa6d18a | 34 | #define ALONE_FINAL_PASS_MEM_STAT ALONE_PASS_MEM_STAT |
f75709c6 | 35 | #define ALONE_MEM_STAT_INFO __FILE__, __LINE__, __FUNCTION__ |
7aa6d18a SB |
36 | #define MEM_STAT_DECL , ALONE_MEM_STAT_DECL |
37 | #define FINAL_MEM_STAT_DECL , ALONE_FINAL_MEM_STAT_DECL | |
38 | #define PASS_MEM_STAT , ALONE_PASS_MEM_STAT | |
39 | #define FINAL_PASS_MEM_STAT , ALONE_FINAL_PASS_MEM_STAT | |
40 | #define MEM_STAT_INFO , ALONE_MEM_STAT_INFO | |
b9dcdee4 | 41 | #else |
f75709c6 | 42 | #define ALONE_MEM_STAT_DECL void |
7aa6d18a | 43 | #define ALONE_FINAL_MEM_STAT_DECL GCC_MEM_STAT_ARGUMENTS |
f75709c6 | 44 | #define ALONE_PASS_MEM_STAT |
7aa6d18a | 45 | #define ALONE_FINAL_PASS_MEM_STAT 0,0,0 |
f75709c6 | 46 | #define ALONE_MEM_STAT_INFO |
7aa6d18a SB |
47 | #define MEM_STAT_DECL |
48 | #define FINAL_MEM_STAT_DECL , ALONE_FINAL_MEM_STAT_DECL | |
49 | #define PASS_MEM_STAT | |
50 | #define FINAL_PASS_MEM_STAT , ALONE_FINAL_PASS_MEM_STAT | |
51 | #define MEM_STAT_INFO ALONE_MEM_STAT_INFO | |
b9dcdee4 | 52 | #endif |
9fe0cb7d RG |
53 | |
54 | struct function; | |
55 | ||
56 | /* In statistics.c */ | |
57 | extern void statistics_early_init (void); | |
58 | extern void statistics_init (void); | |
59 | extern void statistics_fini (void); | |
60 | extern void statistics_fini_pass (void); | |
61 | extern void statistics_counter_event (struct function *, const char *, int); | |
62 | extern void statistics_histogram_event (struct function *, const char *, int); | |
63 | ||
b9dcdee4 | 64 | #endif |