[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
Wed Jul 27 13:40:19 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG492245d9596d: [lldb][NFC] Pass ParsedDWARFTypeAttributes as const reference into… (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130504/new/
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.448147.patch
Type: text/x-patch
Size: 2717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220727/ddb907ec/attachment.bin>
More information about the lldb-commits
mailing list