[llvm] [MC] Fix MCLFI coding style. NFC (PR #228301)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 18:53:15 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-mc

Author: Fangrui Song (MaskRay)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/228301.diff


1 Files Affected:

- (modified) llvm/lib/MC/MCLFI.cpp (+10-13) 


``````````diff
diff --git a/llvm/lib/MC/MCLFI.cpp b/llvm/lib/MC/MCLFI.cpp
index baa9e04bf808e..0a54af921b37a 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,15 +52,14 @@ 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());
-
   if (TheTriple.getArch() == Triple::x86_64)
     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 +95,3 @@ void emitLFINoteSection(MCStreamer &Streamer, MCContext &Ctx) {
   Streamer.emitIntValue(0, 1); // NUL terminator
   Streamer.emitValueToAlignment(Align(4));
 }
-
-} // namespace llvm

``````````

</details>


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


More information about the llvm-commits mailing list