+/* Arrange for us to emit a source location note before any further
+ real insns or section changes, by setting the SEEN_NEXT_VIEW bit in
+ *SEEN, as long as we are keeping track of location views. The bit
+ indicates we have referenced the next view at the current PC, so we
+ have to emit it. This should be called next to the var_location
+ debug hook. */
+
+static inline void
+set_next_view_needed (int *seen)
+{
+ if (debug_variable_location_views)
+ *seen |= SEEN_NEXT_VIEW;
+}
+
+/* Clear the flag in *SEEN indicating we need to emit the next view.
+ This should be called next to the source_line debug hook. */
+
+static inline void
+clear_next_view_needed (int *seen)
+{
+ *seen &= ~SEEN_NEXT_VIEW;
+}
+
+/* Test whether we have a pending request to emit the next view in
+ *SEEN, and emit it if needed, clearing the request bit. */
+
+static inline void
+maybe_output_next_view (int *seen)
+{
+ if ((*seen & SEEN_NEXT_VIEW) != 0)
+ {
+ clear_next_view_needed (seen);
+ (*debug_hooks->source_line) (last_linenum, last_columnnum,
+ last_filename, last_discriminator,
+ false);
+ }
+}
+
+/* We want to emit param bindings (before the first begin_stmt) in the
+ initial view, if we are emitting views. To that end, we may
+ consume initial notes in the function, processing them in
+ final_start_function, before signaling the beginning of the
+ prologue, rather than in final.
+
+ We don't test whether the DECLs are PARM_DECLs: the assumption is
+ that there will be a NOTE_INSN_BEGIN_STMT marker before any
+ non-parameter NOTE_INSN_VAR_LOCATION. It's ok if the marker is not
+ there, we'll just have more variable locations bound in the initial
+ view, which is consistent with their being bound without any code
+ that would give them a value. */
+
+static inline bool
+in_initial_view_p (rtx_insn *insn)
+{
+ return (!DECL_IGNORED_P (current_function_decl)
+ && debug_variable_location_views
+ && insn && GET_CODE (insn) == NOTE
+ && (NOTE_KIND (insn) == NOTE_INSN_VAR_LOCATION
+ || NOTE_KIND (insn) == NOTE_INSN_DELETED));
+}
+