[llvm] [DebugInfo] Simplify a string comparison (NFC) (PR #139918)

via llvm-commits llvm-commits at lists.llvm.org
Wed May 14 07:53:01 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Note that the lambda function we are in returns bool, so
FileZero.compare(FileOne) is equivalent to FileZero != FileOne in this
context.


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


1 Files Affected:

- (modified) llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp b/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
index 42da957233667..37bc60d4045c7 100644
--- a/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
+++ b/llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
@@ -913,7 +913,7 @@ Error LVDWARFReader::createScopes() {
           LT->getFileNameByIndex(
               1, None, DILineInfoSpecifier::FileLineInfoKind::RawValue,
               FileOne);
-          return FileZero.compare(FileOne);
+          return FileZero != FileOne;
         }
       }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/139918


More information about the llvm-commits mailing list