Skip to content

Commit 6e7feac

Browse files
committed
Deleted test code. Formatting.
1 parent 5465020 commit 6e7feac

File tree

6 files changed

+26
-37
lines changed

6 files changed

+26
-37
lines changed

llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class DWARFFormValue {
8383

8484
LLVM_ABI bool isFormClass(FormClass FC) const;
8585
const DWARFUnit *getUnit() const { return U; }
86-
LLVM_DUMP_METHOD void dump() const;
8786
LLVM_ABI void dump(raw_ostream &OS,
8887
DIDumpOptions DumpOpts = DIDumpOptions()) const;
8988
LLVM_ABI void dumpSectionedAddress(raw_ostream &OS, DIDumpOptions DumpOpts,

llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ void DWARFFormValue::dumpAddressSection(const DWARFObject &Obj, raw_ostream &OS,
379379
OS << format(" [%" PRIu64 "]", SectionIndex);
380380
}
381381

382-
LLVM_DUMP_METHOD void DWARFFormValue::dump() const { dump(dbgs()); }
383-
384382
void DWARFFormValue::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
385383
uint64_t UValue = Value.uval;
386384
bool CURelativeOffset = false;

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,6 @@ void LVScope::addElement(LVLine *Line) {
134134
if (!Lines)
135135
Lines = std::make_unique<LVLines>();
136136

137-
if (Line->getAddress() == 0x2fc)
138-
outs() << "Set Parent for line at addr: " << Line->getAddress()
139-
<< "\n ";
140137
// Add it to parent.
141138
Lines->push_back(Line);
142139
Line->setParent(this);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,6 @@ void LVBinaryReader::processLines(LVLines *DebugLines,
733733
for (LVLine *Line : *DebugLines) {
734734
// Using the current line address, get its associated lexical scope and
735735
// add the line information to it.
736-
737-
if (Line->getAddress() == 0x2fc)
738-
outs() << "";
739736
Scope = ScopesWithRanges->getEntry(Line->getAddress());
740737
if (!Scope) {
741738
// If missing scope, use the compile unit.

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ void LVDWARFReader::processOneAttribute(const DWARFDie &Die,
252252

253253
case dwarf::DW_AT_ranges:
254254
if (RangesDataAvailable && options().getGeneralCollectRanges()) {
255-
if (CurrentScope->getID() == 2237)
256-
outs() << "";
257255
auto GetRanges = [](const DWARFFormValue &FormValue,
258256
DWARFUnit *U) -> Expected<DWARFAddressRangesVector> {
259257
if (FormValue.getForm() == dwarf::DW_FORM_rnglistx)
@@ -463,16 +461,17 @@ LVScope *LVDWARFReader::processOneDie(const DWARFDie &InputDIE, LVScope *Parent,
463461
if (!CurrentRanges.empty()) {
464462
for (LVAddressRange &Range : CurrentRanges)
465463
addSectionRange(SectionIndex, CurrentScope, Range.first,
466-
Range.second > Range.first ? Range.second - 1
467-
: Range.second);
464+
Range.second > Range.first
465+
? Range.second - 1 // Make hi-pc exclusive
466+
: Range.second);
468467
CurrentRanges.clear();
469468
}
470469
// If the scope is the CU, do not update the ranges set.
471470
if (FoundLowPC && FoundHighPC && !IsCompileUnit) {
472471
addSectionRange(SectionIndex, CurrentScope, CurrentLowPC,
473472
CurrentHighPC > CurrentLowPC
474-
? CurrentHighPC - 1
475-
: CurrentHighPC); // Make hi-pc exclusive
473+
? CurrentHighPC - 1 // Make hi-pc exclusive
474+
: CurrentHighPC);
476475
}
477476
}
478477
}

llvm/tools/llvm-debuginfo-check/llvm-debuginfo-check.cpp

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
//
1212
//===----------------------------------------------------------------------===//
1313

14-
#include "llvm/Support/InitLLVM.h"
15-
#include "llvm/Support/TargetSelect.h"
14+
#include "llvm/ADT/SetVector.h"
15+
#include "llvm/DebugInfo/LogicalView/LVReaderHandler.h"
1616
#include "llvm/Support/CommandLine.h"
17+
#include "llvm/Support/InitLLVM.h"
1718
#include "llvm/Support/MemoryBuffer.h"
1819
#include "llvm/Support/ScopedPrinter.h"
19-
#include "llvm/DebugInfo/LogicalView/LVReaderHandler.h"
20-
#include "llvm/ADT/SetVector.h"
20+
#include "llvm/Support/TargetSelect.h"
2121

2222
#include <string>
23-
#include <unordered_set>
2423
#include <unordered_map>
24+
#include <unordered_set>
2525

2626
using namespace llvm;
2727
using namespace logicalview;
@@ -32,7 +32,8 @@ static cl::opt<std::string>
3232
cl::Required);
3333

3434
static cl::opt<bool> IncludeCode("code", cl::desc("Include asm"));
35-
static cl::opt<bool> IncludeRanges("ranges", cl::desc("Include variable ranges"));
35+
static cl::opt<bool> IncludeRanges("ranges",
36+
cl::desc("Include variable ranges"));
3637
static cl::opt<bool> IncludeVars("vars", cl::desc("Include live variables"));
3738

3839
template <typename T> T Take(Expected<T> ExpectedResult, const Twine &Msg) {
@@ -52,16 +53,14 @@ struct ScopePrinter {
5253
LivetimeEndsExclusive;
5354
raw_ostream &OS;
5455

55-
void Walk(raw_ostream &OS, const LVScope* Scope) {
56+
void Walk(raw_ostream &OS, const LVScope *Scope) {
5657
if (Scope->scopeCount()) {
5758
for (const LVScope *ChildScope : *Scope->getScopes())
5859
Walk(OS, ChildScope);
5960
}
6061
if (Scope->lineCount()) {
6162
for (const LVLine *Line : *Scope->getLines()) {
6263
Lines.push_back(Line);
63-
if (Line->getParentScope() != Scope)
64-
OS << "";
6564
}
6665
}
6766
if (Scope->symbolCount()) {
@@ -72,7 +71,8 @@ struct ScopePrinter {
7271
continue;
7372

7473
if (IncludeRanges) {
75-
OS << "RANGES: " << Symbol->getName() << " (line " << Symbol->getLineNumber() << ")" << ": ";
74+
OS << "RANGES: " << Symbol->getName() << " (line "
75+
<< Symbol->getLineNumber() << ")" << ": ";
7676
}
7777

7878
for (const LVLocation *Loc : SymbolLocations) {
@@ -111,14 +111,15 @@ struct ScopePrinter {
111111
OS << " ";
112112
}
113113

114-
static void PrintCallstack(raw_ostream& OS, const LVScope* Scope) {
114+
static void PrintCallstack(raw_ostream &OS, const LVScope *Scope) {
115115
bool First = true;
116116
const LVScope *PrevScope = nullptr;
117117
while (Scope) {
118118
if (Scope->getIsFunction() || Scope->getIsInlinedFunction()) {
119119
OS << "[" << Scope->getName();
120120
if (PrevScope && PrevScope->getIsInlinedFunction()) {
121-
OS << ":" << cast<LVScopeFunctionInlined>(PrevScope)->getCallLineNumber();
121+
OS << ":"
122+
<< cast<LVScopeFunctionInlined>(PrevScope)->getCallLineNumber();
122123
}
123124
OS << "]";
124125
First = false;
@@ -138,7 +139,8 @@ struct ScopePrinter {
138139
}
139140

140141
void Print() {
141-
SetVector<const LVLocation *> LiveSymbols; // This needs to be ordered since we're iterating over it.
142+
SetVector<const LVLocation *>
143+
LiveSymbols; // This needs to be ordered since we're iterating over it.
142144
int LastLine = -1;
143145
StringRef LastFilename;
144146
for (const LVLine *Line : Lines) {
@@ -165,16 +167,13 @@ struct ScopePrinter {
165167
if (IncludeVars) {
166168
for (auto SymLoc : LiveSymbols) {
167169
const LVSymbol *Sym = SymLoc->getParentSymbol();
168-
if (Sym->getName() == "InMRT1")
169-
outs() << "";
170170
auto SymScope = Sym->getParentScope();
171171
auto LineScope = LineDebug->getParentScope();
172172
if (SymScope != LineScope && !IsChildScopeOf(LineScope, SymScope))
173173
continue;
174174
PrintIndent(OS, 1);
175175
OS << "VAR: " << Sym->getName() << ": "
176-
<< Sym->getType()->getName()
177-
<< " : ";
176+
<< Sym->getType()->getName() << " : ";
178177
SymLoc->printLocations(OS);
179178
OS << " (line " << Sym->getLineNumber() << ")";
180179
OS << "\n";
@@ -200,8 +199,8 @@ int main(int argc, char *argv[]) {
200199
llvm::InitializeAllTargetMCs();
201200
InitializeAllDisassemblers();
202201

203-
cl::ParseCommandLineOptions(argc, argv,
204-
"Check debug info correctness via annotations.\n");
202+
cl::ParseCommandLineOptions(
203+
argc, argv, "Check debug info correctness via annotations.\n");
205204

206205
ScopedPrinter W(llvm::outs());
207206
LVOptions Options;
@@ -213,8 +212,8 @@ int main(int argc, char *argv[]) {
213212
std::vector<std::string> Objects;
214213
LVReaderHandler Handler(Objects, W, Options);
215214
auto Readers = Take(Handler.createReader(InputFilename),
216-
Twine("Failed to create LV reader from '") + Twine(InputFilename) +
217-
Twine("'"));
215+
Twine("Failed to create LV reader from '") +
216+
Twine(InputFilename) + Twine("'"));
218217

219218
auto *CU = Readers->getCompileUnit();
220219
if (!CU)
@@ -228,7 +227,7 @@ int main(int argc, char *argv[]) {
228227
if (!Lines)
229228
continue;
230229
outs() << "FUNCTION: " << Child->getName() << "\n";
231-
230+
232231
ScopePrinter P(outs(), Fn);
233232
P.Print();
234233
}

0 commit comments

Comments
 (0)