Skip to content

Commit e034a43

Browse files
committed
[MC] Reduce size of MCDataFragment by 8 bytes
Due to alignment, MCFragment was 1 byte over the 8 byte boundary, so folding to bools into bitfields gives a nice space reduction.
1 parent b446f90 commit e034a43

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/include/llvm/MC/MCFragment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class MCFragment {
7272
FragmentType Kind;
7373

7474
protected:
75-
bool HasInstructions;
76-
bool LinkerRelaxable = false;
75+
bool HasInstructions : 1;
76+
bool LinkerRelaxable : 1;
7777

7878
MCFragment(FragmentType Kind, bool HasInstructions,
7979
MCSection *Parent = nullptr);

llvm/lib/MC/MCFragment.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ uint64_t llvm::computeBundlePadding(const MCAssembler &Assembler,
199199

200200
MCFragment::MCFragment(FragmentType Kind, bool HasInstructions,
201201
MCSection *Parent)
202-
: Parent(Parent), Kind(Kind), HasInstructions(HasInstructions) {
202+
: Parent(Parent), Kind(Kind), HasInstructions(HasInstructions),
203+
LinkerRelaxable(false) {
203204
if (Parent && !isa<MCDummyFragment>(*this))
204205
Parent->addFragment(*this);
205206
}

0 commit comments

Comments
 (0)