[PATCH] D126916: [BOLT][NFC] Pass Function to BC.printInstructions in BinaryBasicBlock::dump

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 2 13:36:44 PDT 2022


Amir created this revision.
Herald added a reviewer: rafauler.
Herald added a subscriber: ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

BC::printInstruction(s) has many uses of Function ptr if it's available:

1. printing CFI instructions (unconditional)
2. printing debug line information (-print-debug-info)
3. printing instruction relocations (-print-relocations)

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126916

Files:
  bolt/lib/Core/BinaryBasicBlock.cpp


Index: bolt/lib/Core/BinaryBasicBlock.cpp
===================================================================
--- bolt/lib/Core/BinaryBasicBlock.cpp
+++ bolt/lib/Core/BinaryBasicBlock.cpp
@@ -563,7 +563,7 @@
   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();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126916.433866.patch
Type: text/x-patch
Size: 549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220602/643d5af0/attachment.bin>


More information about the llvm-commits mailing list