Skip to content

Commit 9a60156

Browse files
authored
Merge pull request #9521 from tshortli/suppress-swift-cxx-interop-cycle-warnings
Suppress warnings for Swift C++ interop by hiding operator declarations
2 parents 43d9053 + 3ce6236 commit 9a60156

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

clang/include/clang/AST/DependentDiagnostic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ class DeclContext::ddiag_iterator {
149149
return tmp;
150150
}
151151

152+
#ifndef __swift__
152153
bool operator==(ddiag_iterator Other) const {
153154
return Ptr == Other.Ptr;
154155
}
156+
#endif
155157

156158
bool operator!=(ddiag_iterator Other) const {
157159
return Ptr != Other.Ptr;

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5878,7 +5878,9 @@ struct AAPointerInfo : public AbstractAttribute {
58785878

58795879
unsigned size() const { return Ranges.size(); }
58805880

5881+
#ifndef __swift__
58815882
bool operator==(const RangeList &OI) const { return Ranges == OI.Ranges; }
5883+
#endif
58825884

58835885
/// Merge the ranges in \p RHS into the current ranges.
58845886
/// - Merging a list of unknown ranges makes the current list unknown.
@@ -6012,11 +6014,13 @@ struct AAPointerInfo : public AbstractAttribute {
60126014
Access(const Access &Other) = default;
60136015

60146016
Access &operator=(const Access &Other) = default;
6017+
#ifndef __swift__
60156018
bool operator==(const Access &R) const {
60166019
return LocalI == R.LocalI && RemoteI == R.RemoteI && Ranges == R.Ranges &&
60176020
Content == R.Content && Kind == R.Kind;
60186021
}
60196022
bool operator!=(const Access &R) const { return !(*this == R); }
6023+
#endif
60206024

60216025
Access &operator&=(const Access &R) {
60226026
assert(RemoteI == R.RemoteI && "Expected same instruction!");

llvm/include/llvm/Transforms/IPO/SampleContextTracker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,15 @@ class SampleContextTracker {
162162
return *this;
163163
}
164164

165+
#ifndef __swift__
165166
bool operator==(const Iterator &Other) const {
166167
if (NodeQueue.empty() && Other.NodeQueue.empty())
167168
return true;
168169
if (NodeQueue.empty() || Other.NodeQueue.empty())
169170
return false;
170171
return NodeQueue.front() == Other.NodeQueue.front();
171172
}
173+
#endif
172174

173175
ContextTrieNode *operator*() const {
174176
assert(!NodeQueue.empty() && "Invalid access to end iterator");

0 commit comments

Comments
 (0)