diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-19 05:22:04 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-19 05:22:04 +0000 |
commit | ad63a0fca1c16a7b56f4f29888a87ee535cb9f4c (patch) | |
tree | 27221340a82ba130909a03491572338e80e9b132 /gcc/cp/expr.c | |
parent | 562b698d89a7c68dd22d8452a67bd34e4e65871f (diff) | |
download | gcc-ad63a0fca1c16a7b56f4f29888a87ee535cb9f4c.tar.gz |
* cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro.
* class.c (check_bitfield_decl): Turn illegal bitfields into
non-bitfields.
(dfs_propagate_binfo_offsets): Adjust for new size_binop
semantics.
(dfs_offset_for_unshared_vbases): Likewise.
* cvt.c (cp_convert_to_pointer): Convert NULL to a
pointer-to-member correctly under the new ABI.
* expr.c (cplus_expand_constant): Don't use cp_convert when
turning an offset into a pointer-to-member.
* init.c (resolve_offset_ref): Don't adjust pointers-to-members
when dereferencing them under the new ABI.
* typeck.c (get_member_function_from_ptrfunc): Tweak calculation
of pointers-to-members under the new ABI.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32631 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r-- | gcc/cp/expr.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index e97a65d55e8..230fa6a154b 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -65,11 +65,18 @@ cplus_expand_constant (cst) bit_position (member), bitsize_int (BITS_PER_UNIT))); - /* We offset all pointer to data members by 1 so that we - can distinguish between a null pointer to data member - and the first data member of a structure. */ - offset = size_binop (PLUS_EXPR, offset, size_one_node); - cst = cp_convert (type, offset); + if (flag_new_abi) + /* Under the new ABI, we use -1 to represent the NULL + pointer; non-NULL values simply contain the offset of + the data member. */ + ; + else + /* We offset all pointer to data members by 1 so that we + can distinguish between a null pointer to data member + and the first data member of a structure. */ + offset = size_binop (PLUS_EXPR, offset, size_one_node); + + cst = fold (build1 (NOP_EXPR, type, offset)); } else { |