[llvm] efc3c1b - [memprof] Use std::tie to implement operator< (NFC) (#143401)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 12:46:41 PDT 2025


Author: Kazu Hirata
Date: 2025-06-09T12:46:38-07:00
New Revision: efc3c1ba2932539e7e25b512da9dca6c399d3500

URL: https://github.com/llvm/llvm-project/commit/efc3c1ba2932539e7e25b512da9dca6c399d3500
DIFF: https://github.com/llvm/llvm-project/commit/efc3c1ba2932539e7e25b512da9dca6c399d3500.diff

LOG: [memprof] Use std::tie to implement operator< (NFC) (#143401)

Added: 
    

Modified: 
    llvm/include/llvm/ProfileData/MemProf.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h
index 683193aa42747..91c68720ae0aa 100644
--- a/llvm/include/llvm/ProfileData/MemProf.h
+++ b/llvm/include/llvm/ProfileData/MemProf.h
@@ -835,8 +835,7 @@ struct LineLocation {
   LineLocation(uint32_t L, uint32_t D) : LineOffset(L), Column(D) {}
 
   bool operator<(const LineLocation &O) const {
-    return LineOffset < O.LineOffset ||
-           (LineOffset == O.LineOffset && Column < O.Column);
+    return std::tie(LineOffset, Column) < std::tie(O.LineOffset, O.Column);
   }
 
   bool operator==(const LineLocation &O) const {


        


More information about the llvm-commits mailing list