[clang] [llvm] [LFI] Add MCLFIRewriter infrastructure (PR #172906)

Zachary Yedidia via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 22 19:29:47 PDT 2026


================
@@ -237,6 +238,11 @@ class Target {
       mca::InstrumentManager *(*)(const MCSubtargetInfo &STI,
                                   const MCInstrInfo &MCII);
 
+  using MCLFIRewriterCtorTy =
+      MCLFIRewriter *(*)(MCStreamer & S,
----------------
zyedidia wrote:

I believe this should remain a raw pointer, consistent with other constructor types. The `unique_ptr` should be created by the caller, allowing `TargetRegistry.h` to avoid including many headers (like `MCLFIRewriter.h`) which could affect compile times.

That formatting was strangely required by clang-format (see the earliest revision of the bot's comment: https://github.com/llvm/llvm-project/pull/172906#issuecomment-3672231791). As I make the change outlined in the above comment, I'll see if I can have it accept a better format.

https://github.com/llvm/llvm-project/pull/172906


More information about the cfe-commits mailing list