Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 10, 2025

@llvm/pr-subscribers-lldb

Author: Kazu Hirata (kazutakahirata)

Changes

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

3 Files Affected:

  • (modified) lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp (+1-1)
  • (modified) lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp (+2-2)
  • (modified) lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp (+2-2)
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index a77155f6bf41e..ed6047f8f4ef3 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -818,7 +818,7 @@ class InstructionLLVMC : public lldb_private::Instruction {
             return std::make_pair(ret, osi);
           }
         case 'x':
-          if (!str.compare("0")) {
+          if (str == "0") {
             is_hex = true;
             str.push_back(*osi);
           } else {
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
index fd965d0127a2d..de4de0a7a22c5 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
@@ -83,14 +83,14 @@ void ASTResultSynthesizer::TransformTopLevelDecl(Decl *D) {
   } else if (!m_top_level) {
     if (ObjCMethodDecl *method_decl = dyn_cast<ObjCMethodDecl>(D)) {
       if (m_ast_context &&
-          !method_decl->getSelector().getAsString().compare("$__lldb_expr:")) {
+          method_decl->getSelector().getAsString() == "$__lldb_expr:") {
         RecordPersistentTypes(method_decl);
         SynthesizeObjCMethodResult(method_decl);
       }
     } else if (FunctionDecl *function_decl = dyn_cast<FunctionDecl>(D)) {
       // When completing user input the body of the function may be a nullptr.
       if (m_ast_context && function_decl->hasBody() &&
-          !function_decl->getNameInfo().getAsString().compare("$__lldb_expr")) {
+          function_decl->getNameInfo().getAsString() == "$__lldb_expr") {
         RecordPersistentTypes(function_decl);
         SynthesizeFunctionResult(function_decl);
       }
diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
index a0cd0ee5025bd..c972c8e95f3b1 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -278,9 +278,9 @@ size_t ELFLinuxPrStatus::GetSize(const lldb_private::ArchSpec &arch) {
   if (arch.IsMIPS()) {
     std::string abi = arch.GetTargetABI();
     assert(!abi.empty() && "ABI is not set");
-    if (!abi.compare("n64"))
+    if (abi == "n64")
       return sizeof(ELFLinuxPrStatus);
-    else if (!abi.compare("o32"))
+    else if (abi == "o32")
       return mips_linux_pr_status_size_o32;
     // N32 ABI
     return mips_linux_pr_status_size_n32;

@kazutakahirata kazutakahirata merged commit cb0f6d0 into llvm:main May 10, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_string_compare_lldb branch May 10, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants