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

Alexis Engelke via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 09:15:12 PST 2026


================
@@ -0,0 +1,75 @@
+//===- lib/MC/MCLFI.cpp - LFI-specific MC implementation ------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// This file was written by the LFI and Native Client authors.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/MC/MCLFI.h"
+#include "llvm/BinaryFormat/ELF.h"
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCLFIRewriter.h"
+#include "llvm/MC/MCSectionELF.h"
+#include "llvm/MC/MCStreamer.h"
+#include "llvm/MC/TargetRegistry.h"
+#include "llvm/Support/Alignment.h"
+#include "llvm/TargetParser/Triple.h"
+
+static const char NoteNamespace[] = "LFI";
+
+namespace llvm {
+
+cl::opt<bool> FlagEnableRewriting("lfi-enable-rewriter",
+                                  cl::desc("Don't enable rewriting for LFI."),
----------------
aengelke wrote:

Description inverted? Is this option just for testing?

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


More information about the cfe-commits mailing list