@@ -72,8 +72,7 @@ class MCFragment {
72
72
bool HasInstructions : 1 ;
73
73
bool LinkerRelaxable : 1 ;
74
74
75
- MCFragment (FragmentType Kind, bool HasInstructions,
76
- MCSection *Parent = nullptr );
75
+ MCFragment (FragmentType Kind, bool HasInstructions);
77
76
78
77
public:
79
78
MCFragment () = delete ;
@@ -122,9 +121,8 @@ class MCEncodedFragment : public MCFragment {
122
121
uint8_t BundlePadding = 0 ;
123
122
124
123
protected:
125
- MCEncodedFragment (MCFragment::FragmentType FType, bool HasInstructions,
126
- MCSection *Sec)
127
- : MCFragment(FType, HasInstructions, Sec) {}
124
+ MCEncodedFragment (MCFragment::FragmentType FType, bool HasInstructions)
125
+ : MCFragment(FType, HasInstructions) {}
128
126
129
127
// / The MCSubtargetInfo in effect when the instruction was encoded.
130
128
// / It must be non-null for instructions.
@@ -182,9 +180,8 @@ class MCEncodedFragmentWithContents : public MCEncodedFragment {
182
180
183
181
protected:
184
182
MCEncodedFragmentWithContents (MCFragment::FragmentType FType,
185
- bool HasInstructions,
186
- MCSection *Sec)
187
- : MCEncodedFragment(FType, HasInstructions, Sec) {}
183
+ bool HasInstructions)
184
+ : MCEncodedFragment(FType, HasInstructions) {}
188
185
189
186
public:
190
187
SmallVectorImpl<char > &getContents () { return Contents; }
@@ -203,10 +200,8 @@ class MCEncodedFragmentWithFixups :
203
200
204
201
protected:
205
202
MCEncodedFragmentWithFixups (MCFragment::FragmentType FType,
206
- bool HasInstructions,
207
- MCSection *Sec)
208
- : MCEncodedFragmentWithContents<ContentsSize>(FType, HasInstructions,
209
- Sec) {}
203
+ bool HasInstructions)
204
+ : MCEncodedFragmentWithContents<ContentsSize>(FType, HasInstructions) {}
210
205
211
206
public:
212
207
@@ -234,8 +229,7 @@ class MCEncodedFragmentWithFixups :
234
229
// /
235
230
class MCDataFragment : public MCEncodedFragmentWithFixups <32 , 4 > {
236
231
public:
237
- MCDataFragment (MCSection *Sec = nullptr )
238
- : MCEncodedFragmentWithFixups<32 , 4 >(FT_Data, false , Sec) {}
232
+ MCDataFragment () : MCEncodedFragmentWithFixups<32 , 4 >(FT_Data, false ) {}
239
233
240
234
static bool classof (const MCFragment *F) {
241
235
return F->getKind () == MCFragment::FT_Data;
@@ -252,9 +246,8 @@ class MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> {
252
246
// /
253
247
class MCCompactEncodedInstFragment : public MCEncodedFragmentWithContents <4 > {
254
248
public:
255
- MCCompactEncodedInstFragment (MCSection *Sec = nullptr )
256
- : MCEncodedFragmentWithContents(FT_CompactEncodedInst, true , Sec) {
257
- }
249
+ MCCompactEncodedInstFragment ()
250
+ : MCEncodedFragmentWithContents(FT_CompactEncodedInst, true ) {}
258
251
259
252
static bool classof (const MCFragment *F) {
260
253
return F->getKind () == MCFragment::FT_CompactEncodedInst;
@@ -272,10 +265,10 @@ class MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> {
272
265
bool AllowAutoPadding = false ;
273
266
274
267
public:
275
- MCRelaxableFragment (const MCInst &Inst, const MCSubtargetInfo &STI,
276
- MCSection *Sec = nullptr )
277
- : MCEncodedFragmentWithFixups(FT_Relaxable, true , Sec),
278
- Inst (Inst) { this -> STI = &STI; }
268
+ MCRelaxableFragment (const MCInst &Inst, const MCSubtargetInfo &STI)
269
+ : MCEncodedFragmentWithFixups(FT_Relaxable, true ), Inst(Inst) {
270
+ this -> STI = &STI;
271
+ }
279
272
280
273
const MCInst &getInst () const { return Inst; }
281
274
void setInst (const MCInst &Value) { Inst = Value; }
@@ -312,8 +305,8 @@ class MCAlignFragment : public MCFragment {
312
305
313
306
public:
314
307
MCAlignFragment (Align Alignment, int64_t Value, unsigned ValueSize,
315
- unsigned MaxBytesToEmit, MCSection *Sec = nullptr )
316
- : MCFragment(FT_Align, false , Sec ), Alignment(Alignment), EmitNops(false ),
308
+ unsigned MaxBytesToEmit)
309
+ : MCFragment(FT_Align, false ), Alignment(Alignment), EmitNops(false ),
317
310
Value (Value), ValueSize(ValueSize), MaxBytesToEmit(MaxBytesToEmit) {}
318
311
319
312
Align getAlignment () const { return Alignment; }
@@ -349,8 +342,8 @@ class MCFillFragment : public MCFragment {
349
342
350
343
public:
351
344
MCFillFragment (uint64_t Value, uint8_t VSize, const MCExpr &NumValues,
352
- SMLoc Loc, MCSection *Sec = nullptr )
353
- : MCFragment(FT_Fill, false , Sec ), ValueSize(VSize), Value(Value),
345
+ SMLoc Loc)
346
+ : MCFragment(FT_Fill, false ), ValueSize(VSize), Value(Value),
354
347
NumValues (NumValues), Loc(Loc) {}
355
348
356
349
uint64_t getValue () const { return Value; }
@@ -378,8 +371,8 @@ class MCNopsFragment : public MCFragment {
378
371
379
372
public:
380
373
MCNopsFragment (int64_t NumBytes, int64_t ControlledNopLength, SMLoc L,
381
- const MCSubtargetInfo &STI, MCSection *Sec = nullptr )
382
- : MCFragment(FT_Nops, false , Sec ), Size(NumBytes),
374
+ const MCSubtargetInfo &STI)
375
+ : MCFragment(FT_Nops, false ), Size(NumBytes),
383
376
ControlledNopLength (ControlledNopLength), Loc(L), STI(STI) {}
384
377
385
378
int64_t getNumBytes () const { return Size; }
@@ -405,10 +398,8 @@ class MCOrgFragment : public MCFragment {
405
398
SMLoc Loc;
406
399
407
400
public:
408
- MCOrgFragment (const MCExpr &Offset, int8_t Value, SMLoc Loc,
409
- MCSection *Sec = nullptr )
410
- : MCFragment(FT_Org, false , Sec), Value(Value), Offset(&Offset),
411
- Loc (Loc) {}
401
+ MCOrgFragment (const MCExpr &Offset, int8_t Value, SMLoc Loc)
402
+ : MCFragment(FT_Org, false ), Value(Value), Offset(&Offset), Loc(Loc) {}
412
403
413
404
const MCExpr &getOffset () const { return *Offset; }
414
405
@@ -429,9 +420,9 @@ class MCLEBFragment final : public MCEncodedFragmentWithFixups<8, 0> {
429
420
const MCExpr *Value;
430
421
431
422
public:
432
- MCLEBFragment (const MCExpr &Value, bool IsSigned, MCSection *Sec = nullptr )
433
- : MCEncodedFragmentWithFixups<8 , 0 >(FT_LEB, false , Sec ),
434
- IsSigned (IsSigned), Value(&Value) {
423
+ MCLEBFragment (const MCExpr &Value, bool IsSigned)
424
+ : MCEncodedFragmentWithFixups<8 , 0 >(FT_LEB, false ), IsSigned(IsSigned ),
425
+ Value (&Value) {
435
426
getContents ().push_back (0 );
436
427
}
437
428
@@ -457,9 +448,8 @@ class MCDwarfLineAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {
457
448
const MCExpr *AddrDelta;
458
449
459
450
public:
460
- MCDwarfLineAddrFragment (int64_t LineDelta, const MCExpr &AddrDelta,
461
- MCSection *Sec = nullptr )
462
- : MCEncodedFragmentWithFixups<8 , 1 >(FT_Dwarf, false , Sec),
451
+ MCDwarfLineAddrFragment (int64_t LineDelta, const MCExpr &AddrDelta)
452
+ : MCEncodedFragmentWithFixups<8 , 1 >(FT_Dwarf, false ),
463
453
LineDelta (LineDelta), AddrDelta(&AddrDelta) {}
464
454
465
455
int64_t getLineDelta () const { return LineDelta; }
@@ -477,8 +467,8 @@ class MCDwarfCallFrameFragment : public MCEncodedFragmentWithFixups<8, 1> {
477
467
const MCExpr *AddrDelta;
478
468
479
469
public:
480
- MCDwarfCallFrameFragment (const MCExpr &AddrDelta, MCSection *Sec = nullptr )
481
- : MCEncodedFragmentWithFixups<8 , 1 >(FT_DwarfFrame, false , Sec ),
470
+ MCDwarfCallFrameFragment (const MCExpr &AddrDelta)
471
+ : MCEncodedFragmentWithFixups<8 , 1 >(FT_DwarfFrame, false ),
482
472
AddrDelta (&AddrDelta) {}
483
473
484
474
const MCExpr &getAddrDelta () const { return *AddrDelta; }
@@ -494,8 +484,8 @@ class MCSymbolIdFragment : public MCFragment {
494
484
const MCSymbol *Sym;
495
485
496
486
public:
497
- MCSymbolIdFragment (const MCSymbol *Sym, MCSection *Sec = nullptr )
498
- : MCFragment(FT_SymbolId, false , Sec ), Sym(Sym) {}
487
+ MCSymbolIdFragment (const MCSymbol *Sym)
488
+ : MCFragment(FT_SymbolId, false ), Sym(Sym) {}
499
489
500
490
const MCSymbol *getSymbol () { return Sym; }
501
491
const MCSymbol *getSymbol () const { return Sym; }
@@ -522,9 +512,8 @@ class MCCVInlineLineTableFragment : public MCFragment {
522
512
public:
523
513
MCCVInlineLineTableFragment (unsigned SiteFuncId, unsigned StartFileId,
524
514
unsigned StartLineNum, const MCSymbol *FnStartSym,
525
- const MCSymbol *FnEndSym,
526
- MCSection *Sec = nullptr )
527
- : MCFragment(FT_CVInlineLines, false , Sec), SiteFuncId(SiteFuncId),
515
+ const MCSymbol *FnEndSym)
516
+ : MCFragment(FT_CVInlineLines, false ), SiteFuncId(SiteFuncId),
528
517
StartFileId (StartFileId), StartLineNum(StartLineNum),
529
518
FnStartSym(FnStartSym), FnEndSym(FnEndSym) {}
530
519
@@ -551,8 +540,8 @@ class MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {
551
540
public:
552
541
MCCVDefRangeFragment (
553
542
ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
554
- StringRef FixedSizePortion, MCSection *Sec = nullptr )
555
- : MCEncodedFragmentWithFixups<32 , 4 >(FT_CVDefRange, false , Sec ),
543
+ StringRef FixedSizePortion)
544
+ : MCEncodedFragmentWithFixups<32 , 4 >(FT_CVDefRange, false ),
556
545
Ranges (Ranges.begin(), Ranges.end()),
557
546
FixedSizePortion (FixedSizePortion) {}
558
547
@@ -583,9 +572,8 @@ class MCBoundaryAlignFragment : public MCFragment {
583
572
const MCSubtargetInfo &STI;
584
573
585
574
public:
586
- MCBoundaryAlignFragment (Align AlignBoundary, const MCSubtargetInfo &STI,
587
- MCSection *Sec = nullptr )
588
- : MCFragment(FT_BoundaryAlign, false , Sec), AlignBoundary(AlignBoundary),
575
+ MCBoundaryAlignFragment (Align AlignBoundary, const MCSubtargetInfo &STI)
576
+ : MCFragment(FT_BoundaryAlign, false ), AlignBoundary(AlignBoundary),
589
577
STI (STI) {}
590
578
591
579
uint64_t getSize () const { return Size; }
@@ -613,8 +601,8 @@ class MCPseudoProbeAddrFragment : public MCEncodedFragmentWithFixups<8, 1> {
613
601
const MCExpr *AddrDelta;
614
602
615
603
public:
616
- MCPseudoProbeAddrFragment (const MCExpr *AddrDelta, MCSection *Sec = nullptr )
617
- : MCEncodedFragmentWithFixups<8 , 1 >(FT_PseudoProbe, false , Sec ),
604
+ MCPseudoProbeAddrFragment (const MCExpr *AddrDelta)
605
+ : MCEncodedFragmentWithFixups<8 , 1 >(FT_PseudoProbe, false ),
618
606
AddrDelta (AddrDelta) {}
619
607
620
608
const MCExpr &getAddrDelta () const { return *AddrDelta; }
0 commit comments