forked from OSchip/llvm-project
[lldb][NFC] Modernize string handling in DWARFASTParserClang::ParseTypeModifier
This commit is contained in:
parent
290e43ddb6
commit
16144d2b21
|
@ -662,11 +662,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
|
||||||
if (cu_language == eLanguageTypeObjC ||
|
if (cu_language == eLanguageTypeObjC ||
|
||||||
cu_language == eLanguageTypeObjC_plus_plus) {
|
cu_language == eLanguageTypeObjC_plus_plus) {
|
||||||
if (attrs.name) {
|
if (attrs.name) {
|
||||||
static ConstString g_objc_type_name_id("id");
|
if (attrs.name == "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 (log)
|
if (log)
|
||||||
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
||||||
log,
|
log,
|
||||||
|
@ -677,8 +673,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
|
||||||
encoding_data_type = Type::eEncodingIsUID;
|
encoding_data_type = Type::eEncodingIsUID;
|
||||||
attrs.type.Clear();
|
attrs.type.Clear();
|
||||||
resolve_state = Type::ResolveState::Full;
|
resolve_state = Type::ResolveState::Full;
|
||||||
|
} else if (attrs.name == "Class") {
|
||||||
} else if (attrs.name == g_objc_type_name_Class) {
|
|
||||||
if (log)
|
if (log)
|
||||||
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
||||||
log,
|
log,
|
||||||
|
@ -689,7 +684,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
|
||||||
encoding_data_type = Type::eEncodingIsUID;
|
encoding_data_type = Type::eEncodingIsUID;
|
||||||
attrs.type.Clear();
|
attrs.type.Clear();
|
||||||
resolve_state = Type::ResolveState::Full;
|
resolve_state = Type::ResolveState::Full;
|
||||||
} else if (attrs.name == g_objc_type_name_selector) {
|
} else if (attrs.name == "SEL") {
|
||||||
if (log)
|
if (log)
|
||||||
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
||||||
log,
|
log,
|
||||||
|
@ -709,20 +704,19 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc,
|
||||||
const DWARFDIE encoding_die = attrs.type.Reference();
|
const DWARFDIE encoding_die = attrs.type.Reference();
|
||||||
|
|
||||||
if (encoding_die && encoding_die.Tag() == DW_TAG_structure_type) {
|
if (encoding_die && encoding_die.Tag() == DW_TAG_structure_type) {
|
||||||
if (const char *struct_name = encoding_die.GetName()) {
|
llvm::StringRef struct_name = encoding_die.GetName();
|
||||||
if (!strcmp(struct_name, "objc_object")) {
|
if (struct_name == "objc_object") {
|
||||||
if (log)
|
if (log)
|
||||||
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
dwarf->GetObjectFile()->GetModule()->LogMessage(
|
||||||
log,
|
log,
|
||||||
"SymbolFileDWARF::ParseType (die = 0x%8.8x) %s "
|
"SymbolFileDWARF::ParseType (die = 0x%8.8x) %s "
|
||||||
"'%s' is 'objc_object*', which we overrode to "
|
"'%s' is 'objc_object*', which we overrode to "
|
||||||
"'id'.",
|
"'id'.",
|
||||||
die.GetOffset(), die.GetTagAsCString(), die.GetName());
|
die.GetOffset(), die.GetTagAsCString(), die.GetName());
|
||||||
clang_type = m_ast.GetBasicType(eBasicTypeObjCID);
|
clang_type = m_ast.GetBasicType(eBasicTypeObjCID);
|
||||||
encoding_data_type = Type::eEncodingIsUID;
|
encoding_data_type = Type::eEncodingIsUID;
|
||||||
attrs.type.Clear();
|
attrs.type.Clear();
|
||||||
resolve_state = Type::ResolveState::Full;
|
resolve_state = Type::ResolveState::Full;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue