diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2012-11-22 13:56:58 -0800 |
---|---|---|
committer | Wei Mi <wmi@gcc.gnu.org> | 2012-11-22 21:56:58 +0000 |
commit | 32b4b7f53e341be663438f69fd6cb2f909427188 (patch) | |
tree | 368bbe384fc86dd4c4da764b1d83bb50a9b3ced8 /gcc/builtins.def | |
parent | bdb6985c8782cdd91a637a6d36bab4ba561c3f9b (diff) | |
download | gcc-32b4b7f53e341be663438f69fd6cb2f909427188.tar.gz |
builtins.def (DEF_SANITIZER_BUILTIN): Define tsan builtins.
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.
Co-Authored-By: Wei Mi <wmi@google.com>
From-SVN: r193736
Diffstat (limited to 'gcc/builtins.def')
-rw-r--r-- | gcc/builtins.def | 13 |
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" + |