Skip to content

Commit 5d0f679

Browse files
committed
Addressed some more feedback
1 parent bf7848e commit 5d0f679

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "llvm/ADT/SetVector.h"
1413
#include "llvm/DebugInfo/LogicalView/Core/LVReader.h"
14+
#include "llvm/ADT/SetVector.h"
1515
#include "llvm/DebugInfo/LogicalView/Core/LVScope.h"
1616
#include "llvm/Support/FileSystem.h"
1717
#include "llvm/Support/FormatAdapters.h"
@@ -531,9 +531,9 @@ namespace {
531531

532532
struct DebuggerViewPrinter {
533533
std::vector<const LVLine *> Lines;
534-
std::unordered_map<LVAddress, std::vector<const LVLocation *>> LivetimeBegins;
534+
std::unordered_map<LVAddress, std::vector<const LVLocation *>> LifetimeBegins;
535535
std::unordered_map<LVAddress, std::vector<const LVLocation *>>
536-
LivetimeEndsExclusive;
536+
LifetimeEndsExclusive;
537537
raw_ostream &OS;
538538

539539
const bool IncludeRanges = false;
@@ -566,8 +566,9 @@ struct DebuggerViewPrinter {
566566

567567
LVAddress Begin = Loc->getLowerAddress();
568568
LVAddress End = Loc->getUpperAddress();
569-
LivetimeBegins[Begin].push_back(Loc);
570-
LivetimeEndsExclusive[End].push_back(Loc);
569+
LifetimeBegins[Begin].push_back(Loc);
570+
LifetimeEndsExclusive[End].push_back(Loc);
571+
571572
if (IncludeRanges) {
572573
OS << "[" << hexValue(Begin) << ":" << hexValue(End) << "] ";
573574
}
@@ -629,10 +630,10 @@ struct DebuggerViewPrinter {
629630
for (const LVLine *Line : Lines) {
630631
const LVScope *Scope = Line->getParentScope();
631632
// Update live list: Add lives
632-
for (auto Loc : LivetimeBegins[Line->getAddress()])
633+
for (auto Loc : LifetimeBegins[Line->getAddress()])
633634
LiveSymbols.insert(Loc);
634635
// Update live list: remove dead
635-
for (auto Loc : LivetimeEndsExclusive[Line->getAddress()])
636+
for (auto Loc : LifetimeEndsExclusive[Line->getAddress()])
636637
LiveSymbols.remove(Loc);
637638

638639
if (Line->getIsNewStatement() && Line->getIsLineDebug() &&
@@ -653,8 +654,8 @@ struct DebuggerViewPrinter {
653654
if (SymScope != LineScope && !IsChildScopeOf(LineScope, SymScope))
654655
continue;
655656
PrintIndent(OS, 2);
656-
OS << "{Variable}: " << Sym->getName() << ": " << Sym->getType()->getName()
657-
<< " : ";
657+
OS << "{Variable}: " << Sym->getName() << ": "
658+
<< Sym->getType()->getName() << " : ";
658659
SymLoc->printLocations(OS);
659660
OS << " (line " << Sym->getLineNumber() << ")";
660661
OS << "\n";
@@ -674,7 +675,8 @@ struct DebuggerViewPrinter {
674675
Error LVReader::printDebugger() {
675676
auto *CU = getCompileUnit();
676677
if (!CU) {
677-
return createStringError(std::make_error_code(std::errc::invalid_argument), "Error: No compute unit found.");
678+
return createStringError(std::make_error_code(std::errc::invalid_argument),
679+
"Error: No compute unit found.");
678680
}
679681

680682
for (LVElement *Child : *CU->getChildren()) {

llvm/test/CodeGen/AMDGPU/amdgpu-debuginfo-check.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
; RUN: llc %s -o %t.o -mcpu=gfx1030 -filetype=obj -O0
22
; RUN: llvm-debuginfo-analyzer --report=debugger --print=symbols %t.o | FileCheck %s
33

4-
; This test compiles this module with AMDGPU backend under -O0,
5-
; and makes sure llvm-debuginfo-analyzer --report=debugger works for it.
4+
; The test compiles this module using the AMDGPU backend under `-O0`,
5+
; and makes sure `llvm-debuginfo-analyzer --report=debugger` works for it.
66

77
; CHECK: {Function}: main
88
; CHECK: {Line}: {{.+}}basic_var.hlsl:7

0 commit comments

Comments
 (0)