• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/AST/Interp/

Lines Matching refs:Boolean

1 //===--- Boolean.h - Wrapper for boolean types for the VM -------*- C++ -*-===//
25 class Boolean {
31 explicit Boolean(bool V) : V(V) {}
35 Boolean() : V(false) {}
37 bool operator<(Boolean RHS) const { return V < RHS.V; }
38 bool operator>(Boolean RHS) const { return V > RHS.V; }
39 bool operator<=(Boolean RHS) const { return V <= RHS.V; }
40 bool operator>=(Boolean RHS) const { return V >= RHS.V; }
41 bool operator==(Boolean RHS) const { return V == RHS.V; }
42 bool operator!=(Boolean RHS) const { return V != RHS.V; }
46 Boolean operator-() const { return Boolean(V); }
47 Boolean operator~() const { return Boolean(true); }
61 Boolean toUnsigned() const { return *this; }
74 ComparisonCategoryResult compare(const Boolean &RHS) const {
80 Boolean truncate(unsigned TruncBits) const { return *this; }
84 static Boolean min(unsigned NumBits) { return Boolean(false); }
85 static Boolean max(unsigned NumBits) { return Boolean(true); }
88 static std::enable_if_t<std::is_integral<T>::value, Boolean> from(T Value) {
89 return Boolean(Value != 0);
93 static std::enable_if_t<SrcBits != 0, Boolean>
95 return Boolean(!Value.isZero());
99 static Boolean from(Integral<0, SrcSign> Value) {
100 return Boolean(!Value.isZero());
103 static Boolean zero() { return from(false); }
106 static Boolean from(T Value, unsigned NumBits) {
107 return Boolean(Value);
114 static bool increment(Boolean A, Boolean *R) {
115 *R = Boolean(true);
119 static bool decrement(Boolean A, Boolean *R) {
123 static bool add(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
124 *R = Boolean(A.V || B.V);
128 static bool sub(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
129 *R = Boolean(A.V ^ B.V);
133 static bool mul(Boolean A, Boolean B, unsigned OpBits, Boolean *R) {
134 *R = Boolean(A.V && B.V);
139 inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const Boolean &B) {