================
@@ -56,6 +56,8 @@ constexpr OverflowBehavior &operator&=(OverflowBehavior &a,
return a;
}
+constexpr bool any(OverflowBehavior ob) { return ob != OverflowBehavior::None;
}
----------------
andykaylor wrote:
This is definitely cleaner than the old code, but what would you think about a
function that tests a specified flag? So rather than
`op.setNoUnsignedWrap(any(ob & OverflowBehavior::NoUnsignedWrap));`
you'd have
`op.setNoUnsignedWrap(testFlag(ob, OverflowBehavior::NoUnsignedWrap));`
Obviously this is minor and could be a future change if you think it's a good
idea.
https://github.com/llvm/llvm-project/pull/184227
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits