> This didn't really help make things look prettier. The notes are > enumerated in many other places, for various purposes. I didn't like > special-casing this one INSN_NOTE oddity when there are so many others > already. So I created a note_outside_basic_block_p instead, I hope you > agree with this approach.
Sure, thanks for investigating the proposal in any case. > Updated patch attached, similarly tested. OK for trunk? Yes, modulo a few nits: +/* Like add_insn_after, but try to set BLOCK_FOR_INSN. + If BB is NULL, an attempt is made to infer the bb from before. + + This and the next function should be the only functions called + to insert an insn once delay slots have been filled since only + they know how to update a SEQUENCE. */ + +void +add_insn_after (rtx insn, rtx after, basic_block bb) Like add_insn_after_nobb, ... -/* Add INSN into the doubly-linked list before insn BEFORE. This and - the previous should be the only functions called to insert an insn - once delay slots have been filled since only they know how to - update a SEQUENCE. If BB is NULL, an attempt is made to infer the - bb from before. */ +/* Like add_insn_before_nobb, but try to set BLOCK_FOR_INSN. + If BB is NULL, an attempt is made to infer the bb from before. */ void add_insn_before (rtx insn, rtx before, basic_block bb) Keep the blurb about SEQUENCEs: "This and the previous function should..." +/* Return true iff a note of kind SUBTYPE should be emitted with via + routines that never set BLOCK_FOR_INSN on NOTE. BB_BOUNDARY is true + if the caller is asked to emit a note before BB_HEAD, or after BB_END. */ Superfluous "with" or "via". +static bool +note_outside_basic_block_p (enum insn_note subtype, bool on_bb_boundary_p) +{ This should be implemented with a switch statement. -- Eric Botcazou