summaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-19 04:13:05 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-19 04:13:05 +0000
commita7779e7501b3b5de7cdc621f737f72098c2d620c (patch)
treeea3822f937ca2bf97d74dca204d93f8e7bb15773 /gcc/system.h
parent971bdcefe8220399d91064ed3260b6f3e7226071 (diff)
downloadgcc-a7779e7501b3b5de7cdc621f737f72098c2d620c.tar.gz
Support valgrind 3.3 for --enable-checking=valgrind.
* system.h: Consolidate ENABLE_VALGRIND_CHECKING-dependent defines here. [!VALGRIND_MAKE_MEM_NOACCESS]: Define as VALGRIND_MAKE_NOACCESS. [!VALGRIND_MAKE_MEM_DEFINED]: Define as VALGRIND_MAKE_READABLE. [!VALGRIND_MAKE_MEM_UNDEFINED]: Define as VALGRIND_MAKE_WRITABLE. * ggc-common.c: Remove ENABLE_VALGRIND_CHECKING-dependent defines. Replace use of VALGRIND_MAKE_READABLE, VALGRIND_MAKE_WRITABLE, and VALGRIND_MAKE_NOACCESS with VALGRIND_MAKE_MEM_DEFINED, VALGRIND_MAKE_MEM_UNDEFINED, and VALGRIND_MAKE_MEM_NOACCESS respectively. * ggc-zone.c: Similar. * ggc-page.c: Similar. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132407 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h
index 92b045c1a5e..568bd751a4c 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -804,4 +804,29 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
#endif
#endif
+#ifdef ENABLE_VALGRIND_CHECKING
+# ifdef HAVE_VALGRIND_MEMCHECK_H
+# include <valgrind/memcheck.h>
+# elif defined HAVE_MEMCHECK_H
+# include <memcheck.h>
+# else
+# include <valgrind.h>
+# endif
+/* Compatibility macros to let valgrind 3.1 work. */
+# ifndef VALGRIND_MAKE_MEM_NOACCESS
+# define VALGRIND_MAKE_MEM_NOACCESS VALGRIND_MAKE_NOACCESS
+# endif
+# ifndef VALGRIND_MAKE_MEM_DEFINED
+# define VALGRIND_MAKE_MEM_DEFINED VALGRIND_MAKE_READABLE
+# endif
+# ifndef VALGRIND_MAKE_MEM_UNDEFINED
+# define VALGRIND_MAKE_MEM_UNDEFINED VALGRIND_MAKE_WRITABLE
+# endif
+#else
+/* Avoid #ifdef:s when we can help it. */
+#define VALGRIND_DISCARD(x)
+#define VALGRIND_MALLOCLIKE_BLOCK(w,x,y,z)
+#define VALGRIND_FREELIKE_BLOCK(x,y)
+#endif
+
#endif /* ! GCC_SYSTEM_H */