Skip to content

Commit 0be69e5

Browse files
authored
[support] SlowDynamicAPInt: use fully qualified namespaces for func definitions (llvm#132575)
Found while trying to amalgamate support lib. And I think current code style require it anyway.
1 parent a187060 commit 0be69e5

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

llvm/lib/Support/SlowDynamicAPInt.cpp

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "llvm/Support/raw_ostream.h"
1313

1414
using namespace llvm;
15-
using namespace detail;
15+
using namespace llvm::detail;
1616

1717
SlowDynamicAPInt::SlowDynamicAPInt(int64_t Val)
1818
: Val(64, Val, /*isSigned=*/true) {}
@@ -23,94 +23,94 @@ SlowDynamicAPInt &SlowDynamicAPInt::operator=(int64_t Val) {
2323
}
2424
SlowDynamicAPInt::operator int64_t() const { return Val.getSExtValue(); }
2525

26-
hash_code detail::hash_value(const SlowDynamicAPInt &X) {
26+
hash_code llvm::detail::hash_value(const SlowDynamicAPInt &X) {
2727
return hash_value(X.Val);
2828
}
2929

3030
/// ---------------------------------------------------------------------------
3131
/// Convenience operator overloads for int64_t.
3232
/// ---------------------------------------------------------------------------
33-
SlowDynamicAPInt &detail::operator+=(SlowDynamicAPInt &A, int64_t B) {
33+
SlowDynamicAPInt &llvm::detail::operator+=(SlowDynamicAPInt &A, int64_t B) {
3434
return A += SlowDynamicAPInt(B);
3535
}
36-
SlowDynamicAPInt &detail::operator-=(SlowDynamicAPInt &A, int64_t B) {
36+
SlowDynamicAPInt &llvm::detail::operator-=(SlowDynamicAPInt &A, int64_t B) {
3737
return A -= SlowDynamicAPInt(B);
3838
}
39-
SlowDynamicAPInt &detail::operator*=(SlowDynamicAPInt &A, int64_t B) {
39+
SlowDynamicAPInt &llvm::detail::operator*=(SlowDynamicAPInt &A, int64_t B) {
4040
return A *= SlowDynamicAPInt(B);
4141
}
42-
SlowDynamicAPInt &detail::operator/=(SlowDynamicAPInt &A, int64_t B) {
42+
SlowDynamicAPInt &llvm::detail::operator/=(SlowDynamicAPInt &A, int64_t B) {
4343
return A /= SlowDynamicAPInt(B);
4444
}
45-
SlowDynamicAPInt &detail::operator%=(SlowDynamicAPInt &A, int64_t B) {
45+
SlowDynamicAPInt &llvm::detail::operator%=(SlowDynamicAPInt &A, int64_t B) {
4646
return A %= SlowDynamicAPInt(B);
4747
}
4848

49-
bool detail::operator==(const SlowDynamicAPInt &A, int64_t B) {
49+
bool llvm::detail::operator==(const SlowDynamicAPInt &A, int64_t B) {
5050
return A == SlowDynamicAPInt(B);
5151
}
52-
bool detail::operator!=(const SlowDynamicAPInt &A, int64_t B) {
52+
bool llvm::detail::operator!=(const SlowDynamicAPInt &A, int64_t B) {
5353
return A != SlowDynamicAPInt(B);
5454
}
55-
bool detail::operator>(const SlowDynamicAPInt &A, int64_t B) {
55+
bool llvm::detail::operator>(const SlowDynamicAPInt &A, int64_t B) {
5656
return A > SlowDynamicAPInt(B);
5757
}
58-
bool detail::operator<(const SlowDynamicAPInt &A, int64_t B) {
58+
bool llvm::detail::operator<(const SlowDynamicAPInt &A, int64_t B) {
5959
return A < SlowDynamicAPInt(B);
6060
}
61-
bool detail::operator<=(const SlowDynamicAPInt &A, int64_t B) {
61+
bool llvm::detail::operator<=(const SlowDynamicAPInt &A, int64_t B) {
6262
return A <= SlowDynamicAPInt(B);
6363
}
64-
bool detail::operator>=(const SlowDynamicAPInt &A, int64_t B) {
64+
bool llvm::detail::operator>=(const SlowDynamicAPInt &A, int64_t B) {
6565
return A >= SlowDynamicAPInt(B);
6666
}
67-
SlowDynamicAPInt detail::operator+(const SlowDynamicAPInt &A, int64_t B) {
67+
SlowDynamicAPInt llvm::detail::operator+(const SlowDynamicAPInt &A, int64_t B) {
6868
return A + SlowDynamicAPInt(B);
6969
}
70-
SlowDynamicAPInt detail::operator-(const SlowDynamicAPInt &A, int64_t B) {
70+
SlowDynamicAPInt llvm::detail::operator-(const SlowDynamicAPInt &A, int64_t B) {
7171
return A - SlowDynamicAPInt(B);
7272
}
73-
SlowDynamicAPInt detail::operator*(const SlowDynamicAPInt &A, int64_t B) {
73+
SlowDynamicAPInt llvm::detail::operator*(const SlowDynamicAPInt &A, int64_t B) {
7474
return A * SlowDynamicAPInt(B);
7575
}
76-
SlowDynamicAPInt detail::operator/(const SlowDynamicAPInt &A, int64_t B) {
76+
SlowDynamicAPInt llvm::detail::operator/(const SlowDynamicAPInt &A, int64_t B) {
7777
return A / SlowDynamicAPInt(B);
7878
}
79-
SlowDynamicAPInt detail::operator%(const SlowDynamicAPInt &A, int64_t B) {
79+
SlowDynamicAPInt llvm::detail::operator%(const SlowDynamicAPInt &A, int64_t B) {
8080
return A % SlowDynamicAPInt(B);
8181
}
8282

83-
bool detail::operator==(int64_t A, const SlowDynamicAPInt &B) {
83+
bool llvm::detail::operator==(int64_t A, const SlowDynamicAPInt &B) {
8484
return SlowDynamicAPInt(A) == B;
8585
}
86-
bool detail::operator!=(int64_t A, const SlowDynamicAPInt &B) {
86+
bool llvm::detail::operator!=(int64_t A, const SlowDynamicAPInt &B) {
8787
return SlowDynamicAPInt(A) != B;
8888
}
89-
bool detail::operator>(int64_t A, const SlowDynamicAPInt &B) {
89+
bool llvm::detail::operator>(int64_t A, const SlowDynamicAPInt &B) {
9090
return SlowDynamicAPInt(A) > B;
9191
}
92-
bool detail::operator<(int64_t A, const SlowDynamicAPInt &B) {
92+
bool llvm::detail::operator<(int64_t A, const SlowDynamicAPInt &B) {
9393
return SlowDynamicAPInt(A) < B;
9494
}
95-
bool detail::operator<=(int64_t A, const SlowDynamicAPInt &B) {
95+
bool llvm::detail::operator<=(int64_t A, const SlowDynamicAPInt &B) {
9696
return SlowDynamicAPInt(A) <= B;
9797
}
98-
bool detail::operator>=(int64_t A, const SlowDynamicAPInt &B) {
98+
bool llvm::detail::operator>=(int64_t A, const SlowDynamicAPInt &B) {
9999
return SlowDynamicAPInt(A) >= B;
100100
}
101-
SlowDynamicAPInt detail::operator+(int64_t A, const SlowDynamicAPInt &B) {
101+
SlowDynamicAPInt llvm::detail::operator+(int64_t A, const SlowDynamicAPInt &B) {
102102
return SlowDynamicAPInt(A) + B;
103103
}
104-
SlowDynamicAPInt detail::operator-(int64_t A, const SlowDynamicAPInt &B) {
104+
SlowDynamicAPInt llvm::detail::operator-(int64_t A, const SlowDynamicAPInt &B) {
105105
return SlowDynamicAPInt(A) - B;
106106
}
107-
SlowDynamicAPInt detail::operator*(int64_t A, const SlowDynamicAPInt &B) {
107+
SlowDynamicAPInt llvm::detail::operator*(int64_t A, const SlowDynamicAPInt &B) {
108108
return SlowDynamicAPInt(A) * B;
109109
}
110-
SlowDynamicAPInt detail::operator/(int64_t A, const SlowDynamicAPInt &B) {
110+
SlowDynamicAPInt llvm::detail::operator/(int64_t A, const SlowDynamicAPInt &B) {
111111
return SlowDynamicAPInt(A) / B;
112112
}
113-
SlowDynamicAPInt detail::operator%(int64_t A, const SlowDynamicAPInt &B) {
113+
SlowDynamicAPInt llvm::detail::operator%(int64_t A, const SlowDynamicAPInt &B) {
114114
return SlowDynamicAPInt(A) % B;
115115
}
116116

@@ -187,19 +187,19 @@ SlowDynamicAPInt SlowDynamicAPInt::operator/(const SlowDynamicAPInt &O) const {
187187
return SlowDynamicAPInt(
188188
runOpWithExpandOnOverflow(Val, O.Val, std::mem_fn(&APInt::sdiv_ov)));
189189
}
190-
SlowDynamicAPInt detail::abs(const SlowDynamicAPInt &X) {
190+
SlowDynamicAPInt llvm::detail::abs(const SlowDynamicAPInt &X) {
191191
return X >= 0 ? X : -X;
192192
}
193-
SlowDynamicAPInt detail::ceilDiv(const SlowDynamicAPInt &LHS,
194-
const SlowDynamicAPInt &RHS) {
193+
SlowDynamicAPInt llvm::detail::ceilDiv(const SlowDynamicAPInt &LHS,
194+
const SlowDynamicAPInt &RHS) {
195195
if (RHS == -1)
196196
return -LHS;
197197
unsigned Width = getMaxWidth(LHS.Val, RHS.Val);
198198
return SlowDynamicAPInt(APIntOps::RoundingSDiv(
199199
LHS.Val.sext(Width), RHS.Val.sext(Width), APInt::Rounding::UP));
200200
}
201-
SlowDynamicAPInt detail::floorDiv(const SlowDynamicAPInt &LHS,
202-
const SlowDynamicAPInt &RHS) {
201+
SlowDynamicAPInt llvm::detail::floorDiv(const SlowDynamicAPInt &LHS,
202+
const SlowDynamicAPInt &RHS) {
203203
if (RHS == -1)
204204
return -LHS;
205205
unsigned Width = getMaxWidth(LHS.Val, RHS.Val);
@@ -208,23 +208,23 @@ SlowDynamicAPInt detail::floorDiv(const SlowDynamicAPInt &LHS,
208208
}
209209
// The RHS is always expected to be positive, and the result
210210
/// is always non-negative.
211-
SlowDynamicAPInt detail::mod(const SlowDynamicAPInt &LHS,
212-
const SlowDynamicAPInt &RHS) {
211+
SlowDynamicAPInt llvm::detail::mod(const SlowDynamicAPInt &LHS,
212+
const SlowDynamicAPInt &RHS) {
213213
assert(RHS >= 1 && "mod is only supported for positive divisors!");
214214
return LHS % RHS < 0 ? LHS % RHS + RHS : LHS % RHS;
215215
}
216216

217-
SlowDynamicAPInt detail::gcd(const SlowDynamicAPInt &A,
218-
const SlowDynamicAPInt &B) {
217+
SlowDynamicAPInt llvm::detail::gcd(const SlowDynamicAPInt &A,
218+
const SlowDynamicAPInt &B) {
219219
assert(A >= 0 && B >= 0 && "operands must be non-negative!");
220220
unsigned Width = getMaxWidth(A.Val, B.Val);
221221
return SlowDynamicAPInt(
222222
APIntOps::GreatestCommonDivisor(A.Val.sext(Width), B.Val.sext(Width)));
223223
}
224224

225225
/// Returns the least common multiple of A and B.
226-
SlowDynamicAPInt detail::lcm(const SlowDynamicAPInt &A,
227-
const SlowDynamicAPInt &B) {
226+
SlowDynamicAPInt llvm::detail::lcm(const SlowDynamicAPInt &A,
227+
const SlowDynamicAPInt &B) {
228228
SlowDynamicAPInt X = abs(A);
229229
SlowDynamicAPInt Y = abs(B);
230230
return (X * Y) / gcd(X, Y);

0 commit comments

Comments
 (0)