Skip to content

Commit 83f5287

Browse files
committed
Rename DWO -> Clang module to avoid confusion. (NFC)
1 parent 4229f70 commit 83f5287

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

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

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ static lldb::ModuleSP GetContainingClangModule(const DWARFDIE &die) {
171171
TypeSP DWARFASTParserClang::ParseTypeFromClangModule(const SymbolContext &sc,
172172
const DWARFDIE &die,
173173
Log *log) {
174-
ModuleSP dwo_module_sp = GetContainingClangModule(die);
175-
if (!dwo_module_sp)
174+
ModuleSP clang_module_sp = GetContainingClangModule(die);
175+
if (!clang_module_sp)
176176
return TypeSP();
177177

178178
// If this type comes from a Clang module, recursively look in the
@@ -186,7 +186,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromClangModule(const SymbolContext &sc,
186186
LanguageSet languages;
187187
languages.Insert(die.GetCU()->GetLanguageType());
188188
llvm::DenseSet<SymbolFile *> searched_symbol_files;
189-
dwo_module_sp->GetSymbolFile()->FindTypes(decl_context, languages,
189+
clang_module_sp->GetSymbolFile()->FindTypes(decl_context, languages,
190190
searched_symbol_files, pcm_types);
191191
if (pcm_types.Empty()) {
192192
// Since this type is defined in one of the Clang modules imported
@@ -468,32 +468,36 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
468468
case DW_TAG_volatile_type:
469469
case DW_TAG_unspecified_type: {
470470
if (tag == DW_TAG_typedef && attrs.type.IsValid()) {
471-
// Try to parse a typedef from the DWO file first as modules can
472-
// contain typedef'ed structures that have no names like:
471+
// Try to parse a typedef from the (DWARF embedded in the) Clang
472+
// module file first as modules can contain typedef'ed
473+
// structures that have no names like:
473474
//
474475
// typedef struct { int a; } Foo;
475476
//
476-
// In this case we will have a structure with no name and a typedef
477-
// named "Foo" that points to this unnamed structure. The name in the
478-
// typedef is the only identifier for the struct, so always try to
479-
// get typedefs from DWO files if possible.
477+
// In this case we will have a structure with no name and a
478+
// typedef named "Foo" that points to this unnamed
479+
// structure. The name in the typedef is the only identifier for
480+
// the struct, so always try to get typedefs from Clang modules
481+
// if possible.
480482
//
481-
// The type_sp returned will be empty if the typedef doesn't exist in
482-
// a DWO file, so it is cheap to call this function just to check.
483+
// The type_sp returned will be empty if the typedef doesn't
484+
// exist in a module file, so it is cheap to call this function
485+
// just to check.
483486
//
484-
// If we don't do this we end up creating a TypeSP that says this is
485-
// a typedef to type 0x123 (the DW_AT_type value would be 0x123 in
486-
// the DW_TAG_typedef), and this is the unnamed structure type. We
487-
// will have a hard time tracking down an unnammed structure type in
488-
// the module DWO file, so we make sure we don't get into this
489-
// situation by always resolving typedefs from the DWO file.
487+
// If we don't do this we end up creating a TypeSP that says
488+
// this is a typedef to type 0x123 (the DW_AT_type value would
489+
// be 0x123 in the DW_TAG_typedef), and this is the unnamed
490+
// structure type. We will have a hard time tracking down an
491+
// unnammed structure type in the module debug info, so we make
492+
// sure we don't get into this situation by always resolving
493+
// typedefs from the module.
490494
const DWARFDIE encoding_die = attrs.type.Reference();
491495

492-
// First make sure that the die that this is typedef'ed to _is_ just
493-
// a declaration (DW_AT_declaration == 1), not a full definition
494-
// since template types can't be represented in modules since only
495-
// concrete instances of templates are ever emitted and modules won't
496-
// contain those
496+
// First make sure that the die that this is typedef'ed to _is_
497+
// just a declaration (DW_AT_declaration == 1), not a full
498+
// definition since template types can't be represented in
499+
// modules since only concrete instances of templates are ever
500+
// emitted and modules won't contain those
497501
if (encoding_die &&
498502
encoding_die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0) == 1) {
499503
type_sp = ParseTypeFromClangModule(sc, die, log);

0 commit comments

Comments
 (0)