[PATCH] D23465: [PM] BitcodeWriterPass should derive from PassInfoMixin

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 13:51:11 PDT 2016


tejohnson created this revision.
tejohnson added a reviewer: chandlerc.
tejohnson added a subscriber: llvm-commits.

The BitcodeWriterPass was ported a couple years ago, and predates the
PassInfoMixin. Make BitcodeWriterPass from that base class.

Should BitcodeWriterPass be added to the PassRegistry.def file? It seems
like that is only for passes that can be added arbitrarily, e.g. via the
-passes flag to the opt tool. Whereas the bitcode writer is added
specially based on the output type (and requires an output stream and
other parameters). For now I have left it out of the PassRegistry, but
let me know if it should go there.

Finally, I was considering an NFC change of the legacy WriteBitcodePass
to BitcodeWriterLegacyPass to make its usage clearer and more consistent
with other legacy passes. WDYT?

https://reviews.llvm.org/D23465

Files:
  include/llvm/Bitcode/BitcodeWriterPass.h

Index: include/llvm/Bitcode/BitcodeWriterPass.h
===================================================================
--- include/llvm/Bitcode/BitcodeWriterPass.h
+++ include/llvm/Bitcode/BitcodeWriterPass.h
@@ -44,7 +44,7 @@
 ///
 /// Note that this is intended for use with the new pass manager. To construct
 /// a pass for the legacy pass manager, use the function above.
-class BitcodeWriterPass {
+class BitcodeWriterPass : public PassInfoMixin<BitcodeWriterPass> {
   raw_ostream &OS;
   bool ShouldPreserveUseListOrder;
   bool EmitSummaryIndex;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23465.67907.patch
Type: text/x-patch
Size: 552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160812/c7879f3e/attachment.bin>


More information about the llvm-commits mailing list