Skip to content

Commit 8742477

Browse files
committed
[MC] Remove the Parent parameter from MCFragment ctor callers. NFC
1 parent 9486c35 commit 8742477

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

llvm/include/llvm/MC/MCFragment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class MCFragment {
107107

108108
class MCDummyFragment : public MCFragment {
109109
public:
110-
explicit MCDummyFragment(MCSection *Sec) : MCFragment(FT_Dummy, false, Sec) {}
110+
explicit MCDummyFragment() : MCFragment(FT_Dummy, false) {}
111111

112112
static bool classof(const MCFragment *F) { return F->getKind() == FT_Dummy; }
113113
};

llvm/lib/MC/MCAssembler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,8 @@ void MCAssembler::layout(MCAsmLayout &Layout) {
829829
Sec->setLayoutOrder(i);
830830

831831
// Chain together fragments from all subsections.
832-
MCDummyFragment Dummy(Sec);
832+
MCDummyFragment Dummy;
833+
Dummy.setParent(Sec);
833834
MCFragment *Tail = &Dummy;
834835
for (auto &[_, List] : Sec->Subsections) {
835836
if (!List.Head)

llvm/lib/MC/MCObjectStreamer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,7 @@ void MCObjectStreamer::emitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
567567
const MCSymbol *Label,
568568
SMLoc Loc) {
569569
const MCExpr *AddrDelta = buildSymbolDiff(*this, Label, LastLabel, Loc);
570-
insert(getContext().allocFragment<MCDwarfCallFrameFragment>(*AddrDelta,
571-
nullptr));
570+
insert(getContext().allocFragment<MCDwarfCallFrameFragment>(*AddrDelta));
572571
}
573572

574573
void MCObjectStreamer::emitCVLocDirective(unsigned FunctionId, unsigned FileNo,

llvm/lib/MC/MCSection.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ using namespace llvm;
2323
MCSection::MCSection(SectionVariant V, StringRef Name, bool IsText,
2424
MCSymbol *Begin)
2525
: Begin(Begin), BundleGroupBeforeFirstInst(false), HasInstructions(false),
26-
HasLayout(false), IsRegistered(false), IsText(IsText),
27-
DummyFragment(this), Name(Name), Variant(V) {
26+
HasLayout(false), IsRegistered(false), IsText(IsText), Name(Name),
27+
Variant(V) {
28+
DummyFragment.setParent(this);
2829
// The initial subsection number is 0. Create a fragment list.
2930
CurFragList = &Subsections.emplace_back(0u, FragList{}).second;
3031
}

llvm/lib/MC/MCSymbol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
using namespace llvm;
2323

2424
// Only the address of this fragment is ever actually used.
25-
static MCDummyFragment SentinelFragment(nullptr);
25+
static MCDummyFragment SentinelFragment;
2626

2727
// Sentinel value for the absolute pseudo fragment.
2828
MCFragment *MCSymbol::AbsolutePseudoFragment = &SentinelFragment;

llvm/lib/MC/MCWinCOFFStreamer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ void MCWinCOFFStreamer::emitCOFFSymbolIndex(MCSymbol const *Symbol) {
212212
getAssembler().registerSection(*Sec);
213213
Sec->ensureMinAlignment(Align(4));
214214

215-
getContext().allocFragment<MCSymbolIdFragment>(Symbol,
216-
getCurrentSectionOnly());
217-
215+
insert(getContext().allocFragment<MCSymbolIdFragment>(Symbol));
218216
getAssembler().registerSymbol(*Symbol);
219217
}
220218

0 commit comments

Comments
 (0)