@@ -376,11 +376,12 @@ class MCContext {
376
376
377
377
public:
378
378
LLVM_ABI explicit MCContext (const Triple &TheTriple, const MCAsmInfo *MAI,
379
- const MCRegisterInfo *MRI, const MCSubtargetInfo *MSTI,
380
- const SourceMgr *Mgr = nullptr ,
381
- MCTargetOptions const *TargetOpts = nullptr ,
382
- bool DoAutoReset = true ,
383
- StringRef Swift5ReflSegmentName = {});
379
+ const MCRegisterInfo *MRI,
380
+ const MCSubtargetInfo *MSTI,
381
+ const SourceMgr *Mgr = nullptr ,
382
+ MCTargetOptions const *TargetOpts = nullptr ,
383
+ bool DoAutoReset = true ,
384
+ StringRef Swift5ReflSegmentName = {});
384
385
MCContext (const MCContext &) = delete ;
385
386
MCContext &operator =(const MCContext &) = delete ;
386
387
LLVM_ABI ~MCContext ();
@@ -448,7 +449,8 @@ class MCContext {
448
449
// / in the symbol table if UseNamesOnTempLabels is false (default except
449
450
// / MCAsmStreamer). The overload without Name uses an unspecified name.
450
451
LLVM_ABI MCSymbol *createTempSymbol ();
451
- LLVM_ABI MCSymbol *createTempSymbol (const Twine &Name, bool AlwaysAddSuffix = true );
452
+ LLVM_ABI MCSymbol *createTempSymbol (const Twine &Name,
453
+ bool AlwaysAddSuffix = true );
452
454
453
455
// / Create a temporary symbol with a unique name whose name cannot be
454
456
// / omitted in the symbol table. This is rarely used.
@@ -459,7 +461,8 @@ class MCContext {
459
461
// / this behaves like createTempSymbol, except that it uses the
460
462
// / PrivateLabelPrefix instead of the PrivateGlobalPrefix. When AlwaysEmit is
461
463
// / true, behaves like getOrCreateSymbol, prefixed with PrivateLabelPrefix.
462
- LLVM_ABI MCSymbol *createBlockSymbol (const Twine &Name, bool AlwaysEmit = false );
464
+ LLVM_ABI MCSymbol *createBlockSymbol (const Twine &Name,
465
+ bool AlwaysEmit = false );
463
466
464
467
// / Create a local, non-temporary symbol like an ELF mapping symbol. Calling
465
468
// / the function with the same name will generate new, unique instances.
@@ -471,7 +474,8 @@ class MCContext {
471
474
472
475
// / Create and return a directional local symbol for numbered label (used
473
476
// / for "1b" or 1f" references).
474
- LLVM_ABI MCSymbol *getDirectionalLocalSymbol (unsigned LocalLabelVal, bool Before);
477
+ LLVM_ABI MCSymbol *getDirectionalLocalSymbol (unsigned LocalLabelVal,
478
+ bool Before);
475
479
476
480
// / Lookup the symbol inside with the specified \p Name. If it exists,
477
481
// / return it. If not, create a forward reference and return it.
@@ -483,7 +487,8 @@ class MCContext {
483
487
// / variable after codegen.
484
488
// /
485
489
// / \param Idx - The index of a local variable passed to \@llvm.localescape.
486
- LLVM_ABI MCSymbol *getOrCreateFrameAllocSymbol (const Twine &FuncName, unsigned Idx);
490
+ LLVM_ABI MCSymbol *getOrCreateFrameAllocSymbol (const Twine &FuncName,
491
+ unsigned Idx);
487
492
488
493
LLVM_ABI MCSymbol *getOrCreateParentFrameOffsetSymbol (const Twine &FuncName);
489
494
@@ -498,7 +503,8 @@ class MCContext {
498
503
LLVM_ABI MCSymbol *cloneSymbol (MCSymbol &Sym);
499
504
500
505
// / Set value for a symbol.
501
- LLVM_ABI void setSymbolValue (MCStreamer &Streamer, const Twine &Sym, uint64_t Val);
506
+ LLVM_ABI void setSymbolValue (MCStreamer &Streamer, const Twine &Sym,
507
+ uint64_t Val);
502
508
503
509
// / getSymbols - Get a reference for the symbol table for clients that
504
510
// / want to, for example, iterate over all symbols. 'const' because we
@@ -528,9 +534,9 @@ class MCContext {
528
534
// / Return the MCSection for the specified mach-o section. This requires
529
535
// / the operands to be valid.
530
536
LLVM_ABI MCSectionMachO *getMachOSection (StringRef Segment, StringRef Section,
531
- unsigned TypeAndAttributes,
532
- unsigned Reserved2, SectionKind K,
533
- const char *BeginSymName = nullptr );
537
+ unsigned TypeAndAttributes,
538
+ unsigned Reserved2, SectionKind K,
539
+ const char *BeginSymName = nullptr );
534
540
535
541
MCSectionMachO *getMachOSection (StringRef Segment, StringRef Section,
536
542
unsigned TypeAndAttributes, SectionKind K,
@@ -558,53 +564,59 @@ class MCContext {
558
564
}
559
565
560
566
LLVM_ABI MCSectionELF *getELFSection (const Twine &Section, unsigned Type,
561
- unsigned Flags, unsigned EntrySize,
562
- const Twine &Group, bool IsComdat,
563
- unsigned UniqueID,
564
- const MCSymbolELF *LinkedToSym);
567
+ unsigned Flags, unsigned EntrySize,
568
+ const Twine &Group, bool IsComdat,
569
+ unsigned UniqueID,
570
+ const MCSymbolELF *LinkedToSym);
565
571
566
572
LLVM_ABI MCSectionELF *getELFSection (const Twine &Section, unsigned Type,
567
- unsigned Flags, unsigned EntrySize,
568
- const MCSymbolELF *Group, bool IsComdat,
569
- unsigned UniqueID,
570
- const MCSymbolELF *LinkedToSym);
573
+ unsigned Flags, unsigned EntrySize,
574
+ const MCSymbolELF *Group, bool IsComdat,
575
+ unsigned UniqueID,
576
+ const MCSymbolELF *LinkedToSym);
571
577
572
578
// / Get a section with the provided group identifier. This section is
573
579
// / named by concatenating \p Prefix with '.' then \p Suffix. The \p Type
574
580
// / describes the type of the section and \p Flags are used to further
575
581
// / configure this named section.
576
- LLVM_ABI MCSectionELF *getELFNamedSection (const Twine &Prefix, const Twine &Suffix,
577
- unsigned Type, unsigned Flags,
578
- unsigned EntrySize = 0 );
582
+ LLVM_ABI MCSectionELF *getELFNamedSection (const Twine &Prefix,
583
+ const Twine &Suffix, unsigned Type,
584
+ unsigned Flags,
585
+ unsigned EntrySize = 0 );
579
586
580
- LLVM_ABI MCSectionELF *createELFRelSection ( const Twine &Name, unsigned Type,
581
- unsigned Flags , unsigned EntrySize ,
582
- const MCSymbolELF *Group,
583
- const MCSectionELF *RelInfoSection);
587
+ LLVM_ABI MCSectionELF *
588
+ createELFRelSection ( const Twine &Name, unsigned Type , unsigned Flags ,
589
+ unsigned EntrySize, const MCSymbolELF *Group,
590
+ const MCSectionELF *RelInfoSection);
584
591
585
- LLVM_ABI MCSectionELF *createELFGroupSection (const MCSymbolELF *Group, bool IsComdat);
592
+ LLVM_ABI MCSectionELF *createELFGroupSection (const MCSymbolELF *Group,
593
+ bool IsComdat);
586
594
587
- LLVM_ABI void recordELFMergeableSectionInfo (StringRef SectionName, unsigned Flags,
588
- unsigned UniqueID, unsigned EntrySize);
595
+ LLVM_ABI void recordELFMergeableSectionInfo (StringRef SectionName,
596
+ unsigned Flags, unsigned UniqueID,
597
+ unsigned EntrySize);
589
598
590
599
LLVM_ABI bool isELFImplicitMergeableSectionNamePrefix (StringRef Name);
591
600
592
601
LLVM_ABI bool isELFGenericMergeableSection (StringRef Name);
593
602
594
603
// / Return the unique ID of the section with the given name, flags and entry
595
604
// / size, if it exists.
596
- LLVM_ABI std::optional<unsigned > getELFUniqueIDForEntsize (StringRef SectionName,
597
- unsigned Flags,
598
- unsigned EntrySize);
605
+ LLVM_ABI std::optional<unsigned >
606
+ getELFUniqueIDForEntsize (StringRef SectionName, unsigned Flags,
607
+ unsigned EntrySize);
599
608
600
609
LLVM_ABI MCSectionGOFF *getGOFFSection (StringRef Section, SectionKind Kind,
601
- MCSection *Parent, uint32_t Subsection = 0 );
610
+ MCSection *Parent,
611
+ uint32_t Subsection = 0 );
602
612
603
- LLVM_ABI MCSectionCOFF *getCOFFSection (StringRef Section, unsigned Characteristics,
604
- StringRef COMDATSymName, int Selection,
605
- unsigned UniqueID = MCSection::NonUniqueID);
613
+ LLVM_ABI MCSectionCOFF *
614
+ getCOFFSection (StringRef Section, unsigned Characteristics,
615
+ StringRef COMDATSymName, int Selection,
616
+ unsigned UniqueID = MCSection::NonUniqueID);
606
617
607
- LLVM_ABI MCSectionCOFF *getCOFFSection (StringRef Section, unsigned Characteristics);
618
+ LLVM_ABI MCSectionCOFF *getCOFFSection (StringRef Section,
619
+ unsigned Characteristics);
608
620
609
621
// / Gets or creates a section equivalent to Sec that is associated with the
610
622
// / section containing KeySym. For example, to create a debug info section
@@ -622,18 +634,20 @@ class MCContext {
622
634
}
623
635
624
636
LLVM_ABI MCSectionWasm *getWasmSection (const Twine &Section, SectionKind K,
625
- unsigned Flags, const Twine &Group,
626
- unsigned UniqueID);
637
+ unsigned Flags, const Twine &Group,
638
+ unsigned UniqueID);
627
639
628
640
LLVM_ABI MCSectionWasm *getWasmSection (const Twine &Section, SectionKind K,
629
- unsigned Flags, const MCSymbolWasm *Group,
630
- unsigned UniqueID);
641
+ unsigned Flags,
642
+ const MCSymbolWasm *Group,
643
+ unsigned UniqueID);
631
644
632
645
// / Get the section for the provided Section name
633
- LLVM_ABI MCSectionDXContainer *getDXContainerSection (StringRef Section, SectionKind K);
646
+ LLVM_ABI MCSectionDXContainer *getDXContainerSection (StringRef Section,
647
+ SectionKind K);
634
648
635
649
LLVM_ABI bool hasXCOFFSection (StringRef Section,
636
- XCOFF::CsectProperties CsectProp) const ;
650
+ XCOFF::CsectProperties CsectProp) const ;
637
651
638
652
LLVM_ABI MCSectionXCOFF *getXCOFFSection (
639
653
StringRef Section, SectionKind K,
@@ -661,7 +675,8 @@ class MCContext {
661
675
void setCompilationDir (StringRef S) { CompilationDir = S.str (); }
662
676
663
677
// / Add an entry to the debug prefix map.
664
- LLVM_ABI void addDebugPrefixMapEntry (const std::string &From, const std::string &To);
678
+ LLVM_ABI void addDebugPrefixMapEntry (const std::string &From,
679
+ const std::string &To);
665
680
666
681
// / Remap one path in-place as per the debug prefix map.
667
682
LLVM_ABI void remapDebugPath (SmallVectorImpl<char > &Path);
@@ -678,11 +693,10 @@ class MCContext {
678
693
void setMainFileName (StringRef S) { MainFileName = std::string (S); }
679
694
680
695
// / Creates an entry in the dwarf file and directory tables.
681
- LLVM_ABI Expected<unsigned > getDwarfFile (StringRef Directory, StringRef FileName,
682
- unsigned FileNumber,
683
- std::optional<MD5::MD5Result> Checksum,
684
- std::optional<StringRef> Source,
685
- unsigned CUID);
696
+ LLVM_ABI Expected<unsigned >
697
+ getDwarfFile (StringRef Directory, StringRef FileName, unsigned FileNumber,
698
+ std::optional<MD5::MD5Result> Checksum,
699
+ std::optional<StringRef> Source, unsigned CUID);
686
700
687
701
LLVM_ABI bool isValidDwarfFileNumber (unsigned FileNumber, unsigned CUID = 0 );
688
702
0 commit comments