Skip to content

Commit 05dfbc1

Browse files
authored
[lldb] Regularize DWARFDIE::Get{TypeLookup,Decl}Context names (#122273)
The functions call GetName for everything except variables, where they call GetPubname instead. The difference is that the latter prefers to return the linkage name, if it is available. This doesn't seem particularly useful given that the linkage name already kind of contains the context of the variable, and I doubt that anything depends on it as these functions are currently called on type and subprogram DIEs -- not variables. This makes it easier to simplify/deduplicate these functions later.
1 parent 4adeb6c commit 05dfbc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static void GetDeclContextImpl(DWARFDIE die,
412412
push_ctx(CompilerContextKind::Function, die.GetName());
413413
break;
414414
case DW_TAG_variable:
415-
push_ctx(CompilerContextKind::Variable, die.GetPubname());
415+
push_ctx(CompilerContextKind::Variable, die.GetName());
416416
break;
417417
case DW_TAG_typedef:
418418
push_ctx(CompilerContextKind::Typedef, die.GetName());
@@ -457,7 +457,7 @@ static void GetTypeLookupContextImpl(DWARFDIE die,
457457
push_ctx(CompilerContextKind::Enum, die.GetName());
458458
break;
459459
case DW_TAG_variable:
460-
push_ctx(CompilerContextKind::Variable, die.GetPubname());
460+
push_ctx(CompilerContextKind::Variable, die.GetName());
461461
break;
462462
case DW_TAG_typedef:
463463
push_ctx(CompilerContextKind::Typedef, die.GetName());

0 commit comments

Comments
 (0)