diff gcc/statistics.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents a06113de4d67
children 84e7813d76e9
line wrap: on
line diff
--- a/gcc/statistics.h	Sun Aug 21 07:07:55 2011 +0900
+++ b/gcc/statistics.h	Fri Oct 27 22:46:09 2017 +0900
@@ -1,6 +1,5 @@
 /* Memory and optimization statistics helpers.
-   Copyright (C) 2004, 2007, 2008
-   Free Software Foundation, Inc.
+   Copyright (C) 2004-2017 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
    This file is part of GCC.
@@ -22,20 +21,41 @@
 #ifndef GCC_STATISTICS
 #define GCC_STATISTICS
 
-#ifdef GATHER_STATISTICS
-#define MEM_STAT_DECL , const char * ARG_UNUSED (_loc_name), int ARG_UNUSED (_loc_line), const char * ARG_UNUSED (_loc_function)
-#define ALONE_MEM_STAT_DECL const char * ARG_UNUSED (_loc_name), int ARG_UNUSED (_loc_line), const char * ARG_UNUSED (_loc_function)
-#define PASS_MEM_STAT , _loc_name, _loc_line,  _loc_function
+#if ! defined GATHER_STATISTICS
+#error GATHER_STATISTICS must be defined
+#endif
+
+#define GCC_MEM_STAT_ARGUMENTS const char * ARG_UNUSED (_loc_name), int ARG_UNUSED (_loc_line), const char * ARG_UNUSED (_loc_function)
+#if GATHER_STATISTICS
+#define ALONE_MEM_STAT_DECL GCC_MEM_STAT_ARGUMENTS
+#define ALONE_FINAL_MEM_STAT_DECL ALONE_MEM_STAT_DECL
 #define ALONE_PASS_MEM_STAT _loc_name, _loc_line,  _loc_function
-#define MEM_STAT_INFO , __FILE__, __LINE__, __FUNCTION__
+#define ALONE_FINAL_PASS_MEM_STAT ALONE_PASS_MEM_STAT
 #define ALONE_MEM_STAT_INFO __FILE__, __LINE__, __FUNCTION__
+#define MEM_STAT_DECL , ALONE_MEM_STAT_DECL
+#define FINAL_MEM_STAT_DECL , ALONE_FINAL_MEM_STAT_DECL
+#define PASS_MEM_STAT , ALONE_PASS_MEM_STAT
+#define FINAL_PASS_MEM_STAT , ALONE_FINAL_PASS_MEM_STAT
+#define MEM_STAT_INFO , ALONE_MEM_STAT_INFO
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+#define ALONE_CXX_MEM_STAT_INFO const char * _loc_name = __builtin_FILE (), int _loc_line = __builtin_LINE (), const char * _loc_function = __builtin_FUNCTION ()
 #else
+#define ALONE_CXX_MEM_STAT_INFO const char * _loc_name = __FILE__, int _loc_line = __LINE__, const char * _loc_function = NULL
+#endif
+#define CXX_MEM_STAT_INFO , ALONE_CXX_MEM_STAT_INFO
+#else
+#define ALONE_MEM_STAT_DECL void
+#define ALONE_FINAL_MEM_STAT_DECL GCC_MEM_STAT_ARGUMENTS
+#define ALONE_PASS_MEM_STAT
+#define ALONE_FINAL_PASS_MEM_STAT 0,0,0
+#define ALONE_MEM_STAT_INFO
 #define MEM_STAT_DECL
-#define ALONE_MEM_STAT_DECL void
+#define FINAL_MEM_STAT_DECL , ALONE_FINAL_MEM_STAT_DECL
 #define PASS_MEM_STAT
-#define ALONE_PASS_MEM_STAT
-#define MEM_STAT_INFO
-#define ALONE_MEM_STAT_INFO
+#define FINAL_PASS_MEM_STAT , ALONE_FINAL_PASS_MEM_STAT
+#define MEM_STAT_INFO ALONE_MEM_STAT_INFO
+#define ALONE_CXX_MEM_STAT_INFO
+#define CXX_MEM_STAT_INFO
 #endif
 
 struct function;