summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-05-14 12:44:40 +0000
committerPavel Labath <pavel@labath.sk>2019-05-14 12:44:40 +0000
commit62f5b591f4f3b995f2eb1dec416a8731e5e408d8 (patch)
treeeab79c8d339c86d292576136c27513456271938f /lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
parent2e9591c23a930e4a0c8daa8e88ebbae7048b3f77 (diff)
downloadbcm5719-llvm-62f5b591f4f3b995f2eb1dec416a8731e5e408d8.tar.gz
bcm5719-llvm-62f5b591f4f3b995f2eb1dec416a8731e5e408d8.zip
DWARF/NFC: Centralize DIERef conversions
apple and manual indexing code were creating a DIERef in a bunch of places. Though the code itself is not much, it is also easy to simplify by factoring out the DIERef creation. In HashedNameToDIE I create a conversion operator from DIEInfo to DIERef, and in ManualDWARFIndex I just create the DIERef in a global variable up-front. This also reduces the diff in follow-up patches which change how DIERefs are constructed. llvm-svn: 360669
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
index de4cce83999..f955fee1758 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
@@ -13,8 +13,7 @@ void DWARFMappedHash::ExtractDIEArray(const DIEInfoArray &die_info_array,
DIEArray &die_offsets) {
const size_t count = die_info_array.size();
for (size_t i = 0; i < count; ++i)
- die_offsets.emplace_back(die_info_array[i].cu_offset,
- die_info_array[i].offset);
+ die_offsets.emplace_back(die_info_array[i]);
}
void DWARFMappedHash::ExtractDIEArray(const DIEInfoArray &die_info_array,
@@ -33,8 +32,7 @@ void DWARFMappedHash::ExtractDIEArray(const DIEInfoArray &die_info_array,
tag == DW_TAG_structure_type || tag == DW_TAG_class_type;
}
if (tag_matches)
- die_offsets.emplace_back(die_info_array[i].cu_offset,
- die_info_array[i].offset);
+ die_offsets.emplace_back(die_info_array[i]);
}
}
}
@@ -58,8 +56,7 @@ void DWARFMappedHash::ExtractDIEArray(const DIEInfoArray &die_info_array,
tag == DW_TAG_structure_type || tag == DW_TAG_class_type;
}
if (tag_matches)
- die_offsets.emplace_back(die_info_array[i].cu_offset,
- die_info_array[i].offset);
+ die_offsets.emplace_back(die_info_array[i]);
}
}
}
@@ -77,8 +74,7 @@ void DWARFMappedHash::ExtractClassOrStructDIEArray(
// We found the one true definition for this class, so only return
// that
die_offsets.clear();
- die_offsets.emplace_back(die_info_array[i].cu_offset,
- die_info_array[i].offset);
+ die_offsets.emplace_back(die_info_array[i]);
return;
} else {
// Put the one true definition as the first entry so it matches first
@@ -86,8 +82,7 @@ void DWARFMappedHash::ExtractClassOrStructDIEArray(
die_info_array[i].offset);
}
} else {
- die_offsets.emplace_back(die_info_array[i].cu_offset,
- die_info_array[i].offset);
+ die_offsets.emplace_back(die_info_array[i]);
}
}
}
@@ -99,8 +94,7 @@ void DWARFMappedHash::ExtractTypesFromDIEArray(
const size_t count = die_info_array.size();
for (size_t i = 0; i < count; ++i) {
if ((die_info_array[i].type_flags & type_flag_mask) == type_flag_value)
- die_offsets.emplace_back(die_info_array[i].cu_offset,
- die_info_array[i].offset);
+ die_offsets.emplace_back(die_info_array[i]);
}
}
OpenPOWER on IntegriCloud