[PATCH] D86647: [Attributor] Add missing operators for ChangeStatus
Kuter Dinel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 11:43:49 PDT 2020
kuter created this revision.
Herald added subscribers: llvm-commits, okura, uenoku, hiraditya.
Herald added a reviewer: uenoku.
Herald added a reviewer: homerdin.
Herald added a project: LLVM.
kuter requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added a subscriber: bbn.
This patch adds the missing &= and |= operatos for ChangeStatus.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86647
Files:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
Index: llvm/lib/Transforms/IPO/Attributor.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Attributor.cpp
+++ llvm/lib/Transforms/IPO/Attributor.cpp
@@ -135,9 +135,15 @@
ChangeStatus llvm::operator|(ChangeStatus l, ChangeStatus r) {
return l == ChangeStatus::CHANGED ? l : r;
}
+
+void llvm::operator|=(ChangeStatus &l, ChangeStatus r) { l = l | r; }
+
ChangeStatus llvm::operator&(ChangeStatus l, ChangeStatus r) {
return l == ChangeStatus::UNCHANGED ? l : r;
}
+
+void llvm::operator&=(ChangeStatus &l, ChangeStatus r) { l = l & r; }
+
///}
/// Return true if \p New is equal or worse than \p Old.
Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -142,7 +142,9 @@
};
ChangeStatus operator|(ChangeStatus l, ChangeStatus r);
+void operator|=(ChangeStatus &l, ChangeStatus r);
ChangeStatus operator&(ChangeStatus l, ChangeStatus r);
+void operator&=(ChangeStatus &l, ChangeStatus r);
enum class DepClassTy {
REQUIRED,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86647.288056.patch
Type: text/x-patch
Size: 1168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200826/ab6e8dac/attachment.bin>
More information about the llvm-commits
mailing list