This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to implement '@' GDB-like operator for libcc1
- From: Tom Tromey <tom at tromey dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, Phil Muldoon <pmuldoon at redhat dot com>
- Date: Mon, 16 Mar 2015 08:43:21 -0600
- Subject: Re: How to implement '@' GDB-like operator for libcc1
- Authentication-results: sourceware.org; auth=none
- References: <20150315192904 dot GA25492 at host1 dot jankratochvil dot net>
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> I have problems implementing '@' into GCC, could you suggest at which place
Jan> should I call build_array_type_nelts()? Or is it the right way at all?
Jan> + case ATSIGN_EXPR:
Jan> + orig_op0 = op0 = TREE_OPERAND (expr, 0);
Jan> + orig_op1 = op1 = TREE_OPERAND (expr, 1);
[...]
Jan> + ret = build_array_type_nelts (TREE_TYPE (op0), tree_to_uhwi (op1));
It seems like there should be some kind of reference to &op0, that is,
lowering ATSIGN_EXPR to *(typeof(OP0)[OP1]*)(&OP0).
Also, I this has to consider the case where OP1 is not a constant.
Tom