aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/expr.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-03-19 05:22:04 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-03-19 05:22:04 +0000
commitcd8ed629642bebaa19a2fe544f0c3efcafe835f2 (patch)
tree27221340a82ba130909a03491572338e80e9b132 /gcc/cp/expr.c
parent3ca3ce41d7a697163986c9b73b8ee4cb389d65e9 (diff)
downloadgcc-cd8ed629642bebaa19a2fe544f0c3efcafe835f2.zip
gcc-cd8ed629642bebaa19a2fe544f0c3efcafe835f2.tar.gz
gcc-cd8ed629642bebaa19a2fe544f0c3efcafe835f2.tar.bz2
cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro.
* 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. From-SVN: r32631
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r--gcc/cp/expr.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index e97a65d..230fa6a 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
{