[BOLT][NFC] Pass Function to BC.printInstructions in BinaryBasicBlock::dump
authorAmir Ayupov <aaupov@fb.com>
Mon, 13 Jun 2022 21:26:14 +0000 (14:26 -0700)
committerAmir Ayupov <aaupov@fb.com>
Mon, 13 Jun 2022 21:26:51 +0000 (14:26 -0700)
BC::printInstruction(s) has many uses of Function ptr if it's available:
# printing CFI instructions (unconditional)
# printing debug line information (-print-debug-info)
# printing instruction relocations (-print-relocations)

Enable these uses by passing Function ptr from the primary printing entry point:
BinaryBasicBlock::dump.

Reviewed By: maksfb

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

bolt/lib/Core/BinaryBasicBlock.cpp

index 5ff4044..8a20b0a 100644 (file)
@@ -563,7 +563,7 @@ void BinaryBasicBlock::dump() const {
   if (Label)
     outs() << Label->getName() << ":\n";
   BC.printInstructions(outs(), Instructions.begin(), Instructions.end(),
-                       getOffset());
+                       getOffset(), Function);
   outs() << "preds:";
   for (auto itr = pred_begin(); itr != pred_end(); ++itr) {
     outs() << " " << (*itr)->getName();