[llvm] [LFI][NFC] Style cleanup for MCLFI (PR #228304)

Zachary Yedidia via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 18:59:27 PDT 2026


https://github.com/zyedidia created https://github.com/llvm/llvm-project/pull/228304

Follow-up to address review comments on #214111.

>From a34a98e0b6356230f10df7e88a1f454a2d4e7afe Mon Sep 17 00:00:00 2001
From: Zachary Yedidia <zyedidia at gmail.com>
Date: Thu, 1 Oct 2026 18:55:33 -0700
Subject: [PATCH] [LFI][NFC] Style cleanup for MCLFI

---
 llvm/lib/MC/MCLFI.cpp | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/llvm/lib/MC/MCLFI.cpp b/llvm/lib/MC/MCLFI.cpp
index baa9e04bf808e..ddc2ad9338523 100644
--- a/llvm/lib/MC/MCLFI.cpp
+++ b/llvm/lib/MC/MCLFI.cpp
@@ -24,18 +24,18 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/TargetParser/Triple.h"
 
-static const char NoteNamespace[] = "LFI";
+using namespace llvm;
 
-static constexpr unsigned X86BundleSize = 32;
+const char NoteNamespace[] = "LFI";
 
-namespace llvm {
+constexpr unsigned X86BundleSize = 32;
 
-cl::opt<bool> FlagEnableRewriting("lfi-enable-rewriter",
-                                  cl::desc("Enable rewriting for LFI."),
-                                  cl::init(true), cl::Hidden);
+static cl::opt<bool> FlagEnableRewriting("lfi-enable-rewriter",
+                                         cl::desc("Enable rewriting for LFI."),
+                                         cl::init(true), cl::Hidden);
 
-void initializeLFIMCStreamer(MCStreamer &Streamer, MCContext &Ctx,
-                             const Triple &TheTriple) {
+void llvm::initializeLFIMCStreamer(MCStreamer &Streamer, MCContext &Ctx,
+                                   const Triple &TheTriple) {
   assert(TheTriple.isLFI());
 
   std::string Error;
@@ -52,7 +52,7 @@ void initializeLFIMCStreamer(MCStreamer &Streamer, MCContext &Ctx,
   }
 }
 
-void emitLFIBundleAlign(MCStreamer &Streamer, MCContext &Ctx) {
+void llvm::emitLFIBundleAlign(MCStreamer &Streamer, MCContext &Ctx) {
   const Triple &TheTriple = Ctx.getTargetTriple();
   assert(TheTriple.isLFI());
 
@@ -60,7 +60,7 @@ void emitLFIBundleAlign(MCStreamer &Streamer, MCContext &Ctx) {
     Streamer.emitBundleAlignMode(Align(X86BundleSize));
 }
 
-void emitLFINoteSection(MCStreamer &Streamer, MCContext &Ctx) {
+void llvm::emitLFINoteSection(MCStreamer &Streamer, MCContext &Ctx) {
   const Triple &TheTriple = Ctx.getTargetTriple();
   assert(TheTriple.isLFI());
 
@@ -96,5 +96,3 @@ void emitLFINoteSection(MCStreamer &Streamer, MCContext &Ctx) {
   Streamer.emitIntValue(0, 1); // NUL terminator
   Streamer.emitValueToAlignment(Align(4));
 }
-
-} // namespace llvm



More information about the llvm-commits mailing list