Skip to content

Suppress warnings for Swift C++ interop by hiding operator declarations #9521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions clang/include/clang/AST/DependentDiagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,11 @@ class DeclContext::ddiag_iterator {
return tmp;
}

#ifndef __swift__
bool operator==(ddiag_iterator Other) const {
return Ptr == Other.Ptr;
}
#endif

bool operator!=(ddiag_iterator Other) const {
return Ptr != Other.Ptr;
Expand Down
4 changes: 4 additions & 0 deletions llvm/include/llvm/Transforms/IPO/Attributor.h
Original file line number Diff line number Diff line change
Expand Up @@ -5878,7 +5878,9 @@ struct AAPointerInfo : public AbstractAttribute {

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

#ifndef __swift__
bool operator==(const RangeList &OI) const { return Ranges == OI.Ranges; }
#endif

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

Access &operator=(const Access &Other) = default;
#ifndef __swift__
bool operator==(const Access &R) const {
return LocalI == R.LocalI && RemoteI == R.RemoteI && Ranges == R.Ranges &&
Content == R.Content && Kind == R.Kind;
}
bool operator!=(const Access &R) const { return !(*this == R); }
#endif

Access &operator&=(const Access &R) {
assert(RemoteI == R.RemoteI && "Expected same instruction!");
Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@ class SampleContextTracker {
return *this;
}

#ifndef __swift__
bool operator==(const Iterator &Other) const {
if (NodeQueue.empty() && Other.NodeQueue.empty())
return true;
if (NodeQueue.empty() || Other.NodeQueue.empty())
return false;
return NodeQueue.front() == Other.NodeQueue.front();
}
#endif

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