Skip to content

Commit 4c31b47

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 638d968 commit 4c31b47

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/include/llvm/MC/MCFragment.h

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

7575
protected:
76-
bool HasInstructions;
77-
bool LinkerRelaxable = false;
76+
bool HasInstructions : 1;
77+
bool LinkerRelaxable : 1;
7878

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

llvm/lib/MC/MCFragment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ uint64_t llvm::computeBundlePadding(const MCAssembler &Assembler,
200200
MCFragment::MCFragment(FragmentType Kind, bool HasInstructions,
201201
MCSection *Parent)
202202
: Parent(Parent), Atom(nullptr), Offset(~UINT64_C(0)), LayoutOrder(0),
203-
Kind(Kind), HasInstructions(HasInstructions) {
203+
Kind(Kind), HasInstructions(HasInstructions), LinkerRelaxable(false) {
204204
if (Parent && !isa<MCDummyFragment>(*this))
205205
Parent->addFragment(*this);
206206
}

0 commit comments

Comments
 (0)