@@ -171,8 +171,8 @@ static lldb::ModuleSP GetContainingClangModule(const DWARFDIE &die) {
171
171
TypeSP DWARFASTParserClang::ParseTypeFromClangModule (const SymbolContext &sc,
172
172
const DWARFDIE &die,
173
173
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 )
176
176
return TypeSP ();
177
177
178
178
// If this type comes from a Clang module, recursively look in the
@@ -186,7 +186,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromClangModule(const SymbolContext &sc,
186
186
LanguageSet languages;
187
187
languages.Insert (die.GetCU ()->GetLanguageType ());
188
188
llvm::DenseSet<SymbolFile *> searched_symbol_files;
189
- dwo_module_sp ->GetSymbolFile ()->FindTypes (decl_context, languages,
189
+ clang_module_sp ->GetSymbolFile ()->FindTypes (decl_context, languages,
190
190
searched_symbol_files, pcm_types);
191
191
if (pcm_types.Empty ()) {
192
192
// Since this type is defined in one of the Clang modules imported
@@ -468,32 +468,36 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
468
468
case DW_TAG_volatile_type:
469
469
case DW_TAG_unspecified_type: {
470
470
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:
473
474
//
474
475
// typedef struct { int a; } Foo;
475
476
//
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.
480
482
//
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.
483
486
//
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.
490
494
const DWARFDIE encoding_die = attrs.type .Reference ();
491
495
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
497
501
if (encoding_die &&
498
502
encoding_die.GetAttributeValueAsUnsigned (DW_AT_declaration, 0 ) == 1 ) {
499
503
type_sp = ParseTypeFromClangModule (sc, die, log);
0 commit comments