diff --git a/llvm/include/llvm/MC/MCFragment.h b/llvm/include/llvm/MC/MCFragment.h index 84f8e060320a1b..bfd349e8b8e7ee 100644 --- a/llvm/include/llvm/MC/MCFragment.h +++ b/llvm/include/llvm/MC/MCFragment.h @@ -69,8 +69,15 @@ class MCFragment { FragmentType Kind; protected: + /// Used by subclasses for better packing. + /// + /// MCEncodedFragment bool HasInstructions : 1; + bool AlignToBundleEnd : 1; + /// MCDataFragment bool LinkerRelaxable : 1; + /// MCRelaxableFragment: x86-specific + bool AllowAutoPadding : 1; MCFragment(FragmentType Kind, bool HasInstructions); @@ -115,9 +122,6 @@ class MCDummyFragment : public MCFragment { /// data. /// class MCEncodedFragment : public MCFragment { - /// Should this fragment be aligned to the end of a bundle? - bool AlignToBundleEnd = false; - uint8_t BundlePadding = 0; protected: @@ -228,11 +232,8 @@ class MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> { /// relaxed during the assembler layout and relaxation stage. /// class MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> { - /// The instruction this is a fragment for. MCInst Inst; - /// Can we auto pad the instruction? - bool AllowAutoPadding = false; public: MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI) diff --git a/llvm/lib/MC/MCFragment.cpp b/llvm/lib/MC/MCFragment.cpp index 3086730b1be8ab..ac1b5a8fb8274b 100644 --- a/llvm/lib/MC/MCFragment.cpp +++ b/llvm/lib/MC/MCFragment.cpp @@ -27,7 +27,8 @@ using namespace llvm; MCFragment::MCFragment(FragmentType Kind, bool HasInstructions) - : Kind(Kind), HasInstructions(HasInstructions), LinkerRelaxable(false) {} + : Kind(Kind), HasInstructions(HasInstructions), AlignToBundleEnd(false), + LinkerRelaxable(false), AllowAutoPadding(false) {} void MCFragment::destroy() { switch (Kind) {