Skip to content

Revert "Replace bool operator== for VersionType in sanitizer_mac.h" #135127

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 1 commit into from
Apr 10, 2025

Conversation

JDevlieghere
Copy link
Member

@JDevlieghere JDevlieghere requested a review from itf April 10, 2025 04:09
@JDevlieghere JDevlieghere merged commit 7f7f3d9 into main Apr 10, 2025
6 of 10 checks passed
@JDevlieghere JDevlieghere deleted the revert-135068-VersionType_operator_sanitizer_mac branch April 10, 2025 04:09
@llvmbot
Copy link
Member

llvmbot commented Apr 10, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Jonas Devlieghere (JDevlieghere)

Changes

Reverts llvm/llvm-project#135068 because it breaks building compiler-rt on Darwin.

https://green.lab.llvm.org/job/clang-stage1-RA/
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/


Full diff: https://github.com/llvm/llvm-project/pull/135127.diff

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/sanitizer_mac.h (+3-5)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.h b/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
index 4de0605e18f03..f0a97d098eea0 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
@@ -37,6 +37,9 @@ struct VersionBase {
 
   VersionBase(u16 major, u16 minor) : major(major), minor(minor) {}
 
+  bool operator==(const VersionType &other) const {
+    return major == other.major && minor == other.minor;
+  }
   bool operator>=(const VersionType &other) const {
     return major > other.major ||
            (major == other.major && minor >= other.minor);
@@ -44,11 +47,6 @@ struct VersionBase {
   bool operator<(const VersionType &other) const { return !(*this >= other); }
 };
 
-template <typename VersionType>
-bool operator==(const VersionType &self, const VersionType &other) {
-  return self.major == other.major && self.minor == other.minor;
-}
-
 struct MacosVersion : VersionBase<MacosVersion> {
   MacosVersion(u16 major, u16 minor) : VersionBase(major, minor) {}
 };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants