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