GCC Middle and Back End API Reference
|
Data Structures | |
struct | tsan_map_atomic |
Enumerations | |
enum | tsan_atomic_action { check_last, add_seq_cst, add_acquire, weak_cas, strong_cas, bool_cas, val_cas, lock_release, fetch_op, fetch_op_seq_cst } |
Functions | |
static tree | get_memory_access_decl () |
static tree | is_vptr_store () |
static bool | instrument_expr () |
static void | instrument_builtin_call () |
static bool | instrument_gimple () |
static bool | instrument_memory_accesses () |
static void | instrument_func_entry () |
static void | instrument_func_exit () |
static unsigned | tsan_pass () |
static bool | tsan_gate () |
void | tsan_finish_file () |
gimple_opt_pass * | make_pass_tsan () |
static bool | tsan_gate_O0 () |
gimple_opt_pass * | make_pass_tsan_O0 () |
Variables | |
static struct tsan_map_atomic | tsan_atomic_table [] |
enum tsan_atomic_action |
|
static |
@verbatim GCC instrumentation plugin for ThreadSanitizer.
Copyright (C) 2011-2013 Free Software Foundation, Inc. Contributed by Dmitry Vyukov dvyuk ov@g oogle .com
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
Number of instrumented memory accesses in the current function.
Builds the following decl void __tsan_read/writeX (void *addr);
References builtin_decl_implicit().
Referenced by instrument_expr().
|
static |
Instrument an atomic builtin.
References add_acquire, add_seq_cst, bool_cas, build_int_cst(), builtin_decl_implicit(), check_last, create_tmp_var(), fetch_op, fetch_op_seq_cst, g, gimple_assign_lhs(), gimple_build_assign_with_ops(), gimple_call_arg(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_num_args(), gimple_call_set_fndecl(), gimple_call_set_lhs(), gsi_insert_after(), gsi_insert_before(), GSI_NEW_STMT, GSI_SAME_STMT, gsi_stmt(), host_integerp(), HOST_WIDE_INT, integer_nonzerop(), lock_release, make_ssa_name(), mark_addressable(), MEMMODEL_ACQUIRE, MEMMODEL_RELEASE, MEMMODEL_SEQ_CST, strong_cas, tree_low_cst(), tsan_atomic_table, update_gimple_call(), update_stmt(), useless_type_conversion_p(), val_cas, and weak_cas.
Referenced by instrument_gimple().
|
static |
Instruments EXPR if needed. If any instrumentation is inserted, return true.
References builtin_decl_implicit(), pt_solution::escaped, find_fallthru_edge(), g, get_inner_reference(), get_memory_access_decl(), gimple_assign_lhs(), gimple_build_call(), gimple_location(), gimple_seq_add_stmt_without_update(), gimple_set_location(), gsi_bb(), gsi_insert_seq_after(), gsi_insert_seq_before(), gsi_insert_seq_on_edge_immediate(), GSI_NEW_STMT, GSI_SAME_STMT, gsi_stmt(), HOST_WIDE_INT, int_size_in_bytes(), pt_solution::ipa_escaped, is_ctrl_altering_stmt(), is_gimple_addressable(), is_gimple_call(), is_gimple_val(), is_global_var(), is_vptr_store(), make_ssa_name(), may_be_aliased(), memset(), pt_solution::nonlocal, offset, pt_solution_includes(), basic_block_def::succs, and unshare_expr().
Referenced by instrument_gimple().
|
static |
Instruments function entry.
References builtin_decl_implicit(), cfun, function::function_start_locus, g, gimple_build_call(), gimple_call_set_lhs(), gimple_set_location(), gsi_after_labels(), gsi_insert_before(), GSI_SAME_STMT, make_ssa_name(), and single_succ().
Referenced by tsan_pass().
|
static |
Instruments function exits.
References builtin_decl_implicit(), g, gimple_build_call(), gimple_call_builtin_p(), gimple_location(), gimple_set_location(), gsi_insert_before(), gsi_last_bb(), GSI_SAME_STMT, gsi_stmt(), basic_block_def::preds, and edge_def::src.
Referenced by tsan_pass().
|
static |
Instruments the gimple pointed to by GSI. Return true if func entry/exit should be instrumented.
References builtin_decl_implicit(), gimple_assign_lhs(), gimple_assign_load_p(), gimple_assign_rhs1(), gimple_call_fndecl(), gimple_clobber_p(), gimple_store_p(), gsi_stmt(), instrument_builtin_call(), instrument_expr(), is_gimple_assign(), is_gimple_builtin_call(), and is_gimple_call().
Referenced by instrument_memory_accesses().
|
static |
Instruments all interesting memory accesses in the current function. Return true if func entry/exit should be instrumented.
References gsi_end_p(), gsi_next(), gsi_start_bb(), and instrument_gimple().
Referenced by tsan_pass().
|
static |
Check as to whether EXPR refers to a store to vptr.
References gimple_assign_rhs1(), and gimple_assign_single_p().
Referenced by instrument_expr().
gimple_opt_pass* make_pass_tsan | ( | ) |
gimple_opt_pass* make_pass_tsan_O0 | ( | ) |
void tsan_finish_file | ( | void | ) |
Inserts __tsan_init () into the list of CTORs.
References append_to_statement_list(), build_call_expr(), builtin_decl_implicit(), cgraph_build_static_cdtor(), and initialize_sanitizer_builtins().
Referenced by compile_file().
|
static |
The pass's gate.
|
static |
|
static |
ThreadSanitizer instrumentation pass.
References initialize_sanitizer_builtins(), instrument_func_entry(), instrument_func_exit(), and instrument_memory_accesses().
|
static |
Referenced by instrument_builtin_call().