[thread-annotations] [patch] Migrate thread annotation/analysis code to GIMPLE tuple IR
Le-Chun Wu
lcwu@google.com
Wed Sep 3 00:58:00 GMT 2008
This patch is for the thread-annotations branch. In this patch, we
modified the code for thread-safety annotation and analysis to use the
new GIMPLE tuple IR. We also fixed an issue in the analysis of
"point_to_guarded_by" attribute when it is applied to class members.
The patched was bootstrapped and tested on i686-linux-gnu.
Le-chun
2008-09-02 Le-Chun Wu <lcwu@google.com>
* tree-threadsafe-analyze.c (get_lock_returned_by_call): New function
to return the lock specified in the lock_returned attribute.
(get_lockable_decl): Modified to use the GIMPLE tuple IR.
(get_canonical_expr): Ditto.
(get_actual_argument_from_position): Ditto.
(handle_lock_primitive_attrs): Ditto.
(handle_unlock_primitive_attr): Ditto.
(process_function_attrs): Ditto.
(handle_call_gs): New function that handles gimple call statements. It
replaces the old function handle_call_expr.
(analyze_expr): Modified to use the GIMPLE tuple IR. Added a new
parameter "is_indirect_ref" to support "point_to_guarded_by" attribute
in class members.
(get_trylock_info): Modified to use the GIMPLE tuple IR.
(handle_cond_gs): New function to handle gimple condition statements.
It replaces the old function is_condition_fed_by_trylock.
(analyze_stmt_r): New helper function for walk_gimple_stmt() that is
called on each gimple statement.
(analyze_op_r): New helper function for walk_gimple_stmt() that is
called on each operand of a visited gimple statement.
(execute_threadsafe_analyze): Modified to use the GIMPLE tuple IR.
* g++.dg/thread-ann/thread_annot_lock-21.C: New test.
* g++.dg/thread-ann/thread_annot_lock-22.C: New test.
* g++.dg/thread-ann/thread_annot_lock-4.C: Modified to not use function
calls in the lock expression, which is not longer supported after
moving lock annotation support to the new GIMPLE tuple IR.
* g++.dg/thread-ann/thread_annot_lock-7.C: Ditto.
* g++.dg/thread-ann/thread_annot_lock-8.C: Ditto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: annotations.patch
Type: text/x-patch
Size: 52483 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080903/a4b01edb/attachment.bin>
More information about the Gcc-patches
mailing list