summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2019-11-26 14:23:32 +0100
committerRaphael Isemann <teemperor@gmail.com>2019-11-26 15:04:54 +0100
commit16144d2b21d90a0515be2fc9158cbaf828abd980 (patch)
treecfb28ed816d63cbf412c65967e798f9efce6d4e4 /lldb/source/Plugins/SymbolFile
parent290e43ddb660db2e9b294e1e963222c08965d211 (diff)
downloadbcm5719-llvm-16144d2b21d90a0515be2fc9158cbaf828abd980.tar.gz
bcm5719-llvm-16144d2b21d90a0515be2fc9158cbaf828abd980.zip
[lldb][NFC] Modernize string handling in DWARFASTParserClang::ParseTypeModifier
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp38
1 files changed, 16 insertions, 22 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 89331f7aca6..fe6ab306444 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -662,11 +662,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
if (cu_language == eLanguageTypeObjC ||
cu_language == eLanguageTypeObjC_plus_plus) {
if (attrs.name) {
- static ConstString g_objc_type_name_id("id");
- static ConstString g_objc_type_name_Class("Class");
- static ConstString g_objc_type_name_selector("SEL");
-
- if (attrs.name == g_objc_type_name_id) {
+ if (attrs.name == "id") {
if (log)
dwarf->GetObjectFile()->GetModule()->LogMessage(
log,
@@ -677,8 +673,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
encoding_data_type = Type::eEncodingIsUID;
attrs.type.Clear();
resolve_state = Type::ResolveState::Full;
-
- } else if (attrs.name == g_objc_type_name_Class) {
+ } else if (attrs.name == "Class") {
if (log)
dwarf->GetObjectFile()->GetModule()->LogMessage(
log,
@@ -689,7 +684,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
encoding_data_type = Type::eEncodingIsUID;
attrs.type.Clear();
resolve_state = Type::ResolveState::Full;
- } else if (attrs.name == g_objc_type_name_selector) {
+ } else if (attrs.name == "SEL") {
if (log)
dwarf->GetObjectFile()->GetModule()->LogMessage(
log,
@@ -709,20 +704,19 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
const DWARFDIE encoding_die = attrs.type.Reference();
if (encoding_die && encoding_die.Tag() == DW_TAG_structure_type) {
- if (const char *struct_name = encoding_die.GetName()) {
- if (!strcmp(struct_name, "objc_object")) {
- if (log)
- dwarf->GetObjectFile()->GetModule()->LogMessage(
- log,
- "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s "
- "'%s' is 'objc_object*', which we overrode to "
- "'id'.",
- die.GetOffset(), die.GetTagAsCString(), die.GetName());
- clang_type = m_ast.GetBasicType(eBasicTypeObjCID);
- encoding_data_type = Type::eEncodingIsUID;
- attrs.type.Clear();
- resolve_state = Type::ResolveState::Full;
- }
+ llvm::StringRef struct_name = encoding_die.GetName();
+ if (struct_name == "objc_object") {
+ if (log)
+ dwarf->GetObjectFile()->GetModule()->LogMessage(
+ log,
+ "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s "
+ "'%s' is 'objc_object*', which we overrode to "
+ "'id'.",
+ die.GetOffset(), die.GetTagAsCString(), die.GetName());
+ clang_type = m_ast.GetBasicType(eBasicTypeObjCID);
+ encoding_data_type = Type::eEncodingIsUID;
+ attrs.type.Clear();
+ resolve_state = Type::ResolveState::Full;
}
}
}
OpenPOWER on IntegriCloud