Emit GIMPLE directly instead of gimplifying GENERIC.
commit72ed51c18dd269ee10fa1b70a919d77de498fc06
authorJakub Jelinek <jakub@redhat.com>
Fri, 2 Nov 2012 22:29:30 +0000 (2 23:29 +0100)
committerDodji Seketeli <dodji@seketeli.org>
Fri, 9 Nov 2012 17:02:17 +0000 (9 18:02 +0100)
treee3513e53ffdbd5125f10e84901eabfa685a5d260
parentecd6ab4529eab90e3c90fff3e9cdba9ae36a49cc
Emit GIMPLE directly instead of gimplifying GENERIC.

This patch cleanups the instrumentation code generation by emitting
GIMPLE directly, as opposed to emitting GENERIC tree and then
gimplifying them.  It also does some cleanups here and there

* Makefile.in (GTFILES): Add $(srcdir)/asan.c.
(asan.o): Update the dependencies of asan.o.
* asan.c (tm.h, tree.h, tm_p.h, basic-block.h, flags.h
function.h, tree-inline.h, tree-dump.h, diagnostic.h, demangle.h,
langhooks.h, ggc.h, cgraph.h, gimple.h): Remove these unused but
included headers.
(shadow_ptr_types): New variable.
(report_error_func): Change is_store argument to bool, don't append
newline to function name.
(PROB_VERY_UNLIKELY, PROB_ALWAYS): Define.
(build_check_stmt): Change is_store argument to bool.  Emit GIMPLE
directly instead of creating trees and gimplifying them.  Mark
the error reporting function as very unlikely.
(instrument_derefs): Change is_store argument to bool.  Use
int_size_in_bytes to compute size_in_bytes, simplify size check.
Use build_fold_addr_expr instead of build_addr.
(transform_statements): Adjust instrument_derefs caller.
Use gimple_assign_single_p as stmt test.  Don't look at MEM refs
in rhs2.
(asan_init_shadow_ptr_types): New function.
(asan_instrument): Don't push/pop gimplify context.
Call asan_init_shadow_ptr_types if not yet initialized.
* asan.h (ASAN_SHADOW_SHIFT): Adjust comment.
gcc/ChangeLog.asan
gcc/Makefile.in
gcc/asan.c
gcc/asan.h