On 11/04/14 09:24, David Malcolm wrote:
So presumably no multi-way branches yet? Might be better to build the
API in such a way that it handles multi-way branches from the get-go
rather than retrofitting later. Your call.
This is an internal API. If the external API needs to support building
switch statements from client code maybe with something like this:
extern void
gcc_jit_block_end_with_switch (gcc_jit_block *block,
gcc_jit_location *loc,
gcc_jit_rvalue *expr,
int num_cases,
gcc_jit_rvalue **case_values,
gcc_jit_block **case_blocks,
gcc_jit_block *default_block);
then this internal API would obviously need to change, maybe becoming:
virtual int get_num_successor_blocks () const;
virtual block *get_successor_block (int index) const;
but that won't affect the public API.
That said it's not clear to me that we do need to support switch
statements; no JIT implementation I've seen has needed them
(I put them in the "Probably not needed" section of TODO.rst).
Fair enough :-)
jeff