diff options
author | Dodji Seketeli <dodji@seketeli.org> | 2013-05-29 17:08:26 +0200 |
---|---|---|
committer | Dodji Seketeli <dodji@seketeli.org> | 2013-05-29 17:08:26 +0200 |
commit | 68874f1b66758e887cb0417b6947bc7b31bd5ac4 (patch) | |
tree | 36f03839207b62e06d6dca908995199556efde1e | |
parent | 1ac3253e4a42a3ff5bca99bb99f0a69022b048d9 (diff) | |
download | gcc-68874f1b66758e887cb0417b6947bc7b31bd5ac4.tar.gz |
Support REFERENCE_TYPE/POINTER_TYPE
gcc/cp
* abi-instr.cc (gen_type_in_scope): Generate instrumentation for
POINTER_TYPE, REFERENCE_TYPE nodes.
-rw-r--r-- | gcc/cp/abi-instr.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/cp/abi-instr.cc b/gcc/cp/abi-instr.cc index 2896e120eac..2fe987cdc1e 100644 --- a/gcc/cp/abi-instr.cc +++ b/gcc/cp/abi-instr.cc @@ -411,6 +411,39 @@ gen_type_in_scope (const_tree t, } break; + case POINTER_TYPE: + case REFERENCE_TYPE: + { + shared_ptr <abigail::type_base> pointed_to = gen_type (TREE_TYPE (t)); + if (pointed_to) + { + abigail::location loc = get_location (t); + if (TREE_CODE (t) == POINTER_TYPE) + { + shared_ptr <abigail::pointer_type_def> pointer_type + (new abigail::pointer_type_def + (pointed_to, + int_cst_value (TYPE_SIZE (t)), + TYPE_ALIGN (t), loc)); + + add_decl_to_scope (pointer_type, scope); + result = pointer_type; + } + else + { + shared_ptr <abigail::reference_type_def> reference_type + (new abigail::reference_type_def + (pointed_to, !TYPE_REF_IS_RVALUE (t), + int_cst_value (TYPE_SIZE (t)), + TYPE_ALIGN (t), loc)); + + add_decl_to_scope (reference_type, scope); + result = reference_type; + } + } + } + break; + default: break; } |