Skip to content

[lldb][DWARFASTParser] Don't pass CompilerType by non-const reference in the DWARFASTParserClang APIs #103245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DWARFASTParser {
const AddressRange &range) = 0;

virtual bool CompleteTypeFromDWARF(const DWARFDIE &die, Type *type,
CompilerType &compiler_type) = 0;
const CompilerType &compiler_type) = 0;

virtual CompilerDecl GetDeclForUIDFromDWARF(const DWARFDIE &die) = 0;

Expand Down
17 changes: 9 additions & 8 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,7 @@ bool DWARFASTParserClang::ParseTemplateParameterInfos(

bool DWARFASTParserClang::CompleteRecordType(const DWARFDIE &die,
lldb_private::Type *type,
CompilerType &clang_type) {
const CompilerType &clang_type) {
const dw_tag_t tag = die.Tag();
SymbolFileDWARF *dwarf = die.GetDWARF();

Expand Down Expand Up @@ -2152,7 +2152,7 @@ bool DWARFASTParserClang::CompleteRecordType(const DWARFDIE &die,

bool DWARFASTParserClang::CompleteEnumType(const DWARFDIE &die,
lldb_private::Type *type,
CompilerType &clang_type) {
const CompilerType &clang_type) {
if (TypeSystemClang::StartTagDeclarationDefinition(clang_type)) {
if (die.HasChildren()) {
bool is_signed = false;
Expand All @@ -2165,9 +2165,9 @@ bool DWARFASTParserClang::CompleteEnumType(const DWARFDIE &die,
return (bool)clang_type;
}

bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
lldb_private::Type *type,
CompilerType &clang_type) {
bool DWARFASTParserClang::CompleteTypeFromDWARF(
const DWARFDIE &die, lldb_private::Type *type,
const CompilerType &clang_type) {
SymbolFileDWARF *dwarf = die.GetDWARF();

std::lock_guard<std::recursive_mutex> guard(
Expand Down Expand Up @@ -2244,7 +2244,7 @@ DWARFASTParserClang::GetDeclContextContainingUIDFromDWARF(const DWARFDIE &die) {
}

size_t DWARFASTParserClang::ParseChildEnumerators(
lldb_private::CompilerType &clang_type, bool is_signed,
const lldb_private::CompilerType &clang_type, bool is_signed,
uint32_t enumerator_byte_size, const DWARFDIE &parent_die) {
if (!parent_die)
return 0;
Expand Down Expand Up @@ -3032,7 +3032,7 @@ void DWARFASTParserClang::ParseSingleMember(
}

bool DWARFASTParserClang::ParseChildMembers(
const DWARFDIE &parent_die, CompilerType &class_clang_type,
const DWARFDIE &parent_die, const CompilerType &class_clang_type,
std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
std::vector<DWARFDIE> &member_function_dies,
std::vector<DWARFDIE> &contained_type_dies,
Expand Down Expand Up @@ -3763,7 +3763,8 @@ bool DWARFASTParserClang::ShouldCreateUnnamedBitfield(
}

void DWARFASTParserClang::ParseRustVariantPart(
DWARFDIE &die, const DWARFDIE &parent_die, CompilerType &class_clang_type,
DWARFDIE &die, const DWARFDIE &parent_die,
const CompilerType &class_clang_type,
const lldb::AccessType default_accesibility,
ClangASTImporter::LayoutInfo &layout_info) {
assert(die.Tag() == llvm::dwarf::DW_TAG_variant_part);
Expand Down
18 changes: 9 additions & 9 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
const lldb_private::plugin::dwarf::DWARFDIE &die,
const lldb_private::AddressRange &func_range) override;

bool
CompleteTypeFromDWARF(const lldb_private::plugin::dwarf::DWARFDIE &die,
lldb_private::Type *type,
lldb_private::CompilerType &compiler_type) override;
bool CompleteTypeFromDWARF(
const lldb_private::plugin::dwarf::DWARFDIE &die,
lldb_private::Type *type,
const lldb_private::CompilerType &compiler_type) override;

lldb_private::CompilerDecl GetDeclForUIDFromDWARF(
const lldb_private::plugin::dwarf::DWARFDIE &die) override;
Expand Down Expand Up @@ -178,7 +178,7 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {

bool ParseChildMembers(
const lldb_private::plugin::dwarf::DWARFDIE &die,
lldb_private::CompilerType &class_compiler_type,
const lldb_private::CompilerType &class_compiler_type,
std::vector<std::unique_ptr<clang::CXXBaseSpecifier>> &base_classes,
std::vector<lldb_private::plugin::dwarf::DWARFDIE> &member_function_dies,
std::vector<lldb_private::plugin::dwarf::DWARFDIE> &contained_type_dies,
Expand All @@ -196,7 +196,7 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
unsigned &type_quals);

size_t ParseChildEnumerators(
lldb_private::CompilerType &compiler_type, bool is_signed,
const lldb_private::CompilerType &compiler_type, bool is_signed,
uint32_t enumerator_byte_size,
const lldb_private::plugin::dwarf::DWARFDIE &parent_die);

Expand Down Expand Up @@ -362,10 +362,10 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {

bool CompleteRecordType(const lldb_private::plugin::dwarf::DWARFDIE &die,
lldb_private::Type *type,
lldb_private::CompilerType &clang_type);
const lldb_private::CompilerType &clang_type);
bool CompleteEnumType(const lldb_private::plugin::dwarf::DWARFDIE &die,
lldb_private::Type *type,
lldb_private::CompilerType &clang_type);
const lldb_private::CompilerType &clang_type);

lldb::TypeSP
ParseTypeModifier(const lldb_private::SymbolContext &sc,
Expand Down Expand Up @@ -467,7 +467,7 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
void
ParseRustVariantPart(lldb_private::plugin::dwarf::DWARFDIE &die,
const lldb_private::plugin::dwarf::DWARFDIE &parent_die,
lldb_private::CompilerType &class_clang_type,
const lldb_private::CompilerType &class_clang_type,
const lldb::AccessType default_accesibility,
lldb_private::ClangASTImporter::LayoutInfo &layout_info);
};
Expand Down
Loading