Mark dump() methods as const. NFC

Add const qualifier to any dump() method where adding one
was trivial.

Differential Revision: https://reviews.llvm.org/D34481

llvm-svn: 305963
This commit is contained in:
Sam Clegg 2017-06-21 22:19:17 +00:00
parent e3eb42cef6
commit 705f798bff
15 changed files with 27 additions and 27 deletions

View File

@ -121,8 +121,8 @@ public:
/// Print the abbreviation using the specified asm printer. /// Print the abbreviation using the specified asm printer.
void Emit(const AsmPrinter *AP) const; void Emit(const AsmPrinter *AP) const;
void print(raw_ostream &O); void print(raw_ostream &O) const;
void dump(); void dump() const;
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
@ -780,7 +780,7 @@ public:
DIEValue findAttribute(dwarf::Attribute Attribute) const; DIEValue findAttribute(dwarf::Attribute Attribute) const;
void print(raw_ostream &O, unsigned IndentCount = 0) const; void print(raw_ostream &O, unsigned IndentCount = 0) const;
void dump(); void dump() const;
}; };
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//

View File

@ -196,7 +196,7 @@ public:
} }
/// dump - Print data structures to dbgs(). /// dump - Print data structures to dbgs().
void dump(); void dump() const;
/// getOrCreateAbstractScope - Find or create an abstract lexical scope. /// getOrCreateAbstractScope - Find or create an abstract lexical scope.
LexicalScope *getOrCreateAbstractScope(const DILocalScope *Scope); LexicalScope *getOrCreateAbstractScope(const DILocalScope *Scope);

View File

@ -203,7 +203,7 @@ public:
MachineBasicBlock::iterator End, MachineBasicBlock::iterator End,
unsigned NumRegionInstrs) {} unsigned NumRegionInstrs) {}
virtual void dumpPolicy() {} virtual void dumpPolicy() const {}
/// Check if pressure tracking is needed before building the DAG and /// Check if pressure tracking is needed before building the DAG and
/// initializing this strategy. Called after initPolicy. /// initializing this strategy. Called after initPolicy.
@ -555,7 +555,7 @@ public:
return Queue.begin() + idx; return Queue.begin() + idx;
} }
void dump(); void dump() const;
}; };
/// Summarize the unscheduled region. /// Summarize the unscheduled region.
@ -756,7 +756,7 @@ public:
SUnit *pickOnlyChoice(); SUnit *pickOnlyChoice();
#ifndef NDEBUG #ifndef NDEBUG
void dumpScheduledState(); void dumpScheduledState() const;
#endif #endif
}; };
@ -890,7 +890,7 @@ public:
MachineBasicBlock::iterator End, MachineBasicBlock::iterator End,
unsigned NumRegionInstrs) override; unsigned NumRegionInstrs) override;
void dumpPolicy() override; void dumpPolicy() const override;
bool shouldTrackPressure() const override { bool shouldTrackPressure() const override {
return RegionPolicy.ShouldTrackPressure; return RegionPolicy.ShouldTrackPressure;

View File

@ -413,7 +413,7 @@ public:
/// @} /// @}
void dump(); void dump() const;
}; };
/// \brief Compute the amount of padding required before the fragment \p F to /// \brief Compute the amount of padding required before the fragment \p F to

View File

@ -130,7 +130,7 @@ public:
/// \brief Return true if given frgment has FT_Dummy type. /// \brief Return true if given frgment has FT_Dummy type.
bool isDummy() const { return Kind == FT_Dummy; } bool isDummy() const { return Kind == FT_Dummy; }
void dump(); void dump() const;
}; };
class MCDummyFragment : public MCFragment { class MCDummyFragment : public MCFragment {

View File

@ -167,7 +167,7 @@ public:
MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection); MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection);
void dump(); void dump() const;
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, virtual void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS, raw_ostream &OS,

View File

@ -209,7 +209,7 @@ private:
// Other helper routines // Other helper routines
bool processInstruction(Instruction *I); bool processInstruction(Instruction *I);
bool processBlock(BasicBlock *BB); bool processBlock(BasicBlock *BB);
void dump(DenseMap<uint32_t, Value *> &d); void dump(DenseMap<uint32_t, Value *> &d) const;
bool iterateOnFunction(Function &F); bool iterateOnFunction(Function &F);
bool performPRE(Function &F); bool performPRE(Function &F);
bool performScalarPRE(Instruction *I); bool performScalarPRE(Instruction *I);

View File

@ -105,7 +105,7 @@ void DIEAbbrev::Emit(const AsmPrinter *AP) const {
} }
LLVM_DUMP_METHOD LLVM_DUMP_METHOD
void DIEAbbrev::print(raw_ostream &O) { void DIEAbbrev::print(raw_ostream &O) const {
O << "Abbreviation @" O << "Abbreviation @"
<< format("0x%lx", (long)(intptr_t)this) << format("0x%lx", (long)(intptr_t)this)
<< " " << " "
@ -128,7 +128,7 @@ void DIEAbbrev::print(raw_ostream &O) {
} }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void DIEAbbrev::dump() { LLVM_DUMP_METHOD void DIEAbbrev::dump() const {
print(dbgs()); print(dbgs());
} }
#endif #endif
@ -268,7 +268,7 @@ void DIE::print(raw_ostream &O, unsigned IndentCount) const {
} }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void DIE::dump() { LLVM_DUMP_METHOD void DIE::dump() const {
print(dbgs()); print(dbgs());
} }
#endif #endif

View File

@ -1006,7 +1006,7 @@ bool LiveDebugVariables::doInitialization(Module &M) {
} }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void LiveDebugVariables::dump() { LLVM_DUMP_METHOD void LiveDebugVariables::dump() const {
if (pImpl) if (pImpl)
static_cast<LDVImpl*>(pImpl)->print(dbgs()); static_cast<LDVImpl*>(pImpl)->print(dbgs());
} }

View File

@ -59,7 +59,7 @@ public:
void emitDebugValues(VirtRegMap *VRM); void emitDebugValues(VirtRegMap *VRM);
/// dump - Print data structures to dbgs(). /// dump - Print data structures to dbgs().
void dump(); void dump() const;
private: private:

View File

@ -542,7 +542,7 @@ void MachineSchedulerBase::print(raw_ostream &O, const Module* m) const {
} }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void ReadyQueue::dump() { LLVM_DUMP_METHOD void ReadyQueue::dump() const {
dbgs() << "Queue " << Name << ": "; dbgs() << "Queue " << Name << ": ";
for (const SUnit *SU : Queue) for (const SUnit *SU : Queue)
dbgs() << SU->NodeNum << " "; dbgs() << SU->NodeNum << " ";
@ -2309,7 +2309,7 @@ SUnit *SchedBoundary::pickOnlyChoice() {
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
// This is useful information to dump after bumpNode. // This is useful information to dump after bumpNode.
// Note that the Queue contents are more useful before pickNodeFromQueue. // Note that the Queue contents are more useful before pickNodeFromQueue.
LLVM_DUMP_METHOD void SchedBoundary::dumpScheduledState() { LLVM_DUMP_METHOD void SchedBoundary::dumpScheduledState() const {
unsigned ResFactor; unsigned ResFactor;
unsigned ResCount; unsigned ResCount;
if (ZoneCritResIdx) { if (ZoneCritResIdx) {
@ -2648,7 +2648,7 @@ void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin,
} }
} }
void GenericScheduler::dumpPolicy() { void GenericScheduler::dumpPolicy() const {
// Cannot completely remove virtual function even in release mode. // Cannot completely remove virtual function even in release mode.
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
dbgs() << "GenericScheduler RegionPolicy: " dbgs() << "GenericScheduler RegionPolicy: "

View File

@ -307,7 +307,7 @@ raw_ostream &operator<<(raw_ostream &OS, const MCFixup &AF) {
} // end namespace llvm } // end namespace llvm
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void MCFragment::dump() { LLVM_DUMP_METHOD void MCFragment::dump() const {
raw_ostream &OS = errs(); raw_ostream &OS = errs();
OS << "<"; OS << "<";
@ -445,19 +445,19 @@ LLVM_DUMP_METHOD void MCFragment::dump() {
OS << ">"; OS << ">";
} }
LLVM_DUMP_METHOD void MCAssembler::dump() { LLVM_DUMP_METHOD void MCAssembler::dump() const{
raw_ostream &OS = errs(); raw_ostream &OS = errs();
OS << "<MCAssembler\n"; OS << "<MCAssembler\n";
OS << " Sections:[\n "; OS << " Sections:[\n ";
for (iterator it = begin(), ie = end(); it != ie; ++it) { for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
if (it != begin()) OS << ",\n "; if (it != begin()) OS << ",\n ";
it->dump(); it->dump();
} }
OS << "],\n"; OS << "],\n";
OS << " Symbols:["; OS << " Symbols:[";
for (symbol_iterator it = symbol_begin(), ie = symbol_end(); it != ie; ++it) { for (const_symbol_iterator it = symbol_begin(), ie = symbol_end(); it != ie; ++it) {
if (it != symbol_begin()) OS << ",\n "; if (it != symbol_begin()) OS << ",\n ";
OS << "("; OS << "(";
it->dump(); it->dump();

View File

@ -86,7 +86,7 @@ MCSection::getSubsectionInsertionPoint(unsigned Subsection) {
} }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void MCSection::dump() { LLVM_DUMP_METHOD void MCSection::dump() const {
raw_ostream &OS = errs(); raw_ostream &OS = errs();
OS << "<MCSection"; OS << "<MCSection";

View File

@ -72,7 +72,7 @@ class SystemZPostRASchedStrategy : public MachineSchedStrategy {
// A set of SUs with a sorter and dump method. // A set of SUs with a sorter and dump method.
struct SUSet : std::set<SUnit*, SUSorter> { struct SUSet : std::set<SUnit*, SUSorter> {
#ifndef NDEBUG #ifndef NDEBUG
void dump(SystemZHazardRecognizer &HazardRec); void dump(SystemZHazardRecognizer &HazardRec) const;
#endif #endif
}; };

View File

@ -602,7 +602,7 @@ PreservedAnalyses GVN::run(Function &F, FunctionAnalysisManager &AM) {
} }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void GVN::dump(DenseMap<uint32_t, Value*>& d) { LLVM_DUMP_METHOD void GVN::dump(DenseMap<uint32_t, Value*>& d) const {
errs() << "{\n"; errs() << "{\n";
for (DenseMap<uint32_t, Value*>::iterator I = d.begin(), for (DenseMap<uint32_t, Value*>::iterator I = d.begin(),
E = d.end(); I != E; ++I) { E = d.end(); I != E; ++I) {