Skip to content

Commit effaf41

Browse files
authored
[lldb][DWARFASTParserClang][NFCI] Make ParsedDWARFTypeAttributes parameter const (#73833)
1 parent bcb621f commit effaf41

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,9 @@ ConvertDWARFCallingConventionToClang(const ParsedDWARFTypeAttributes &attrs) {
980980
return clang::CC_C;
981981
}
982982

983-
TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
984-
ParsedDWARFTypeAttributes &attrs) {
983+
TypeSP
984+
DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
985+
const ParsedDWARFTypeAttributes &attrs) {
985986
Log *log = GetLog(DWARFLog::TypeCompletion | DWARFLog::Lookups);
986987

987988
SymbolFileDWARF *dwarf = die.GetDWARF();
@@ -1200,14 +1201,15 @@ TypeSP DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
12001201
// Neither GCC 4.2 nor clang++ currently set a valid
12011202
// accessibility in the DWARF for C++ methods...
12021203
// Default to public for now...
1203-
if (attrs.accessibility == eAccessNone)
1204-
attrs.accessibility = eAccessPublic;
1204+
const auto accessibility = attrs.accessibility == eAccessNone
1205+
? eAccessPublic
1206+
: attrs.accessibility;
12051207

12061208
clang::CXXMethodDecl *cxx_method_decl =
12071209
m_ast.AddMethodToCXXRecordType(
12081210
class_opaque_type.GetOpaqueQualType(),
12091211
attrs.name.GetCString(), attrs.mangled_name,
1210-
clang_type, attrs.accessibility, attrs.is_virtual,
1212+
clang_type, accessibility, attrs.is_virtual,
12111213
is_static, attrs.is_inline, attrs.is_explicit,
12121214
is_attr_used, attrs.is_artificial);
12131215

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
368368
const lldb_private::plugin::dwarf::DWARFDIE &die,
369369
ParsedDWARFTypeAttributes &attrs);
370370
lldb::TypeSP ParseSubroutine(const lldb_private::plugin::dwarf::DWARFDIE &die,
371-
ParsedDWARFTypeAttributes &attrs);
371+
const ParsedDWARFTypeAttributes &attrs);
372372
lldb::TypeSP ParseArrayType(const lldb_private::plugin::dwarf::DWARFDIE &die,
373373
const ParsedDWARFTypeAttributes &attrs);
374374
lldb::TypeSP

0 commit comments

Comments
 (0)