void dump() const;
- virtual void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+ virtual void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const = 0;
/// Return true if a .align directive should use "optimized nops" to fill
/// instead of 0s.
- virtual bool UseCodeAlign() const = 0;
+ virtual bool useCodeAlign() const = 0;
/// Check whether this section is "virtual", that is has no actual object
/// file contents.
public:
/// Decides whether a '.section' directive should be printed before the
/// section name
- bool ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
+ bool shouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
unsigned getCharacteristics() const { return Characteristics; }
MCSymbol *getCOMDATSymbol() const { return COMDATSymbol; }
void setSelection(int Selection) const;
- void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+ void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const override;
- bool UseCodeAlign() const override;
+ bool useCodeAlign() const override;
bool isVirtualSection() const override;
StringRef getVirtualSectionKind() const override;
public:
/// Decides whether a '.section' directive should be printed before the
/// section name
- bool ShouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
+ bool shouldOmitSectionDirective(StringRef Name, const MCAsmInfo &MAI) const;
unsigned getType() const { return Type; }
unsigned getFlags() const { return Flags; }
const MCSymbolELF *getGroup() const { return Group.getPointer(); }
bool isComdat() const { return Group.getInt(); }
- void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+ void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const override;
- bool UseCodeAlign() const override;
+ bool useCodeAlign() const override;
bool isVirtualSection() const override;
StringRef getVirtualSectionKind() const override;
: MCSection(SV_GOFF, Name, K, nullptr) {}
public:
- void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+ void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const override {
OS << "\t.section\t\"" << getName() << "\"\n";
}
- bool UseCodeAlign() const override { return false; }
+ bool useCodeAlign() const override { return false; }
bool isVirtualSection() const override { return false; }
bool &TAAParsed, // Out.
unsigned &StubSize); // Out.
- void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+ void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const override;
- bool UseCodeAlign() const override;
+ bool useCodeAlign() const override;
bool isVirtualSection() const override;
static bool classof(const MCSection *S) {
const MCSymbolWasm *getGroup() const { return Group; }
unsigned getSegmentFlags() const { return SegmentFlags; }
- void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+ void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const override;
- bool UseCodeAlign() const override;
+ bool useCodeAlign() const override;
bool isVirtualSection() const override;
bool isWasmData() const {
}
MCSymbolXCOFF *getQualNameSymbol() const { return QualName; }
- void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+ void printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const override;
- bool UseCodeAlign() const override;
+ bool useCodeAlign() const override;
bool isVirtualSection() const override;
StringRef getSymbolTableName() const { return SymbolTableName; }
bool isMultiSymbolsAllowed() const { return MultiSymbolsAllowed; }
if (MCTargetStreamer *TS = getTargetStreamer()) {
TS->changeSection(getCurrentSectionOnly(), Section, Subsection, OS);
} else {
- Section->PrintSwitchToSection(*MAI, getContext().getTargetTriple(), OS,
+ Section->printSwitchToSection(*MAI, getContext().getTargetTriple(), OS,
Subsection);
}
}
// Insert extra Nops for code alignment if the target define
// shouldInsertExtraNopBytesForCodeAlign target hook.
- if (AF.getParent()->UseCodeAlign() && AF.hasEmitNops() &&
+ if (AF.getParent()->useCodeAlign() && AF.hasEmitNops() &&
getBackend().shouldInsertExtraNopBytesForCodeAlign(AF, Size))
return Size;
MCAlignFragment &AF = cast<MCAlignFragment>(Frag);
// Insert fixup type for code alignment if the target define
// shouldInsertFixupForCodeAlign target hook.
- if (Sec.UseCodeAlign() && AF.hasEmitNops())
+ if (Sec.useCodeAlign() && AF.hasEmitNops())
getBackend().shouldInsertFixupForCodeAlign(*this, Layout, AF);
continue;
}
// directive.
const MCSection *Section = getStreamer().getCurrentSectionOnly();
assert(Section && "must have section to emit alignment");
- bool UseCodeAlign = Section->UseCodeAlign();
+ bool useCodeAlign = Section->useCodeAlign();
if ((!HasFillExpr || Lexer.getMAI().getTextAlignFillValue() == FillExpr) &&
- ValueSize == 1 && UseCodeAlign) {
+ ValueSize == 1 && useCodeAlign) {
getStreamer().emitCodeAlignment(Alignment, &getTargetParser().getSTI(),
MaxBytesToFill);
} else {
// directive.
const MCSection *Section = getStreamer().getCurrentSectionOnly();
assert(Section && "must have section to emit alignment");
- if (Section->UseCodeAlign()) {
+ if (Section->useCodeAlign()) {
getStreamer().emitCodeAlignment(Alignment, &getTargetParser().getSTI(),
/*MaxBytesToEmit=*/0);
} else {
using namespace llvm;
-// ShouldOmitSectionDirective - Decides whether a '.section' directive
+// shouldOmitSectionDirective - Decides whether a '.section' directive
// should be printed before the section name
-bool MCSectionCOFF::ShouldOmitSectionDirective(StringRef Name,
+bool MCSectionCOFF::shouldOmitSectionDirective(StringRef Name,
const MCAsmInfo &MAI) const {
if (COMDATSymbol)
return false;
Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
}
-void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+void MCSectionCOFF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const {
// standard sections don't require the '.section'
- if (ShouldOmitSectionDirective(getName(), MAI)) {
+ if (shouldOmitSectionDirective(getName(), MAI)) {
OS << '\t' << getName() << '\n';
return;
}
OS << '\n';
}
-bool MCSectionCOFF::UseCodeAlign() const {
- return getKind().isText();
-}
+bool MCSectionCOFF::useCodeAlign() const { return getKind().isText(); }
bool MCSectionCOFF::isVirtualSection() const {
return getCharacteristics() & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA;
// Decides whether a '.section' directive
// should be printed before the section name.
-bool MCSectionELF::ShouldOmitSectionDirective(StringRef Name,
+bool MCSectionELF::shouldOmitSectionDirective(StringRef Name,
const MCAsmInfo &MAI) const {
if (isUnique())
return false;
OS << '"';
}
-void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+void MCSectionELF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const {
- if (ShouldOmitSectionDirective(getName(), MAI)) {
+ if (shouldOmitSectionDirective(getName(), MAI)) {
OS << '\t' << getName();
if (Subsection) {
OS << '\t';
}
}
-bool MCSectionELF::UseCodeAlign() const {
+bool MCSectionELF::useCodeAlign() const {
return getFlags() & ELF::SHF_EXECINSTR;
}
}
}
-void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+void MCSectionMachO::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const {
OS << "\t.section\t" << getSegmentName() << ',' << getName();
OS << '\n';
}
-bool MCSectionMachO::UseCodeAlign() const {
+bool MCSectionMachO::useCodeAlign() const {
return hasAttribute(MachO::S_ATTR_PURE_INSTRUCTIONS);
}
OS << '"';
}
-void MCSectionWasm::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+void MCSectionWasm::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const {
}
}
-bool MCSectionWasm::UseCodeAlign() const { return false; }
+bool MCSectionWasm::useCodeAlign() const { return false; }
bool MCSectionWasm::isVirtualSection() const { return false; }
<< '\n';
}
-void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
+void MCSectionXCOFF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
raw_ostream &OS,
const MCExpr *Subsection) const {
if (getKind().isText()) {
report_fatal_error("Printing for this SectionKind is unimplemented.");
}
-bool MCSectionXCOFF::UseCodeAlign() const { return getKind().isText(); }
+bool MCSectionXCOFF::useCodeAlign() const { return getKind().isText(); }
bool MCSectionXCOFF::isVirtualSection() const {
// DWARF sections are always not virtual.
MCSection *Section,
const MCExpr *Subsection,
raw_ostream &OS) {
- Section->PrintSwitchToSection(*Streamer.getContext().getAsmInfo(),
+ Section->printSwitchToSection(*Streamer.getContext().getAsmInfo(),
Streamer.getContext().getTargetTriple(), OS,
Subsection);
}
}
assert(Section && "must have section to emit alignment");
- if (Section->UseCodeAlign())
+ if (Section->useCodeAlign())
getStreamer().emitCodeAlignment(2, &getSTI());
else
getStreamer().emitValueToAlignment(2);
// '.align' is target specifically handled to mean 2**2 byte alignment.
const MCSection *Section = getStreamer().getCurrentSectionOnly();
assert(Section && "must have section to emit alignment");
- if (Section->UseCodeAlign())
+ if (Section->useCodeAlign())
getStreamer().emitCodeAlignment(4, &getSTI(), 0);
else
getStreamer().emitValueToAlignment(4, 0, 1, 0);
unsigned Alignment = Section.getAlignment();
if (Alignment) {
OS.SwitchSection(&Section);
- if (Section.UseCodeAlign())
+ if (Section.useCodeAlign())
OS.emitCodeAlignment(Alignment, &STI, Alignment);
else
OS.emitValueToAlignment(Alignment, 0, 1, Alignment);
// Emit DWARF .file directives in the outermost scope.
outputDwarfFileDirectives();
OS << "\t.section";
- Section->PrintSwitchToSection(*getStreamer().getContext().getAsmInfo(),
+ Section->printSwitchToSection(*getStreamer().getContext().getAsmInfo(),
getStreamer().getContext().getTargetTriple(),
OS, SubSection);
// DWARF sections are enclosed into braces - emit the open one.
getStreamer().initSections(false, getSTI());
Section = getStreamer().getCurrentSectionOnly();
}
- if (Section->UseCodeAlign())
+ if (Section->useCodeAlign())
getStreamer().emitCodeAlignment(2, &getSTI(), 0);
else
getStreamer().emitValueToAlignment(2, 0, 1, 0);