[llvm] aaa8a80 - [CodeGen] Use operator==(StringRef, StringRef) (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 21:54:00 PDT 2024


Author: Kazu Hirata
Date: 2024-05-16T21:53:54-07:00
New Revision: aaa8a8000009890b79effb0d0f3c6f989a3d5563

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

LOG: [CodeGen] Use operator==(StringRef, StringRef) (NFC)

The LHS and RHS are of SmallString and StringRef, respectively.  We
can safely use operator==(StringRef, SringRef) with one implicit
conversion from SmallString to StringRef.

Added: 
    

Modified: 
    llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp b/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp
index 6eef5d2c50a2f..fa54640265162 100644
--- a/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp
+++ b/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp
@@ -170,7 +170,7 @@ Error BasicBlockSectionsProfileReader::ReadV1Profile() {
           return false;
         // Return a match if debug-info-filename is not specified. Otherwise,
         // check for equality.
-        return DIFilename.empty() || It->second.equals(DIFilename);
+        return DIFilename.empty() || It->second == DIFilename;
       });
       if (!FunctionFound) {
         // Skip the following profile by setting the profile iterator (FI) to
@@ -317,7 +317,7 @@ Error BasicBlockSectionsProfileReader::ReadV0Profile() {
           return false;
         // Return a match if debug-info-filename is not specified. Otherwise,
         // check for equality.
-        return DIFilename.empty() || It->second.equals(DIFilename);
+        return DIFilename.empty() || It->second == DIFilename;
       });
       if (!FunctionFound) {
         // Skip the following profile by setting the profile iterator (FI) to


        


More information about the llvm-commits mailing list