]> granicus.if.org Git - llvm/commitdiff
MachineFunction: Add a const modifier to print() parameter
authorMatthias Braun <matze@braunis.de>
Thu, 5 May 2016 18:14:43 +0000 (18:14 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 5 May 2016 18:14:43 +0000 (18:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268657 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineBasicBlock.h
include/llvm/CodeGen/MachineFunction.h
lib/CodeGen/MachineBasicBlock.cpp
lib/CodeGen/MachineFunction.cpp

index d0ff0c978bad8978586ad3e55c180c7e0799659e..d5f918eb2bb909b945646405e9f50a8ef6037d3c 100644 (file)
@@ -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;
index 36cf6b50b7be9c54b272f6405a92fd616247e0ef..3e78986cba7033ac3c3d7faf1c7e719c200c6963 100644 (file)
@@ -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
index 58e71bbe2e2ea6d1b2e3382dde002e0134a1215f..3350213da583ac5cca2b62e27dfab9e01c467dc7 100644 (file)
@@ -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"
index 641ec74fc99f2129e532a2270693c869e532644c..7e9a25a5583b4e49aaacb63f12461092073a5275 100644 (file)
@@ -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);