Skip to content

Commit cfd7a9e

Browse files
committed
[lldb] Rename more StringRef::equals to ==
`equals` has been removed upstream.
1 parent 46808c0 commit cfd7a9e

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftASTManipulator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ void SwiftASTManipulatorBase::DoInitialization() {
124124
}
125125
}
126126
// Not in an extension.
127-
if (FD->getNameStr().equals("$__lldb_trampoline"))
127+
if (FD->getNameStr() == "$__lldb_trampoline")
128128
trampoline_decl = FD;
129-
else if (FD->getNameStr().equals("$__lldb_expr"))
129+
else if (FD->getNameStr() == "$__lldb_expr")
130130
entrypoint_decl = FD;
131-
else if (FD->getNameStr().equals("$__lldb_sink"))
131+
else if (FD->getNameStr() == "$__lldb_sink")
132132
sink_decl = FD;
133-
else if (FD->getNameStr().equals("$__lldb_user_expr"))
133+
else if (FD->getNameStr() == "$__lldb_user_expr")
134134
user_expr_decl = FD;
135135
return Action::SkipChildren();
136136
}

lldb/source/Plugins/ExpressionParser/Swift/SwiftASTManipulator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class SwiftASTManipulatorBase {
114114
return m_name.str().starts_with("$τ_0_");
115115
}
116116
bool IsSelf() const {
117-
return m_name.str().equals("$__lldb_injected_self");
117+
return m_name.str() == "$__lldb_injected_self";
118118
}
119119
bool IsPackCount() const {
120120
return m_name.str().starts_with("$pack_count_");

lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ lldb::offset_t SwiftREPL::GetDesiredIndentation(const StringList &lines,
395395
// this as a cast statement
396396
bool outdent = false;
397397
if (line.empty())
398-
outdent = !identifier.equals("case");
399-
else if (identifier.equals("case")) {
398+
outdent = (identifier != "case");
399+
else if (identifier == "case") {
400400
outdent = true;
401401
} else {
402402
line = line.rtrim(); // Skip trailing spaces

lldb/source/Plugins/ExpressionParser/Swift/SwiftREPLMaterializer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ class EntityREPLPersistentVariable : public Materializer::Entity {
378378
if (last_component.empty())
379379
continue;
380380

381-
if (m_persistent_variable_sp->GetName().GetStringRef().equals(
382-
last_component)) {
381+
if (m_persistent_variable_sp->GetName().GetStringRef() ==
382+
last_component) {
383383
ExecutionContextScope *exe_scope =
384384
execution_unit->GetBestExecutionContextScope();
385385

lldb/source/Plugins/ExpressionParser/Swift/SwiftSILManipulator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ swift::SILValue SwiftSILManipulator::emitLValueForVariable(
7070

7171
for (swift::Decl *member : unsafe_mutable_pointer_struct_decl->getMembers()) {
7272
if (swift::VarDecl *member_var = llvm::dyn_cast<swift::VarDecl>(member)) {
73-
if (member_var->getName().str().equals("_rawValue")) {
73+
if (member_var->getName().str() == "_rawValue") {
7474
value_member_decl = member_var;
7575
break;
7676
}

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ FindSymbolForSwiftObject(Process &process, RuntimeKind runtime_kind,
173173
if (runtime_kind == RuntimeKind::ObjC) {
174174
auto *obj_file = target.GetExecutableModule()->GetObjectFile();
175175
bool have_objc_interop =
176-
obj_file && obj_file->GetPluginName().equals("mach-o");
176+
obj_file && obj_file->GetPluginName() == "mach-o";
177177
if (!have_objc_interop)
178178
return {};
179179
}
@@ -904,7 +904,7 @@ bool SwiftLanguageRuntimeImpl::AddModuleToReflectionContext(
904904
std::optional<uint32_t> info_id;
905905
// When dealing with ELF, we need to pass in the contents of the on-disk
906906
// file, since the Section Header Table is not present in the child process
907-
if (obj_file->GetPluginName().equals("elf")) {
907+
if (obj_file->GetPluginName() == "elf") {
908908
DataExtractor extractor;
909909
auto size = obj_file->GetData(0, obj_file->GetByteSize(), extractor);
910910
const uint8_t *file_data = extractor.GetDataStart();
@@ -914,7 +914,7 @@ bool SwiftLanguageRuntimeImpl::AddModuleToReflectionContext(
914914
std::optional<llvm::sys::MemoryBlock>(file_buffer),
915915
likely_module_names);
916916
} else if (read_from_file_cache &&
917-
obj_file->GetPluginName().equals("mach-o")) {
917+
obj_file->GetPluginName() == "mach-o") {
918918
info_id = AddObjectFileToReflectionContext(module_sp, likely_module_names);
919919
if (!info_id)
920920
info_id = m_reflection_ctx->AddImage(swift::remote::RemoteAddress(load_ptr),

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeNames.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,13 +1079,13 @@ void SwiftLanguageRuntime::MethodName::Parse() {
10791079
if (was_operator)
10801080
m_type = eTypeOperator;
10811081
// check for obvious constructor/destructor cases
1082-
else if (m_basename.equals("__deallocating_destructor"))
1082+
else if (m_basename == "__deallocating_destructor")
10831083
m_type = eTypeDeallocator;
1084-
else if (m_basename.equals("__allocating_constructor"))
1084+
else if (m_basename == "__allocating_constructor")
10851085
m_type = eTypeAllocator;
1086-
else if (m_basename.equals("init"))
1086+
else if (m_basename == "init")
10871087
m_type = eTypeConstructor;
1088-
else if (m_basename.equals("destructor"))
1088+
else if (m_basename == "destructor")
10891089
m_type = eTypeDestructor;
10901090
else
10911091
m_type = eTypeUnknownMethod;

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserSwift.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ lldb::TypeSP DWARFASTParserSwift::ParseTypeFromDWARF(const SymbolContext &sc,
129129
}
130130

131131
if (!mangled_name && name) {
132-
if (name.GetStringRef().equals("$swift.fixedbuffer")) {
132+
if (name.GetStringRef() == "$swift.fixedbuffer") {
133133
if (auto wrapped_type = get_type(die.GetFirstChild())) {
134134
// Create a unique pointer for the type + fixed buffer flag.
135135
type_sp = wrapped_type->GetSymbolFile()->CopyType(wrapped_type);

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ TypeSystemSwiftTypeRef::GetClangTypeNode(CompilerType clang_type,
397397
llvm::StringRef clang_name = clang_type.GetTypeName().GetStringRef();
398398
#define MAP_TYPE(C_TYPE_NAME, C_TYPE_KIND, C_TYPE_BITWIDTH, SWIFT_MODULE_NAME, \
399399
SWIFT_TYPE_NAME, CAN_BE_MISSING, C_NAME_MAPPING) \
400-
if (clang_name.equals(C_TYPE_NAME)) { \
400+
if (clang_name == C_TYPE_NAME) { \
401401
module_name = (SWIFT_MODULE_NAME); \
402402
swift_name = (SWIFT_TYPE_NAME); \
403403
} else
@@ -2271,7 +2271,7 @@ template <> bool Equivalent<CompilerType>(CompilerType l, CompilerType r) {
22712271
return true;
22722272

22732273
// SwiftASTContext hardcodes some less-precise types.
2274-
if (rhs.GetStringRef().equals("$sBpD"))
2274+
if (rhs.GetStringRef() == "$sBpD")
22752275
return true;
22762276

22772277
// If the type is a Clang-imported type ignore mismatches. Since we
@@ -2307,7 +2307,7 @@ template <> bool Equivalent<ConstString>(ConstString l, ConstString r) {
23072307
return true;
23082308

23092309
// If the new variant supports something the old one didn't, accept it.
2310-
if (r.IsEmpty() || r.GetStringRef().equals("<invalid>") ||
2310+
if (r.IsEmpty() || r.GetStringRef() == "<invalid>" ||
23112311
r.GetStringRef().contains("__ObjC.") ||
23122312
r.GetStringRef().contains(" -> ()"))
23132313
return true;

0 commit comments

Comments
 (0)