[llvm] cd39eae - MC: Merge MCFixupKindInfo.h into MCAsmBackend.h

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 4 23:58:18 PDT 2025


Author: Fangrui Song
Date: 2025-07-04T23:58:13-07:00
New Revision: cd39eaeb376e9ae84cafd433c8367cb47cb545a9

URL: https://github.com/llvm/llvm-project/commit/cd39eaeb376e9ae84cafd433c8367cb47cb545a9
DIFF: https://github.com/llvm/llvm-project/commit/cd39eaeb376e9ae84cafd433c8367cb47cb545a9.diff

LOG: MC: Merge MCFixupKindInfo.h into MCAsmBackend.h

... due to their close relationship. MCFixupKindInfo.h is a very simple
header.

Added: 
    

Modified: 
    llvm/include/llvm/MC/MCAsmBackend.h
    llvm/include/llvm/MC/MCFixupKindInfo.h
    llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCFixups.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MC/MCAsmBackend.h b/llvm/include/llvm/MC/MCAsmBackend.h
index 54e43b89b7b00..2b591032c2985 100644
--- a/llvm/include/llvm/MC/MCAsmBackend.h
+++ b/llvm/include/llvm/MC/MCAsmBackend.h
@@ -39,6 +39,31 @@ class raw_pwrite_stream;
 class StringRef;
 class raw_ostream;
 
+/// Target independent information on a fixup kind.
+struct MCFixupKindInfo {
+  enum FixupKindFlags {
+    /// Should this fixup kind force a 4-byte aligned effective PC value?
+    FKF_IsAlignedDownTo32Bits = (1 << 1),
+
+    /// Should this fixup be evaluated in a target dependent manner?
+    FKF_IsTarget = (1 << 2),
+  };
+
+  /// A target specific name for the fixup kind. The names will be unique for
+  /// distinct kinds on any given target.
+  const char *Name;
+
+  /// The bit offset to write the relocation into.
+  uint8_t TargetOffset;
+
+  /// The number of bits written by this fixup. The bits are assumed to be
+  /// contiguous.
+  uint8_t TargetSize;
+
+  /// Flags describing additional information on this fixup kind.
+  unsigned Flags;
+};
+
 /// Generic interface to target specific assembler backends.
 class LLVM_ABI MCAsmBackend {
 protected: // Can only create subclasses.

diff  --git a/llvm/include/llvm/MC/MCFixupKindInfo.h b/llvm/include/llvm/MC/MCFixupKindInfo.h
index f0e46a48515a6..e69de29bb2d1d 100644
--- a/llvm/include/llvm/MC/MCFixupKindInfo.h
+++ b/llvm/include/llvm/MC/MCFixupKindInfo.h
@@ -1,43 +0,0 @@
-//===-- llvm/MC/MCFixupKindInfo.h - Fixup Descriptors -----------*- C++ -*-===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_MC_MCFIXUPKINDINFO_H
-#define LLVM_MC_MCFIXUPKINDINFO_H
-
-#include <cstdint>
-
-namespace llvm {
-
-/// Target independent information on a fixup kind.
-struct MCFixupKindInfo {
-  enum FixupKindFlags {
-    /// Should this fixup kind force a 4-byte aligned effective PC value?
-    FKF_IsAlignedDownTo32Bits = (1 << 1),
-
-    /// Should this fixup be evaluated in a target dependent manner?
-    FKF_IsTarget = (1 << 2),
-  };
-
-  /// A target specific name for the fixup kind. The names will be unique for
-  /// distinct kinds on any given target.
-  const char *Name;
-
-  /// The bit offset to write the relocation into.
-  uint8_t TargetOffset;
-
-  /// The number of bits written by this fixup. The bits are assumed to be
-  /// contiguous.
-  uint8_t TargetSize;
-
-  /// Flags describing additional information on this fixup kind.
-  unsigned Flags;
-};
-
-} // End llvm namespace
-
-#endif

diff  --git a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCFixups.h b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCFixups.h
index d65936e8b45a4..b495cc5d2b053 100644
--- a/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCFixups.h
+++ b/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCFixups.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCFIXUPS_H
 #define LLVM_LIB_TARGET_SYSTEMZ_MCTARGETDESC_SYSTEMZMCFIXUPS_H
 
+#include "llvm/MC/MCAsmBackend.h"
 #include "llvm/MC/MCFixup.h"
 #include "llvm/MC/MCFixupKindInfo.h"
 


        


More information about the llvm-commits mailing list