[Lldb-commits] [PATCH] D130504: [lldb][NFC] Pass ParsedDWARFTypeAttributes as const reference into ParseArrayType()
Arthur Eubanks via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 25 11:02:40 PDT 2022
aeubanks created this revision.
aeubanks added a reviewer: dblaikie.
Herald added a reviewer: shafik.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Fixes a FIXME
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D130504
Files:
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
@@ -239,9 +239,8 @@
const DWARFDIE &die, ParsedDWARFTypeAttributes &attrs);
lldb::TypeSP ParseSubroutine(const DWARFDIE &die,
ParsedDWARFTypeAttributes &attrs);
- // FIXME: attrs should be passed as a const reference.
lldb::TypeSP ParseArrayType(const DWARFDIE &die,
- ParsedDWARFTypeAttributes &attrs);
+ const ParsedDWARFTypeAttributes &attrs);
lldb::TypeSP ParsePointerToMemberType(const DWARFDIE &die,
const ParsedDWARFTypeAttributes &attrs);
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -1278,8 +1278,9 @@
Type::eEncodingIsUID, &attrs.decl, clang_type, Type::ResolveState::Full);
}
-TypeSP DWARFASTParserClang::ParseArrayType(const DWARFDIE &die,
- ParsedDWARFTypeAttributes &attrs) {
+TypeSP
+DWARFASTParserClang::ParseArrayType(const DWARFDIE &die,
+ const ParsedDWARFTypeAttributes &attrs) {
SymbolFileDWARF *dwarf = die.GetDWARF();
DEBUG_PRINTF("0x%8.8" PRIx64 ": %s (\"%s\")\n", die.GetID(),
@@ -1292,17 +1293,18 @@
return nullptr;
llvm::Optional<SymbolFile::ArrayInfo> array_info = ParseChildArrayInfo(die);
+ uint32_t byte_stride = attrs.byte_stride;
+ uint32_t bit_stride = attrs.bit_stride;
if (array_info) {
- attrs.byte_stride = array_info->byte_stride;
- attrs.bit_stride = array_info->bit_stride;
+ byte_stride = array_info->byte_stride;
+ bit_stride = array_info->bit_stride;
}
- if (attrs.byte_stride == 0 && attrs.bit_stride == 0)
- attrs.byte_stride = element_type->GetByteSize(nullptr).value_or(0);
+ if (byte_stride == 0 && bit_stride == 0)
+ byte_stride = element_type->GetByteSize(nullptr).value_or(0);
CompilerType array_element_type = element_type->GetForwardCompilerType();
RequireCompleteType(array_element_type);
- uint64_t array_element_bit_stride =
- attrs.byte_stride * 8 + attrs.bit_stride;
+ uint64_t array_element_bit_stride = byte_stride * 8 + bit_stride;
CompilerType clang_type;
if (array_info && array_info->element_orders.size() > 0) {
uint64_t num_elements = 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130504.447409.patch
Type: text/x-patch
Size: 2717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220725/a1a3d925/attachment.bin>
More information about the lldb-commits
mailing list