[llvm] 7fdb932 - [CodeGen] Add standard traits for LiveInterval::SingleLinkedListIterator (#79473)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 09:43:57 PST 2024
Author: Jay Foad
Date: 2024-01-25T17:43:53Z
New Revision: 7fdb932c4e78706cec3468a1f149e5a54a865d36
URL: https://github.com/llvm/llvm-project/commit/7fdb932c4e78706cec3468a1f149e5a54a865d36
DIFF: https://github.com/llvm/llvm-project/commit/7fdb932c4e78706cec3468a1f149e5a54a865d36.diff
LOG: [CodeGen] Add standard traits for LiveInterval::SingleLinkedListIterator (#79473)
For example this will allow LiveInterval::subranges() to be used in
any_of/all_of/none_of.
Added:
Modified:
llvm/include/llvm/CodeGen/LiveInterval.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h
index 590a48b17cce92..ad8dec68c073c0 100644
--- a/llvm/include/llvm/CodeGen/LiveInterval.h
+++ b/llvm/include/llvm/CodeGen/LiveInterval.h
@@ -731,6 +731,12 @@ namespace llvm {
T *P;
public:
+ using
diff erence_type = ptr
diff _t;
+ using value_type = T;
+ using pointer = T *;
+ using reference = T &;
+ using iterator_category = std::forward_iterator_tag;
+
SingleLinkedListIterator(T *P) : P(P) {}
SingleLinkedListIterator<T> &operator++() {
More information about the llvm-commits
mailing list