File indexing completed on 2026-05-10 08:43:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef LLVM_ADT_SLOWDYNAMICAPINT_H
0019 #define LLVM_ADT_SLOWDYNAMICAPINT_H
0020
0021 #include "llvm/ADT/APInt.h"
0022
0023 namespace llvm {
0024 class DynamicAPInt;
0025 class raw_ostream;
0026 }
0027
0028 namespace llvm::detail {
0029
0030
0031
0032
0033
0034 class SlowDynamicAPInt {
0035 APInt Val;
0036
0037 public:
0038 explicit SlowDynamicAPInt(int64_t Val);
0039 SlowDynamicAPInt();
0040 explicit SlowDynamicAPInt(const APInt &Val);
0041 SlowDynamicAPInt &operator=(int64_t Val);
0042 explicit operator int64_t() const;
0043 SlowDynamicAPInt operator-() const;
0044 bool operator==(const SlowDynamicAPInt &O) const;
0045 bool operator!=(const SlowDynamicAPInt &O) const;
0046 bool operator>(const SlowDynamicAPInt &O) const;
0047 bool operator<(const SlowDynamicAPInt &O) const;
0048 bool operator<=(const SlowDynamicAPInt &O) const;
0049 bool operator>=(const SlowDynamicAPInt &O) const;
0050 SlowDynamicAPInt operator+(const SlowDynamicAPInt &O) const;
0051 SlowDynamicAPInt operator-(const SlowDynamicAPInt &O) const;
0052 SlowDynamicAPInt operator*(const SlowDynamicAPInt &O) const;
0053 SlowDynamicAPInt operator/(const SlowDynamicAPInt &O) const;
0054 SlowDynamicAPInt operator%(const SlowDynamicAPInt &O) const;
0055 SlowDynamicAPInt &operator+=(const SlowDynamicAPInt &O);
0056 SlowDynamicAPInt &operator-=(const SlowDynamicAPInt &O);
0057 SlowDynamicAPInt &operator*=(const SlowDynamicAPInt &O);
0058 SlowDynamicAPInt &operator/=(const SlowDynamicAPInt &O);
0059 SlowDynamicAPInt &operator%=(const SlowDynamicAPInt &O);
0060
0061 SlowDynamicAPInt &operator++();
0062 SlowDynamicAPInt &operator--();
0063
0064 friend SlowDynamicAPInt abs(const SlowDynamicAPInt &X);
0065 friend SlowDynamicAPInt ceilDiv(const SlowDynamicAPInt &LHS,
0066 const SlowDynamicAPInt &RHS);
0067 friend SlowDynamicAPInt floorDiv(const SlowDynamicAPInt &LHS,
0068 const SlowDynamicAPInt &RHS);
0069
0070 friend SlowDynamicAPInt gcd(const SlowDynamicAPInt &A,
0071 const SlowDynamicAPInt &B);
0072
0073
0074 friend hash_code hash_value(const SlowDynamicAPInt &X);
0075
0076
0077 friend DynamicAPInt;
0078
0079 unsigned getBitWidth() const { return Val.getBitWidth(); }
0080
0081 void print(raw_ostream &OS) const;
0082 LLVM_DUMP_METHOD void dump() const;
0083 };
0084
0085 inline raw_ostream &operator<<(raw_ostream &OS, const SlowDynamicAPInt &X) {
0086 X.print(OS);
0087 return OS;
0088 }
0089
0090
0091
0092
0093
0094 SlowDynamicAPInt mod(const SlowDynamicAPInt &LHS, const SlowDynamicAPInt &RHS);
0095
0096
0097 SlowDynamicAPInt lcm(const SlowDynamicAPInt &A, const SlowDynamicAPInt &B);
0098
0099
0100
0101 SlowDynamicAPInt abs(const SlowDynamicAPInt &X);
0102 SlowDynamicAPInt ceilDiv(const SlowDynamicAPInt &LHS,
0103 const SlowDynamicAPInt &RHS);
0104 SlowDynamicAPInt floorDiv(const SlowDynamicAPInt &LHS,
0105 const SlowDynamicAPInt &RHS);
0106 SlowDynamicAPInt gcd(const SlowDynamicAPInt &A, const SlowDynamicAPInt &B);
0107 hash_code hash_value(const SlowDynamicAPInt &X);
0108
0109
0110
0111
0112 SlowDynamicAPInt &operator+=(SlowDynamicAPInt &A, int64_t B);
0113 SlowDynamicAPInt &operator-=(SlowDynamicAPInt &A, int64_t B);
0114 SlowDynamicAPInt &operator*=(SlowDynamicAPInt &A, int64_t B);
0115 SlowDynamicAPInt &operator/=(SlowDynamicAPInt &A, int64_t B);
0116 SlowDynamicAPInt &operator%=(SlowDynamicAPInt &A, int64_t B);
0117
0118 bool operator==(const SlowDynamicAPInt &A, int64_t B);
0119 bool operator!=(const SlowDynamicAPInt &A, int64_t B);
0120 bool operator>(const SlowDynamicAPInt &A, int64_t B);
0121 bool operator<(const SlowDynamicAPInt &A, int64_t B);
0122 bool operator<=(const SlowDynamicAPInt &A, int64_t B);
0123 bool operator>=(const SlowDynamicAPInt &A, int64_t B);
0124 SlowDynamicAPInt operator+(const SlowDynamicAPInt &A, int64_t B);
0125 SlowDynamicAPInt operator-(const SlowDynamicAPInt &A, int64_t B);
0126 SlowDynamicAPInt operator*(const SlowDynamicAPInt &A, int64_t B);
0127 SlowDynamicAPInt operator/(const SlowDynamicAPInt &A, int64_t B);
0128 SlowDynamicAPInt operator%(const SlowDynamicAPInt &A, int64_t B);
0129
0130 bool operator==(int64_t A, const SlowDynamicAPInt &B);
0131 bool operator!=(int64_t A, const SlowDynamicAPInt &B);
0132 bool operator>(int64_t A, const SlowDynamicAPInt &B);
0133 bool operator<(int64_t A, const SlowDynamicAPInt &B);
0134 bool operator<=(int64_t A, const SlowDynamicAPInt &B);
0135 bool operator>=(int64_t A, const SlowDynamicAPInt &B);
0136 SlowDynamicAPInt operator+(int64_t A, const SlowDynamicAPInt &B);
0137 SlowDynamicAPInt operator-(int64_t A, const SlowDynamicAPInt &B);
0138 SlowDynamicAPInt operator*(int64_t A, const SlowDynamicAPInt &B);
0139 SlowDynamicAPInt operator/(int64_t A, const SlowDynamicAPInt &B);
0140 SlowDynamicAPInt operator%(int64_t A, const SlowDynamicAPInt &B);
0141 }
0142
0143 #endif