1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-21 18:22:53 +01:00

Fix possible compilation issue with gcc-11

This commit is contained in:
Nekotekina 2021-01-09 09:43:37 +03:00
parent 548daf04b5
commit 2e65b3a418
3 changed files with 16 additions and 16 deletions

View File

@ -724,21 +724,21 @@ namespace llvm {
T *P; T *P;
public: public:
SingleLinkedListIterator<T>(T *P) : P(P) {} SingleLinkedListIterator(T *P) : P(P) {}
SingleLinkedListIterator<T> &operator++() { SingleLinkedListIterator &operator++() {
P = P->Next; P = P->Next;
return *this; return *this;
} }
SingleLinkedListIterator<T> operator++(int) { SingleLinkedListIterator operator++(int) {
SingleLinkedListIterator res = *this; SingleLinkedListIterator res = *this;
++*this; ++*this;
return res; return res;
} }
bool operator!=(const SingleLinkedListIterator<T> &Other) const { bool operator!=(const SingleLinkedListIterator &Other) const {
return P != Other.operator->(); return P != Other.operator->();
} }
bool operator==(const SingleLinkedListIterator<T> &Other) const { bool operator==(const SingleLinkedListIterator &Other) const {
return P == Other.operator->(); return P == Other.operator->();
} }
T &operator*() const { T &operator*() const {

View File

@ -270,11 +270,11 @@ public:
assert(Stream.getLength() % sizeof(T) == 0); assert(Stream.getLength() % sizeof(T) == 0);
} }
bool operator==(const FixedStreamArray<T> &Other) const { bool operator==(const FixedStreamArray &Other) const {
return Stream == Other.Stream; return Stream == Other.Stream;
} }
bool operator!=(const FixedStreamArray<T> &Other) const { bool operator!=(const FixedStreamArray &Other) const {
return !(*this == Other); return !(*this == Other);
} }
@ -328,10 +328,10 @@ public:
FixedStreamArrayIterator(const FixedStreamArray<T> &Array, uint32_t Index) FixedStreamArrayIterator(const FixedStreamArray<T> &Array, uint32_t Index)
: Array(Array), Index(Index) {} : Array(Array), Index(Index) {}
FixedStreamArrayIterator<T>(const FixedStreamArrayIterator<T> &Other) FixedStreamArrayIterator(const FixedStreamArrayIterator &Other)
: Array(Other.Array), Index(Other.Index) {} : Array(Other.Array), Index(Other.Index) {}
FixedStreamArrayIterator<T> & FixedStreamArrayIterator&
operator=(const FixedStreamArrayIterator<T> &Other) { operator=(const FixedStreamArrayIterator &Other) {
Array = Other.Array; Array = Other.Array;
Index = Other.Index; Index = Other.Index;
return *this; return *this;
@ -340,29 +340,29 @@ public:
const T &operator*() const { return Array[Index]; } const T &operator*() const { return Array[Index]; }
const T &operator*() { return Array[Index]; } const T &operator*() { return Array[Index]; }
bool operator==(const FixedStreamArrayIterator<T> &R) const { bool operator==(const FixedStreamArrayIterator &R) const {
assert(Array == R.Array); assert(Array == R.Array);
return (Index == R.Index) && (Array == R.Array); return (Index == R.Index) && (Array == R.Array);
} }
FixedStreamArrayIterator<T> &operator+=(std::ptrdiff_t N) { FixedStreamArrayIterator &operator+=(std::ptrdiff_t N) {
Index += N; Index += N;
return *this; return *this;
} }
FixedStreamArrayIterator<T> &operator-=(std::ptrdiff_t N) { FixedStreamArrayIterator &operator-=(std::ptrdiff_t N) {
assert(std::ptrdiff_t(Index) >= N); assert(std::ptrdiff_t(Index) >= N);
Index -= N; Index -= N;
return *this; return *this;
} }
std::ptrdiff_t operator-(const FixedStreamArrayIterator<T> &R) const { std::ptrdiff_t operator-(const FixedStreamArrayIterator &R) const {
assert(Array == R.Array); assert(Array == R.Array);
assert(Index >= R.Index); assert(Index >= R.Index);
return Index - R.Index; return Index - R.Index;
} }
bool operator<(const FixedStreamArrayIterator<T> &RHS) const { bool operator<(const FixedStreamArrayIterator &RHS) const {
assert(Array == RHS.Array); assert(Array == RHS.Array);
return Index < RHS.Index; return Index < RHS.Index;
} }

View File

@ -626,7 +626,7 @@ private:
unsigned getRegIdx(Register Reg) const { unsigned getRegIdx(Register Reg) const {
for (unsigned Idx = 0; Idx < Locs.size(); ++Idx) for (unsigned Idx = 0; Idx < Locs.size(); ++Idx)
if (Locs[Idx].Kind == MachineLocKind::RegisterKind && if (Locs[Idx].Kind == MachineLocKind::RegisterKind &&
Locs[Idx].Value.RegNo == Reg) llvm::Register(Locs[Idx].Value.RegNo) == Reg)
return Idx; return Idx;
llvm_unreachable("Could not find given Reg in Locs"); llvm_unreachable("Could not find given Reg in Locs");
} }