diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h index d0ff0c978ba..d5f918eb2bb 100644 --- a/include/llvm/CodeGen/MachineBasicBlock.h +++ b/include/llvm/CodeGen/MachineBasicBlock.h @@ -674,9 +674,9 @@ public: // Debugging methods. void dump() const; - void print(raw_ostream &OS, SlotIndexes* = nullptr) const; + void print(raw_ostream &OS, const SlotIndexes* = nullptr) const; void print(raw_ostream &OS, ModuleSlotTracker &MST, - SlotIndexes * = nullptr) const; + const SlotIndexes* = nullptr) const; // Printing method used by LoopInfo. void printAsOperand(raw_ostream &OS, bool PrintType = true) const; diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 36cf6b50b7b..3e78986cba7 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -391,7 +391,7 @@ public: /// print - Print out the MachineFunction in a format suitable for debugging /// to the specified stream. /// - void print(raw_ostream &OS, SlotIndexes* = nullptr) const; + void print(raw_ostream &OS, const SlotIndexes* = nullptr) const; /// viewCFG - This function is meant for use from the debugger. You can just /// say 'call F->viewCFG()' and a ghostview window should pop up from the diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index 58e71bbe2e2..3350213da58 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -230,7 +230,8 @@ std::string MachineBasicBlock::getFullName() const { return Name; } -void MachineBasicBlock::print(raw_ostream &OS, SlotIndexes *Indexes) const { +void MachineBasicBlock::print(raw_ostream &OS, const SlotIndexes *Indexes) + const { const MachineFunction *MF = getParent(); if (!MF) { OS << "Can't print out MachineBasicBlock because parent MachineFunction" @@ -244,7 +245,7 @@ void MachineBasicBlock::print(raw_ostream &OS, SlotIndexes *Indexes) const { } void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, - SlotIndexes *Indexes) const { + const SlotIndexes *Indexes) const { const MachineFunction *MF = getParent(); if (!MF) { OS << "Can't print out MachineBasicBlock because parent MachineFunction" diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 641ec74fc99..7e9a25a5583 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -406,7 +406,7 @@ StringRef MachineFunction::getName() const { return getFunction()->getName(); } -void MachineFunction::print(raw_ostream &OS, SlotIndexes *Indexes) const { +void MachineFunction::print(raw_ostream &OS, const SlotIndexes *Indexes) const { OS << "# Machine code for function " << getName() << ": "; OS << "Properties: <"; getProperties().print(OS);