[llvm] [RemoveDIs][DebugInfo][NFC] Add Instruction and convenience functions to DPValue (PR #77896)
    Jeremy Morse via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Jan 12 08:10:38 PST 2024
    
    
  
================
@@ -91,6 +91,9 @@ class DPValue : public ilist_node<DPValue>, private DebugValueUser {
   void removeFromParent();
   void eraseFromParent();
 
+  DPValue *getNextNode() { return &*(++getIterator()); }
+  DPValue *getPrevNode() { return &*(--getIterator()); }
----------------
jmorse wrote:
I'd strongly suggest std::next or std::prev rather than increment operators -- that avoid there being any idea of mutating state.
https://github.com/llvm/llvm-project/pull/77896
    
    
More information about the llvm-commits
mailing list