summaryrefslogtreecommitdiff
path: root/gcc/builtins.def
diff options
context:
space:
mode:
authorwmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-22 21:56:58 +0000
committerwmi <wmi@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-22 21:56:58 +0000
commitb077695d9e39a87da6f8bc68451a9d60467e7020 (patch)
tree368bbe384fc86dd4c4da764b1d83bb50a9b3ced8 /gcc/builtins.def
parentc611e16f65257725d6a4fac5cb95ec0ae51111de (diff)
downloadgcc-b077695d9e39a87da6f8bc68451a9d60467e7020.tar.gz
2012-11-22 Dmitry Vyukov <dvyukov@google.com>
Wei Mi <wmi@google.com> * builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins. * sanitizer.def: Ditto. * Makefile.in (tsan.o): Add tsan.o target. (BUILTINS_DEF): Add sanitizer.def. * passes.c (init_optimization_passes): Add tsan passes. * tree-pass.h (register_pass_info): Ditto. * toplev.c (compile_file): Ditto. * doc/invoke.texi: Document tsan related options. * gcc.c (LINK_COMMAND_SPEC): Add LIBTSAN_SPEC in link command if -fsanitize=thread. * tsan.c: New file about tsan. * tsan.h: Ditto. * common.opt: Add -fsanitize=thread. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193736 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.def')
-rw-r--r--gcc/builtins.def13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/builtins.def b/gcc/builtins.def
index d3dad11d012..bfafa5384ef 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -149,6 +149,15 @@ along with GCC; see the file COPYING3. If not see
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
true, true, true, ATTRS, false, flag_tm)
+/* Builtin used by the implementation of libsanitizer. These
+ functions are mapped to the actual implementation of the
+ libtsan library. */
+#undef DEF_SANITIZER_BUILTIN
+#define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
+ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
+ true, true, true, ATTRS, true, \
+ flag_tsan)
+
/* Define an attribute list for math functions that are normally
"impure" because some of them may write into global memory for
`errno'. If !flag_errno_math they are instead "const". */
@@ -825,3 +834,7 @@ DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
/* GTM builtins. */
#include "gtm-builtins.def"
+
+/* Sanitizer builtins. */
+#include "sanitizer.def"
+