[PATCH] D97522: Fix the value_type of defusechain_iterator to match its operator*()

Nicolas Guillemot via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 20:42:24 PST 2021


nlguillemot updated this revision to Diff 326593.
nlguillemot added a comment.

Also fixed the wrong type in the base class.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97522/new/

https://reviews.llvm.org/D97522

Files:
  llvm/include/llvm/CodeGen/MachineRegisterInfo.h


Index: llvm/include/llvm/CodeGen/MachineRegisterInfo.h
===================================================================
--- llvm/include/llvm/CodeGen/MachineRegisterInfo.h
+++ llvm/include/llvm/CodeGen/MachineRegisterInfo.h
@@ -968,10 +968,10 @@
   /// returns defs.  If neither are true then you are silly and it always
   /// returns end().  If SkipDebug is true it skips uses marked Debug
   /// when incrementing.
-  template<bool ReturnUses, bool ReturnDefs, bool SkipDebug,
-           bool ByOperand, bool ByInstr, bool ByBundle>
-  class defusechain_iterator
-    : public std::iterator<std::forward_iterator_tag, MachineInstr, ptrdiff_t> {
+  template <bool ReturnUses, bool ReturnDefs, bool SkipDebug, bool ByOperand,
+            bool ByInstr, bool ByBundle>
+  class defusechain_iterator : public std::iterator<std::forward_iterator_tag,
+                                                    MachineOperand, ptrdiff_t> {
     friend class MachineRegisterInfo;
 
     MachineOperand *Op = nullptr;
@@ -1008,10 +1008,10 @@
     }
 
   public:
-    using reference = std::iterator<std::forward_iterator_tag,
-                                    MachineInstr, ptrdiff_t>::reference;
-    using pointer = std::iterator<std::forward_iterator_tag,
-                                  MachineInstr, ptrdiff_t>::pointer;
+    using reference = std::iterator<std::forward_iterator_tag, MachineOperand,
+                                    ptrdiff_t>::reference;
+    using pointer = std::iterator<std::forward_iterator_tag, MachineOperand,
+                                  ptrdiff_t>::pointer;
 
     defusechain_iterator() = default;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97522.326593.patch
Type: text/x-patch
Size: 1642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210226/cac773d6/attachment.bin>


More information about the llvm-commits mailing list