diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2014-11-17 13:45:55 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2014-11-17 13:45:55 +0000 |
commit | edcf72f3c9e070fe904ff9ff2f2fd145e694af83 (patch) | |
tree | bc2f2a46968faabdbe890355b0f2b9b151a106bb /gcc/tree-streamer-in.c | |
parent | 5134529b25c1fd448e6589876a84d0095a5ffc35 (diff) | |
download | gcc-edcf72f3c9e070fe904ff9ff2f2fd145e694af83.zip gcc-edcf72f3c9e070fe904ff9ff2f2fd145e694af83.tar.gz gcc-edcf72f3c9e070fe904ff9ff2f2fd145e694af83.tar.bz2 |
tree-core.h (built_in_class): Add builtin codes to be used by Pointer Bounds Checker for instrumented builtin...
* tree-core.h (built_in_class): Add builtin codes to be used
by Pointer Bounds Checker for instrumented builtin functions.
* tree-streamer-in.c: Include ipa-chkp.h.
(streamer_get_builtin_tree): Created instrumented decl if
required.
* ipa-chkp.h (chkp_maybe_clone_builtin_fndecl): New.
* ipa-chkp.c (chkp_build_instrumented_fndecl): Support builtin
function decls.
(chkp_maybe_clone_builtin_fndecl): New.
(chkp_maybe_create_clone): Support builtin function decls.
(chkp_versioning): Clone builtin functions.
* tree-chkp.c (chkp_instrument_normal_builtin): New.
(chkp_add_bounds_to_call_stmt): Support builtin functions.
(chkp_replace_function_pointer): Likewise.
* builtins.c (expand_builtin_memcpy_args): New.
(expand_builtin_memcpy): Call expand_builtin_memcpy_args.
(expand_builtin_memcpy_with_bounds): New.
(expand_builtin_mempcpy_with_bounds): New.
(expand_builtin_mempcpy_args): Add orig_exp arg. Support
BUILT_IN_CHKP_MEMCPY_NOBND_NOCHK
(expand_builtin_memset_with_bounds): New.
(expand_builtin_memset_args): Support BUILT_IN_CHKP_MEMSET_NOBND_NOCHK.
(expand_builtin_with_bounds): New.
* builtins.h (expand_builtin_with_bounds): New.
* expr.c (expand_expr_real_1): Support instrumented builtin calls.
From-SVN: r217655
Diffstat (limited to 'gcc/tree-streamer-in.c')
-rw-r--r-- | gcc/tree-streamer-in.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index a11a46e..fba6048 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see #include "streamer-hooks.h" #include "lto-streamer.h" #include "builtins.h" +#include "ipa-chkp.h" /* Read a STRING_CST from the string table in DATA_IN using input block IB. */ @@ -1113,6 +1114,14 @@ streamer_get_builtin_tree (struct lto_input_block *ib, struct data_in *data_in) if (fcode >= END_BUILTINS) fatal_error ("machine independent builtin code out of range"); result = builtin_decl_explicit (fcode); + if (!result + && fcode > BEGIN_CHKP_BUILTINS + && fcode < END_CHKP_BUILTINS) + { + fcode = (enum built_in_function) (fcode - BEGIN_CHKP_BUILTINS - 1); + result = builtin_decl_explicit (fcode); + result = chkp_maybe_clone_builtin_fndecl (result); + } gcc_assert (result); } else if (fclass == BUILT_IN_MD) |