Skip to content
Open
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
Suppress warnings for Swift C++ interop by hiding operator declarations.
Addresses warnings like this that are emitted during the Swift compiler build:

```
include/llvm/Transforms/Scalar/GVN.h:268:12: warning: cycle detected while resolving 'leader_iterator' in swift_name attribute for 'operator==' [#ClangDeclarationImport]
```
  • Loading branch information
tshortli committed Jul 30, 2025
commit 3c1e89b0f29e5f95bb313ffd914e9ae113e33ea8
2 changes: 2 additions & 0 deletions llvm/include/llvm/MC/MCRegisterInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,11 @@ class MCRegisterInfo {
return *this;
}

#ifndef __swift__
bool operator==(const DiffListIterator &Other) const {
return List == Other.List;
}
#endif
};

public:
Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/TextAPI/Record.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,13 @@ class ObjCInterfaceRecord : public ObjCContainerRecord {
RecordLinkage Class = RecordLinkage::Unknown;
RecordLinkage MetaClass = RecordLinkage::Unknown;
RecordLinkage EHType = RecordLinkage::Unknown;
#ifndef __swift__
bool operator==(const Linkages &other) const {
return std::tie(Class, MetaClass, EHType) ==
std::tie(other.Class, other.MetaClass, other.EHType);
}
bool operator!=(const Linkages &other) const { return !(*this == other); }
#endif
};
Linkages Linkages;

Expand Down
2 changes: 2 additions & 0 deletions llvm/include/llvm/Transforms/Scalar/GVN.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,14 @@ class GVNPass : public PassInfoMixin<GVNPass> {
Current = Current->Next;
return *this;
}
#ifndef __swift__
bool operator==(const leader_iterator &Other) const {
return Current == Other.Current;
}
bool operator!=(const leader_iterator &Other) const {
return Current != Other.Current;
}
#endif
reference operator*() const { return Current->Entry; }
};

Expand Down