Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 0439ed6

Browse files
committed
Use print() instead of dump() in code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293371 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d12101a commit 0439ed6

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

lib/CodeGen/AsmPrinter/DebugLocEntry.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ class DebugLocEntry {
7676
const DIExpression *getExpression() const { return Expression; }
7777
friend bool operator==(const Value &, const Value &);
7878
friend bool operator<(const Value &, const Value &);
79-
void dump() const {
79+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
80+
LLVM_DUMP_METHOD void dump() const {
8081
if (isLocation()) {
8182
llvm::dbgs() << "Loc = { reg=" << Loc.getReg() << " ";
8283
if (Loc.isIndirect())
@@ -90,6 +91,7 @@ class DebugLocEntry {
9091
if (Expression)
9192
Expression->dump();
9293
}
94+
#endif
9395
};
9496

9597
private:

lib/CodeGen/LiveDebugValues.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ class LiveDebugValues : public MachineFunctionPass {
150150
/// dominates MBB.
151151
bool dominates(MachineBasicBlock &MBB) const { return UVS.dominates(&MBB); }
152152

153-
void dump() const { MI.dump(); }
153+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
154+
LLVM_DUMP_METHOD void dump() const { MI.dump(); }
155+
#endif
154156

155157
bool operator==(const VarLoc &Other) const {
156158
return Var == Other.Var && Loc.Hash == Other.Loc.Hash;
@@ -282,6 +284,7 @@ void LiveDebugValues::getAnalysisUsage(AnalysisUsage &AU) const {
282284
// Debug Range Extension Implementation
283285
//===----------------------------------------------------------------------===//
284286

287+
#ifndef NDEBUG
285288
void LiveDebugValues::printVarLocInMBB(const MachineFunction &MF,
286289
const VarLocInMBB &V,
287290
const VarLocMap &VarLocIDs,
@@ -300,6 +303,7 @@ void LiveDebugValues::printVarLocInMBB(const MachineFunction &MF,
300303
}
301304
Out << "\n";
302305
}
306+
#endif
303307

304308
/// End all previous ranges related to @MI and start a new range from @MI
305309
/// if it is a DBG_VALUE instr.

lib/Target/MSP430/MSP430ISelDAGToDAG.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ namespace {
6161
return GV != nullptr || CP != nullptr || ES != nullptr || JT != -1;
6262
}
6363

64-
void dump() {
64+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
65+
LLVM_DUMP_METHOD void dump() {
6566
errs() << "MSP430ISelAddressMode " << this << '\n';
6667
if (BaseType == RegBase && Base.Reg.getNode() != nullptr) {
6768
errs() << "Base.Reg ";
@@ -83,6 +84,7 @@ namespace {
8384
} else if (JT != -1)
8485
errs() << " JT" << JT << " Align" << Align << '\n';
8586
}
87+
#endif
8688
};
8789
}
8890

lib/Transforms/IPO/MergeFunctions.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
304304
if (Res1 != -Res2) {
305305
dbgs() << "MERGEFUNC-SANITY: Non-symmetric; triple: " << TripleNumber
306306
<< "\n";
307-
F1->dump();
308-
F2->dump();
307+
dbgs() << *F1 << '\n' << *F2 << '\n';
309308
Valid = false;
310309
}
311310

@@ -340,9 +339,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
340339
<< TripleNumber << "\n";
341340
dbgs() << "Res1, Res3, Res4: " << Res1 << ", " << Res3 << ", "
342341
<< Res4 << "\n";
343-
F1->dump();
344-
F2->dump();
345-
F3->dump();
342+
dbgs() << *F1 << '\n' << *F2 << '\n' << *F3 << '\n';
346343
Valid = false;
347344
}
348345
}

0 commit comments

Comments
 (0)