// next_use () && next_use ()->is_in_any_insn () ? next_use () : nullptr
use_info *next_any_insn_use () const;
+ // Return the next use by a debug instruction, or null if none.
+ // This is only valid if if is_in_debug_insn ().
+ use_info *next_debug_insn_use () const;
+
// Return the previous use by a phi node in the list, or null if none.
//
// This is only valid if is_in_phi (). It is equivalent to:
// of use in the same definition.
using nondebug_insn_use_iterator
= list_iterator<use_info, &use_info::next_nondebug_insn_use>;
+using debug_insn_use_iterator
+ = list_iterator<use_info, &use_info::next_debug_insn_use>;
using any_insn_use_iterator
= list_iterator<use_info, &use_info::next_any_insn_use>;
using phi_use_iterator = list_iterator<use_info, &use_info::prev_phi_use>;
use_info *first_nondebug_insn_use () const;
use_info *last_nondebug_insn_use () const;
+ // Return the first use of the set by debug instructions, or null if
+ // there is no such use.
+ use_info *first_debug_insn_use () const;
+
// Return the first use of the set by any kind of instruction, or null
// if there are no such uses. The uses are in the order described above.
use_info *first_any_insn_use () const;
// List the uses of the set by nondebug instructions, in reverse postorder.
iterator_range<nondebug_insn_use_iterator> nondebug_insn_uses () const;
+ // List the uses of the set by debug instructions, in reverse postorder.
+ iterator_range<debug_insn_use_iterator> debug_insn_uses () const;
+
// Return nondebug_insn_uses () in reverse order.
iterator_range<reverse_use_iterator> reverse_nondebug_insn_uses () const;
return nullptr;
}
+inline use_info *
+use_info::next_debug_insn_use () const
+{
+ if (auto use = next_use ())
+ if (use->is_in_debug_insn ())
+ return use;
+ return nullptr;
+}
+
inline use_info *
use_info::prev_phi_use () const
{
return nullptr;
}
+inline use_info *
+set_info::first_debug_insn_use () const
+{
+ use_info *use;
+ if (has_nondebug_insn_uses ())
+ use = last_nondebug_insn_use ()->next_use ();
+ else
+ use = first_use ();
+
+ if (use && use->is_in_debug_insn ())
+ return use;
+ return nullptr;
+}
+
inline use_info *
set_info::first_any_insn_use () const
{
return { first_nondebug_insn_use (), nullptr };
}
+inline iterator_range<debug_insn_use_iterator>
+set_info::debug_insn_uses () const
+{
+ return { first_debug_insn_use (), nullptr };
+}
+
inline iterator_range<reverse_use_iterator>
set_info::reverse_nondebug_insn_uses () const
{