https://gcc.gnu.org/g:c1569cc3a64242ebfcf9b9b6aa621db568475b04
commit r17-6196-gc1569cc3a64242ebfcf9b9b6aa621db568475b04 Author: Trevor Saunders <[email protected]> Date: Mon Nov 9 05:12:56 2026 +0000 Use functions for three insn predicates gcc/ChangeLog: * rtl.h (NOTE_INSN_BASIC_BLOCK_P, DEBUG_BIND_INSN_P, NOTE_DURING_CALL_P, set_note_during_call_p): Use functions on an rtx_insn *. * var-tracking.cc (emit_note_insn_var_location): Use set_note_during_call_p to store the flag. Signed-off-by: Trevor Saunders <[email protected]> Diff: --- gcc/rtl.h | 35 +++++++++++++++++++++++++---------- gcc/var-tracking.cc | 2 +- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gcc/rtl.h b/gcc/rtl.h index b94f1e9f9061..d4ba485feb9e 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1729,10 +1729,6 @@ extern const char * const reg_note_name[]; Other kinds of NOTEs are identified by negative numbers here. */ #define NOTE_KIND(INSN) XCINT (INSN, 4, NOTE) -/* Nonzero if INSN is a note marking the beginning of a basic block. */ -#define NOTE_INSN_BASIC_BLOCK_P(INSN) \ - (NOTE_P (INSN) && NOTE_KIND (INSN) == NOTE_INSN_BASIC_BLOCK) - /* Nonzero if INSN is a debug nonbind marker note, for which NOTE_MARKER_LOCATION can be used. */ #define NOTE_MARKER_P(INSN) \ @@ -1761,10 +1757,12 @@ extern const char * const reg_note_name[]; /* Evaluate to TRUE if INSN is a debug insn that denotes a variable location/value tracking annotation. */ -#define DEBUG_BIND_INSN_P(INSN) \ - (DEBUG_INSN_P (INSN) \ - && (GET_CODE (PATTERN (INSN)) \ - == VAR_LOCATION)) +inline bool +DEBUG_BIND_INSN_P (const rtx_insn *insn) +{ + return DEBUG_INSN_P (insn) && GET_CODE (PATTERN (insn)) == VAR_LOCATION; +} + /* Evaluate to TRUE if INSN is a debug insn that denotes a program source location marker. */ #define DEBUG_MARKER_INSN_P(INSN) \ @@ -1815,8 +1813,17 @@ extern const char * const reg_note_name[]; /* 1 if RTX is emitted after a call, but it should take effect before the call returns. */ -#define NOTE_DURING_CALL_P(RTX) \ - (RTL_FLAG_CHECK1 ("NOTE_VAR_LOCATION_DURING_CALL_P", (RTX), NOTE)->call) +inline bool +NOTE_DURING_CALL_P (const rtx_insn *note) +{ + return RTL_FLAG_CHECK1 ("NOTE_VAR_LOCATION_DURING_CALL_P", note, NOTE)->call; +} + +inline void +set_note_during_call_p (rtx_insn *note, bool set) +{ + RTL_FLAG_CHECK1 ("NOTE_VAR_LOCATION_DURING_CALL_P", note, NOTE)->call = set; +} /* DEBUG_EXPR_DECL corresponding to a DEBUG_EXPR RTX. */ #define DEBUG_EXPR_TREE_DECL(RTX) XCTREE (RTX, 0, DEBUG_EXPR) @@ -1845,6 +1852,14 @@ enum insn_note NOTE_INSN_MAX }; +/* Nonzero if INSN is a note marking the beginning of a basic block. */ + +inline bool +NOTE_INSN_BASIC_BLOCK_P (const rtx_insn *insn) +{ + return NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_BASIC_BLOCK; +} + /* Names for NOTE insn's other than line numbers. */ extern const char * const note_insn_name[NOTE_INSN_MAX]; diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc index 9781dd33de2e..71f1edbae931 100644 --- a/gcc/var-tracking.cc +++ b/gcc/var-tracking.cc @@ -8898,7 +8898,7 @@ emit_note_insn_var_location (variable **varp, emit_note_data *data) { note = emit_note_after (NOTE_INSN_VAR_LOCATION, insn); if (where == EMIT_NOTE_AFTER_CALL_INSN) - NOTE_DURING_CALL_P (note) = true; + set_note_during_call_p (note, true); } else {
