Skip to content

Commit c3adfbc

Browse files
[llvm-debuginfo-analyzer] IR Reader.
Changes required after rebase with upstream to include: Remove LVScope::Children container. #144750
1 parent b5d94da commit c3adfbc

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

llvm/lib/DebugInfo/LogicalView/Core/LVReader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ void printCollectedElements(LVScope *Root) {
3232
Entry->print(dbgs());
3333
};
3434

35-
Print(Parent->getChildren());
35+
for (LVElement *Element : Parent->getChildren())
36+
Element->print(dbgs());
3637
Print(Parent->getLines());
3738
Print(Parent->getRanges());
3839
if (const LVScopes *Scopes = Parent->getScopes())

llvm/lib/DebugInfo/LogicalView/Readers/LVIRReader.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,14 +2283,14 @@ void LVIRReader::checkScopes(LVScope *Scope) {
22832283
};
22842284

22852285
std::function<void(LVScope * Parent)> Traverse = [&](LVScope *Current) {
2286-
auto Check = [&](const auto *Set) {
2287-
if (Set)
2288-
for (const auto &Entry : *Set)
2289-
if (!Entry->getIsFinalized())
2290-
PrintElement(Entry);
2286+
auto Check = [&](auto *Entry) {
2287+
if (Entry)
2288+
if (!Entry->getIsFinalized())
2289+
PrintElement(Entry);
22912290
};
22922291

2293-
Check(Current->getChildren());
2292+
for (LVElement *Element : Current->getChildren())
2293+
Check(Element);
22942294

22952295
if (Current->getScopes())
22962296
for (LVScope *Scope : *Current->getScopes())

llvm/test/tools/llvm-debuginfo-analyzer/IR/01-ir-compare-logical-elements.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
; ONE-NEXT: [002] 1 {TypeAlias} 'INTPTR' -> '* const int'
3636
; ONE-NEXT: [002] 2 {Function} extern not_inlined 'foo' -> 'int'
3737
; ONE-NEXT: [003] {Block}
38-
; ONE-NEXT: [004] 5 {Variable} 'CONSTANT' -> 'const INTEGER'
3938
; ONE-NEXT: +[004] 4 {TypeAlias} 'INTEGER' -> 'int'
39+
; ONE-NEXT: [004] 5 {Variable} 'CONSTANT' -> 'const INTEGER'
4040
; ONE-NEXT: [003] 2 {Parameter} 'ParamBool' -> 'bool'
4141
; ONE-NEXT: [003] 2 {Parameter} 'ParamPtr' -> 'INTPTR'
4242
; ONE-NEXT: [003] 2 {Parameter} 'ParamUnsigned' -> 'unsigned int'

0 commit comments

Comments
 (0)