From dba114a3112d9e124e6bd7e740a5bda931e49ed1 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Thu, 13 May 2021 11:23:30 +0300 Subject: [PATCH] More gcc-11 fixes --- include/llvm/CodeGen/LiveInterval.h | 10 +++++----- include/llvm/Support/BinaryStreamArray.h | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index f2f8b7af0d2..00dbd220e71 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -720,21 +720,21 @@ namespace llvm { T *P; public: - SingleLinkedListIterator(T *P) : P(P) {} + SingleLinkedListIterator(T *P) : P(P) {} - SingleLinkedListIterator &operator++() { + SingleLinkedListIterator &operator++() { P = P->Next; return *this; } - SingleLinkedListIterator operator++(int) { + SingleLinkedListIterator operator++(int) { SingleLinkedListIterator res = *this; ++*this; return res; } - bool operator!=(const SingleLinkedListIterator &Other) const { + bool operator!=(const SingleLinkedListIterator &Other) const { return P != Other.operator->(); } - bool operator==(const SingleLinkedListIterator &Other) const { + bool operator==(const SingleLinkedListIterator &Other) const { return P == Other.operator->(); } T &operator*() const { diff --git a/include/llvm/Support/BinaryStreamArray.h b/include/llvm/Support/BinaryStreamArray.h index 3ba65c07cfe..0354639047b 100644 --- a/include/llvm/Support/BinaryStreamArray.h +++ b/include/llvm/Support/BinaryStreamArray.h @@ -267,11 +267,11 @@ public: assert(Stream.getLength() % sizeof(T) == 0); } - bool operator==(const FixedStreamArray &Other) const { + bool operator==(const FixedStreamArray &Other) const { return Stream == Other.Stream; } - bool operator!=(const FixedStreamArray &Other) const { + bool operator!=(const FixedStreamArray &Other) const { return !(*this == Other); } @@ -325,10 +325,10 @@ public: FixedStreamArrayIterator(const FixedStreamArray &Array, uint32_t Index) : Array(Array), Index(Index) {} - FixedStreamArrayIterator(const FixedStreamArrayIterator &Other) + FixedStreamArrayIterator(const FixedStreamArrayIterator &Other) : Array(Other.Array), Index(Other.Index) {} - FixedStreamArrayIterator & - operator=(const FixedStreamArrayIterator &Other) { + FixedStreamArrayIterator& + operator=(const FixedStreamArrayIterator &Other) { Array = Other.Array; Index = Other.Index; return *this; @@ -337,29 +337,29 @@ public: const T &operator*() const { return Array[Index]; } const T &operator*() { return Array[Index]; } - bool operator==(const FixedStreamArrayIterator &R) const { + bool operator==(const FixedStreamArrayIterator &R) const { assert(Array == R.Array); return (Index == R.Index) && (Array == R.Array); } - FixedStreamArrayIterator &operator+=(std::ptrdiff_t N) { + FixedStreamArrayIterator &operator+=(std::ptrdiff_t N) { Index += N; return *this; } - FixedStreamArrayIterator &operator-=(std::ptrdiff_t N) { + FixedStreamArrayIterator &operator-=(std::ptrdiff_t N) { assert(std::ptrdiff_t(Index) >= N); Index -= N; return *this; } - std::ptrdiff_t operator-(const FixedStreamArrayIterator &R) const { + std::ptrdiff_t operator-(const FixedStreamArrayIterator &R) const { assert(Array == R.Array); assert(Index >= R.Index); return Index - R.Index; } - bool operator<(const FixedStreamArrayIterator &RHS) const { + bool operator<(const FixedStreamArrayIterator &RHS) const { assert(Array == RHS.Array); return Index < RHS.Index; }