[MC] De-capitalize MCStreamer::Emit{Bundle,Addrsig}* etc

So far, all non-COFF-related Emit* functions have been de-capitalized.
This commit is contained in:
Fangrui Song 2020-02-15 08:52:56 -08:00
parent ce2b5f1569
commit 549b436beb
33 changed files with 162 additions and 164 deletions

View File

@ -498,7 +498,7 @@ static bool ExecuteAssembler(AssemblerInvocation &Opts,
MCSection *AsmLabel = Ctx.getMachOSection( MCSection *AsmLabel = Ctx.getMachOSection(
"__LLVM", "__asm", MachO::S_REGULAR, 4, SectionKind::getReadOnly()); "__LLVM", "__asm", MachO::S_REGULAR, 4, SectionKind::getReadOnly());
Str.get()->SwitchSection(AsmLabel); Str.get()->SwitchSection(AsmLabel);
Str.get()->EmitZeros(1); Str.get()->emitZeros(1);
} }
// Assembly to object compilation should leverage assembly info. // Assembly to object compilation should leverage assembly info.

View File

@ -61,12 +61,12 @@ public:
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr, void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, unsigned ByteAlignment = 0, uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc L = SMLoc()) override; SMLoc L = SMLoc()) override;
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment = 0) override; unsigned ByteAlignment = 0) override;
void emitValueImpl(const MCExpr *Value, unsigned Size, void emitValueImpl(const MCExpr *Value, unsigned Size,
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void EmitIdent(StringRef IdentString) override; void emitIdent(StringRef IdentString) override;
void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override; void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;
@ -75,9 +75,9 @@ public:
void FinishImpl() override; void FinishImpl() override;
void EmitBundleAlignMode(unsigned AlignPow2) override; void emitBundleAlignMode(unsigned AlignPow2) override;
void EmitBundleLock(bool AlignToEnd) override; void emitBundleLock(bool AlignToEnd) override;
void EmitBundleUnlock() override; void emitBundleUnlock() override;
private: private:
bool isBundleLocked() const; bool isBundleLocked() const;

View File

@ -129,9 +129,9 @@ public:
/// can change its size during relaxation. /// can change its size during relaxation.
virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &); virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &);
void EmitBundleAlignMode(unsigned AlignPow2) override; void emitBundleAlignMode(unsigned AlignPow2) override;
void EmitBundleLock(bool AlignToEnd) override; void emitBundleLock(bool AlignToEnd) override;
void EmitBundleUnlock() override; void emitBundleUnlock() override;
void emitBytes(StringRef Data) override; void emitBytes(StringRef Data) override;
void emitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0, void emitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
unsigned ValueSize = 1, unsigned ValueSize = 1,
@ -170,7 +170,7 @@ public:
void emitTPRel64Value(const MCExpr *Value) override; void emitTPRel64Value(const MCExpr *Value) override;
void emitGPRel32Value(const MCExpr *Value) override; void emitGPRel32Value(const MCExpr *Value) override;
void emitGPRel64Value(const MCExpr *Value) override; void emitGPRel64Value(const MCExpr *Value) override;
bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, bool emitRelocDirective(const MCExpr &Offset, StringRef Name,
const MCExpr *Expr, SMLoc Loc, const MCExpr *Expr, SMLoc Loc,
const MCSubtargetInfo &STI) override; const MCSubtargetInfo &STI) override;
using MCStreamer::emitFill; using MCStreamer::emitFill;
@ -178,10 +178,10 @@ public:
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void EmitFileDirective(StringRef Filename) override; void emitFileDirective(StringRef Filename) override;
void EmitAddrsig() override; void emitAddrsig() override;
void EmitAddrsigSym(const MCSymbol *Sym) override; void emitAddrsigSym(const MCSymbol *Sym) override;
void FinishImpl() override; void FinishImpl() override;

View File

@ -242,7 +242,7 @@ protected:
virtual void EmitWindowsUnwindTables(); virtual void EmitWindowsUnwindTables();
virtual void EmitRawTextImpl(StringRef String); virtual void emitRawTextImpl(StringRef String);
/// Returns true if the the .cv_loc directive is in the right section. /// Returns true if the the .cv_loc directive is in the right section.
bool checkCVLocSection(unsigned FuncId, unsigned FileNo, SMLoc Loc); bool checkCVLocSection(unsigned FuncId, unsigned FileNo, SMLoc Loc);
@ -562,7 +562,7 @@ public:
/// \param CsectSym - Csect name for the block of storage. /// \param CsectSym - Csect name for the block of storage.
/// \param ByteAlignment - The alignment of the symbol in bytes. Must be a /// \param ByteAlignment - The alignment of the symbol in bytes. Must be a
/// power of 2. /// power of 2.
virtual void EmitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, virtual void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size,
MCSymbol *CsectSym, MCSymbol *CsectSym,
unsigned ByteAlignment); unsigned ByteAlignment);
@ -620,7 +620,7 @@ public:
/// \param Size - The size of the symbol. /// \param Size - The size of the symbol.
/// \param ByteAlignment - The alignment of the thread local common symbol /// \param ByteAlignment - The alignment of the thread local common symbol
/// if non-zero. This must be a power of 2 on some targets. /// if non-zero. This must be a power of 2 on some targets.
virtual void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, virtual void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment = 0); uint64_t Size, unsigned ByteAlignment = 0);
/// @} /// @}
@ -756,7 +756,7 @@ public:
/// Emit NumBytes worth of zeros. /// Emit NumBytes worth of zeros.
/// This function properly handles data in virtual sections. /// This function properly handles data in virtual sections.
void EmitZeros(uint64_t NumBytes); void emitZeros(uint64_t NumBytes);
/// Emit some number of copies of \p Value until the byte alignment \p /// Emit some number of copies of \p Value until the byte alignment \p
/// ByteAlignment is reached. /// ByteAlignment is reached.
@ -813,11 +813,11 @@ public:
/// Switch to a new logical file. This is used to implement the '.file /// Switch to a new logical file. This is used to implement the '.file
/// "foo.c"' assembler directive. /// "foo.c"' assembler directive.
virtual void EmitFileDirective(StringRef Filename); virtual void emitFileDirective(StringRef Filename);
/// Emit the "identifiers" directive. This implements the /// Emit the "identifiers" directive. This implements the
/// '.ident "version foo"' assembler directive. /// '.ident "version foo"' assembler directive.
virtual void EmitIdent(StringRef IdentString) {} virtual void emitIdent(StringRef IdentString) {}
/// Associate a filename with a specified logical file number. This /// Associate a filename with a specified logical file number. This
/// implements the DWARF2 '.file 4 "foo.c"' assembler directive. /// implements the DWARF2 '.file 4 "foo.c"' assembler directive.
@ -995,19 +995,19 @@ public:
/// Get the .xdata section used for the given section. /// Get the .xdata section used for the given section.
MCSection *getAssociatedXDataSection(const MCSection *TextSec); MCSection *getAssociatedXDataSection(const MCSection *TextSec);
virtual void EmitSyntaxDirective(); virtual void emitSyntaxDirective();
/// Emit a .reloc directive. /// Emit a .reloc directive.
/// Returns true if the relocation could not be emitted because Name is not /// Returns true if the relocation could not be emitted because Name is not
/// known. /// known.
virtual bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, virtual bool emitRelocDirective(const MCExpr &Offset, StringRef Name,
const MCExpr *Expr, SMLoc Loc, const MCExpr *Expr, SMLoc Loc,
const MCSubtargetInfo &STI) { const MCSubtargetInfo &STI) {
return true; return true;
} }
virtual void EmitAddrsig() {} virtual void emitAddrsig() {}
virtual void EmitAddrsigSym(const MCSymbol *Sym) {} virtual void emitAddrsigSym(const MCSymbol *Sym) {}
/// Emit the given \p Instruction into the current section. /// Emit the given \p Instruction into the current section.
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI); virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI);
@ -1015,21 +1015,21 @@ public:
/// Set the bundle alignment mode from now on in the section. /// Set the bundle alignment mode from now on in the section.
/// The argument is the power of 2 to which the alignment is set. The /// The argument is the power of 2 to which the alignment is set. The
/// value 0 means turn the bundle alignment off. /// value 0 means turn the bundle alignment off.
virtual void EmitBundleAlignMode(unsigned AlignPow2); virtual void emitBundleAlignMode(unsigned AlignPow2);
/// The following instructions are a bundle-locked group. /// The following instructions are a bundle-locked group.
/// ///
/// \param AlignToEnd - If true, the bundle-locked group will be aligned to /// \param AlignToEnd - If true, the bundle-locked group will be aligned to
/// the end of a bundle. /// the end of a bundle.
virtual void EmitBundleLock(bool AlignToEnd); virtual void emitBundleLock(bool AlignToEnd);
/// Ends a bundle-locked group. /// Ends a bundle-locked group.
virtual void EmitBundleUnlock(); virtual void emitBundleUnlock();
/// If this file is backed by a assembly streamer, this dumps the /// If this file is backed by a assembly streamer, this dumps the
/// specified string in the output .s file. This capability is indicated by /// specified string in the output .s file. This capability is indicated by
/// the hasRawTextSupport() predicate. By default this aborts. /// the hasRawTextSupport() predicate. By default this aborts.
void EmitRawText(const Twine &String); void emitRawText(const Twine &String);
/// Streamer specific finalization. /// Streamer specific finalization.
virtual void FinishImpl(); virtual void FinishImpl();

View File

@ -61,12 +61,12 @@ public:
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr, void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, unsigned ByteAlignment = 0, uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment = 0) override; unsigned ByteAlignment = 0) override;
void emitValueImpl(const MCExpr *Value, unsigned Size, void emitValueImpl(const MCExpr *Value, unsigned Size,
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void EmitIdent(StringRef IdentString) override; void emitIdent(StringRef IdentString) override;
void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override; void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override;

View File

@ -60,9 +60,9 @@ public:
unsigned ByteAlignment) override; unsigned ByteAlignment) override;
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment, SMLoc Loc = SMLoc()) override; unsigned ByteAlignment, SMLoc Loc = SMLoc()) override;
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override; unsigned ByteAlignment) override;
void EmitIdent(StringRef IdentString) override; void emitIdent(StringRef IdentString) override;
void EmitWinEHHandlerData(SMLoc Loc) override; void EmitWinEHHandlerData(SMLoc Loc) override;
void FinishImpl() override; void FinishImpl() override;

View File

@ -26,7 +26,7 @@ public:
uint64_t Size = 0, unsigned ByteAlignment = 0, uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override; void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &) override;
void EmitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size,
MCSymbol *CsectSym, MCSymbol *CsectSym,
unsigned ByteAlign) override; unsigned ByteAlign) override;
}; };

View File

@ -286,7 +286,7 @@ bool AsmPrinter::doInitialization(Module &M) {
// don't, this at least helps the user find where a global came from. // don't, this at least helps the user find where a global came from.
if (MAI->hasSingleParameterDotFile()) { if (MAI->hasSingleParameterDotFile()) {
// .file "foo.c" // .file "foo.c"
OutStreamer->EmitFileDirective( OutStreamer->emitFileDirective(
llvm::sys::path::filename(M.getSourceFileName())); llvm::sys::path::filename(M.getSourceFileName()));
} }
@ -603,7 +603,7 @@ void AsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
if (GVKind.isThreadBSS()) { if (GVKind.isThreadBSS()) {
TheSection = getObjFileLowering().getTLSBSSSection(); TheSection = getObjFileLowering().getTLSBSSSection();
OutStreamer->EmitTBSSSymbol(TheSection, MangSym, Size, Alignment.value()); OutStreamer->emitTBSSSymbol(TheSection, MangSym, Size, Alignment.value());
} else if (GVKind.isThreadData()) { } else if (GVKind.isThreadData()) {
OutStreamer->SwitchSection(TheSection); OutStreamer->SwitchSection(TheSection);
@ -1654,12 +1654,12 @@ bool AsmPrinter::doFinalization(Module &M) {
if (TM.Options.EmitAddrsig) { if (TM.Options.EmitAddrsig) {
// Emit address-significance attributes for all globals. // Emit address-significance attributes for all globals.
OutStreamer->EmitAddrsig(); OutStreamer->emitAddrsig();
for (const GlobalValue &GV : M.global_values()) for (const GlobalValue &GV : M.global_values())
if (!GV.use_empty() && !GV.isThreadLocal() && if (!GV.use_empty() && !GV.isThreadLocal() &&
!GV.hasDLLImportStorageClass() && !GV.getName().startswith("llvm.") && !GV.hasDLLImportStorageClass() && !GV.getName().startswith("llvm.") &&
!GV.hasAtLeastLocalUnnamedAddr()) !GV.hasAtLeastLocalUnnamedAddr())
OutStreamer->EmitAddrsigSym(getSymbol(&GV)); OutStreamer->emitAddrsigSym(getSymbol(&GV));
} }
// Emit symbol partition specifications (ELF only). // Emit symbol partition specifications (ELF only).
@ -1674,7 +1674,7 @@ bool AsmPrinter::doFinalization(Module &M) {
OutContext.getELFSection(".llvm_sympart", ELF::SHT_LLVM_SYMPART, 0, 0, OutContext.getELFSection(".llvm_sympart", ELF::SHT_LLVM_SYMPART, 0, 0,
"", ++UniqueID, nullptr)); "", ++UniqueID, nullptr));
OutStreamer->emitBytes(GV.getPartition()); OutStreamer->emitBytes(GV.getPartition());
OutStreamer->EmitZeros(1); OutStreamer->emitZeros(1);
OutStreamer->emitValue( OutStreamer->emitValue(
MCSymbolRefExpr::create(getSymbol(&GV), OutContext), MCSymbolRefExpr::create(getSymbol(&GV), OutContext),
MAI->getCodePointerSize()); MAI->getCodePointerSize());
@ -1834,7 +1834,7 @@ void AsmPrinter::emitConstantPool() {
// Emit inter-object padding for alignment. // Emit inter-object padding for alignment.
unsigned AlignMask = CPE.getAlignment() - 1; unsigned AlignMask = CPE.getAlignment() - 1;
unsigned NewOffset = (Offset + AlignMask) & ~AlignMask; unsigned NewOffset = (Offset + AlignMask) & ~AlignMask;
OutStreamer->EmitZeros(NewOffset - Offset); OutStreamer->emitZeros(NewOffset - Offset);
Type *Ty = CPE.getType(); Type *Ty = CPE.getType();
Offset = NewOffset + getDataLayout().getTypeAllocSize(Ty); Offset = NewOffset + getDataLayout().getTypeAllocSize(Ty);
@ -2128,7 +2128,7 @@ void AsmPrinter::emitModuleIdents(Module &M) {
assert(N->getNumOperands() == 1 && assert(N->getNumOperands() == 1 &&
"llvm.ident metadata entry can have only one operand"); "llvm.ident metadata entry can have only one operand");
const MDString *S = cast<MDString>(N->getOperand(0)); const MDString *S = cast<MDString>(N->getOperand(0));
OutStreamer->EmitIdent(S->getString()); OutStreamer->emitIdent(S->getString());
} }
} }
} }
@ -2144,14 +2144,14 @@ void AsmPrinter::emitModuleCommandLines(Module &M) {
OutStreamer->PushSection(); OutStreamer->PushSection();
OutStreamer->SwitchSection(CommandLine); OutStreamer->SwitchSection(CommandLine);
OutStreamer->EmitZeros(1); OutStreamer->emitZeros(1);
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
const MDNode *N = NMD->getOperand(i); const MDNode *N = NMD->getOperand(i);
assert(N->getNumOperands() == 1 && assert(N->getNumOperands() == 1 &&
"llvm.commandline metadata entry can have only one operand"); "llvm.commandline metadata entry can have only one operand");
const MDString *S = cast<MDString>(N->getOperand(0)); const MDString *S = cast<MDString>(N->getOperand(0));
OutStreamer->emitBytes(S->getString()); OutStreamer->emitBytes(S->getString());
OutStreamer->EmitZeros(1); OutStreamer->emitZeros(1);
} }
OutStreamer->PopSection(); OutStreamer->PopSection();
} }
@ -2198,7 +2198,7 @@ void AsmPrinter::emitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
if (MAI->needsDwarfSectionOffsetDirective() && IsSectionRelative) { if (MAI->needsDwarfSectionOffsetDirective() && IsSectionRelative) {
OutStreamer->EmitCOFFSecRel32(Label, Offset); OutStreamer->EmitCOFFSecRel32(Label, Offset);
if (Size > 4) if (Size > 4)
OutStreamer->EmitZeros(Size - 4); OutStreamer->emitZeros(Size - 4);
return; return;
} }
@ -2480,7 +2480,7 @@ static void emitGlobalConstantDataSequential(const DataLayout &DL,
CDS->getNumElements(); CDS->getNumElements();
assert(EmittedSize <= Size && "Size cannot be less than EmittedSize!"); assert(EmittedSize <= Size && "Size cannot be less than EmittedSize!");
if (unsigned Padding = Size - EmittedSize) if (unsigned Padding = Size - EmittedSize)
AP.OutStreamer->EmitZeros(Padding); AP.OutStreamer->emitZeros(Padding);
} }
static void emitGlobalConstantArray(const DataLayout &DL, static void emitGlobalConstantArray(const DataLayout &DL,
@ -2511,7 +2511,7 @@ static void emitGlobalConstantVector(const DataLayout &DL,
unsigned EmittedSize = DL.getTypeAllocSize(CV->getType()->getElementType()) * unsigned EmittedSize = DL.getTypeAllocSize(CV->getType()->getElementType()) *
CV->getType()->getNumElements(); CV->getType()->getNumElements();
if (unsigned Padding = Size - EmittedSize) if (unsigned Padding = Size - EmittedSize)
AP.OutStreamer->EmitZeros(Padding); AP.OutStreamer->emitZeros(Padding);
} }
static void emitGlobalConstantStruct(const DataLayout &DL, static void emitGlobalConstantStruct(const DataLayout &DL,
@ -2536,7 +2536,7 @@ static void emitGlobalConstantStruct(const DataLayout &DL,
// Insert padding - this may include padding to increase the size of the // Insert padding - this may include padding to increase the size of the
// current field up to the ABI size (if the struct is not packed) as well // current field up to the ABI size (if the struct is not packed) as well
// as padding to ensure that the next field starts at the right offset. // as padding to ensure that the next field starts at the right offset.
AP.OutStreamer->EmitZeros(PadSize); AP.OutStreamer->emitZeros(PadSize);
} }
assert(SizeSoFar == Layout->getSizeInBytes() && assert(SizeSoFar == Layout->getSizeInBytes() &&
"Layout of constant struct may be incorrect!"); "Layout of constant struct may be incorrect!");
@ -2583,7 +2583,7 @@ static void emitGlobalConstantFP(APFloat APF, Type *ET, AsmPrinter &AP) {
// Emit the tail padding for the long double. // Emit the tail padding for the long double.
const DataLayout &DL = AP.getDataLayout(); const DataLayout &DL = AP.getDataLayout();
AP.OutStreamer->EmitZeros(DL.getTypeAllocSize(ET) - DL.getTypeStoreSize(ET)); AP.OutStreamer->emitZeros(DL.getTypeAllocSize(ET) - DL.getTypeStoreSize(ET));
} }
static void emitGlobalConstantFP(const ConstantFP *CFP, AsmPrinter &AP) { static void emitGlobalConstantFP(const ConstantFP *CFP, AsmPrinter &AP) {
@ -2749,7 +2749,7 @@ static void emitGlobalConstantImpl(const DataLayout &DL, const Constant *CV,
BaseCV = dyn_cast<Constant>(CV->user_back()); BaseCV = dyn_cast<Constant>(CV->user_back());
if (isa<ConstantAggregateZero>(CV) || isa<UndefValue>(CV)) if (isa<ConstantAggregateZero>(CV) || isa<UndefValue>(CV))
return AP.OutStreamer->EmitZeros(Size); return AP.OutStreamer->emitZeros(Size);
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) { if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
switch (Size) { switch (Size) {
@ -3173,7 +3173,7 @@ void AsmPrinter::XRayFunctionEntry::emit(int Bytes, MCStreamer *Out,
Out->emitBinaryData(StringRef(reinterpret_cast<const char *>(&Version), 1)); Out->emitBinaryData(StringRef(reinterpret_cast<const char *>(&Version), 1));
auto Padding = (4 * Bytes) - ((2 * Bytes) + 3); auto Padding = (4 * Bytes) - ((2 * Bytes) + 3);
assert(Padding >= 0 && "Instrumentation map entry > 4 * Word Size"); assert(Padding >= 0 && "Instrumentation map entry > 4 * Word Size");
Out->EmitZeros(Padding); Out->emitZeros(Padding);
} }
void AsmPrinter::emitXRayTable() { void AsmPrinter::emitXRayTable() {

View File

@ -127,7 +127,7 @@ void AsmPrinter::emitInlineAsm(StringRef Str, const MCSubtargetInfo &STI,
if (!MCAI->useIntegratedAssembler() && if (!MCAI->useIntegratedAssembler() &&
!OutStreamer->isIntegratedAssemblerRequired()) { !OutStreamer->isIntegratedAssemblerRequired()) {
emitInlineAsmStart(); emitInlineAsmStart();
OutStreamer->EmitRawText(Str); OutStreamer->emitRawText(Str);
emitInlineAsmEnd(STI, nullptr); emitInlineAsmEnd(STI, nullptr);
return; return;
} }

View File

@ -95,7 +95,7 @@ public:
EmitCommentsAndEOL(); EmitCommentsAndEOL();
} }
void EmitSyntaxDirective() override; void emitSyntaxDirective() override;
void EmitCommentsAndEOL(); void EmitCommentsAndEOL();
@ -166,7 +166,7 @@ public:
void EmitCOFFSectionIndex(MCSymbol const *Symbol) override; void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override; void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override;
void EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) override; void EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) override;
void EmitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size,
MCSymbol *CsectSym, MCSymbol *CsectSym,
unsigned ByteAlign) override; unsigned ByteAlign) override;
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override; void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override;
@ -185,7 +185,7 @@ public:
uint64_t Size = 0, unsigned ByteAlignment = 0, uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment = 0) override; unsigned ByteAlignment = 0) override;
void emitBinaryData(StringRef Data) override; void emitBinaryData(StringRef Data) override;
@ -228,7 +228,7 @@ public:
unsigned char Value, unsigned char Value,
SMLoc Loc) override; SMLoc Loc) override;
void EmitFileDirective(StringRef Filename) override; void emitFileDirective(StringRef Filename) override;
Expected<unsigned> tryEmitDwarfFileDirective(unsigned FileNo, Expected<unsigned> tryEmitDwarfFileDirective(unsigned FileNo,
StringRef Directory, StringRef Directory,
StringRef Filename, StringRef Filename,
@ -287,7 +287,7 @@ public:
void EmitCVFileChecksumOffsetDirective(unsigned FileNo) override; void EmitCVFileChecksumOffsetDirective(unsigned FileNo) override;
void EmitCVFPOData(const MCSymbol *ProcSym, SMLoc L) override; void EmitCVFPOData(const MCSymbol *ProcSym, SMLoc L) override;
void EmitIdent(StringRef IdentString) override; void emitIdent(StringRef IdentString) override;
void emitCFIBKeyFrame() override; void emitCFIBKeyFrame() override;
void emitCFISections(bool EH, bool Debug) override; void emitCFISections(bool EH, bool Debug) override;
void emitCFIDefCfa(int64_t Register, int64_t Offset) override; void emitCFIDefCfa(int64_t Register, int64_t Offset) override;
@ -336,21 +336,21 @@ public:
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override; void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
void EmitBundleAlignMode(unsigned AlignPow2) override; void emitBundleAlignMode(unsigned AlignPow2) override;
void EmitBundleLock(bool AlignToEnd) override; void emitBundleLock(bool AlignToEnd) override;
void EmitBundleUnlock() override; void emitBundleUnlock() override;
bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, bool emitRelocDirective(const MCExpr &Offset, StringRef Name,
const MCExpr *Expr, SMLoc Loc, const MCExpr *Expr, SMLoc Loc,
const MCSubtargetInfo &STI) override; const MCSubtargetInfo &STI) override;
void EmitAddrsig() override; void emitAddrsig() override;
void EmitAddrsigSym(const MCSymbol *Sym) override; void emitAddrsigSym(const MCSymbol *Sym) override;
/// If this file is backed by an assembly streamer, this dumps the specified /// If this file is backed by an assembly streamer, this dumps the specified
/// string in the output .s file. This capability is indicated by the /// string in the output .s file. This capability is indicated by the
/// hasRawTextSupport() predicate. /// hasRawTextSupport() predicate.
void EmitRawTextImpl(StringRef String) override; void emitRawTextImpl(StringRef String) override;
void FinishImpl() override; void FinishImpl() override;
}; };
@ -698,7 +698,7 @@ void MCAsmStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
EmitEOL(); EmitEOL();
} }
void MCAsmStreamer::EmitSyntaxDirective() { void MCAsmStreamer::emitSyntaxDirective() {
if (MAI->getAssemblerDialect() == 1) { if (MAI->getAssemblerDialect() == 1) {
OS << "\t.intel_syntax noprefix"; OS << "\t.intel_syntax noprefix";
EmitEOL(); EmitEOL();
@ -769,7 +769,7 @@ void MCAsmStreamer::EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) {
// We need an XCOFF-specific version of this directive as the AIX syntax // We need an XCOFF-specific version of this directive as the AIX syntax
// requires a QualName argument identifying the csect name and storage mapping // requires a QualName argument identifying the csect name and storage mapping
// class to appear before the alignment if we are specifying it. // class to appear before the alignment if we are specifying it.
void MCAsmStreamer::EmitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, void MCAsmStreamer::emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym,
uint64_t Size, uint64_t Size,
MCSymbol *CsectSym, MCSymbol *CsectSym,
unsigned ByteAlignment) { unsigned ByteAlignment) {
@ -861,7 +861,7 @@ void MCAsmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
// .tbss sym, size, align // .tbss sym, size, align
// This depends that the symbol has already been mangled from the original, // This depends that the symbol has already been mangled from the original,
// e.g. _a. // e.g. _a.
void MCAsmStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, void MCAsmStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) { uint64_t Size, unsigned ByteAlignment) {
AssignFragment(Symbol, &Section->getDummyFragment()); AssignFragment(Symbol, &Section->getDummyFragment());
@ -1220,7 +1220,7 @@ void MCAsmStreamer::emitValueToOffset(const MCExpr *Offset,
EmitEOL(); EmitEOL();
} }
void MCAsmStreamer::EmitFileDirective(StringRef Filename) { void MCAsmStreamer::emitFileDirective(StringRef Filename) {
assert(MAI->hasSingleParameterDotFile()); assert(MAI->hasSingleParameterDotFile());
OS << "\t.file\t"; OS << "\t.file\t";
PrintQuotedString(Filename, OS); PrintQuotedString(Filename, OS);
@ -1284,7 +1284,7 @@ Expected<unsigned> MCAsmStreamer::tryEmitDwarfFileDirective(
if (MCTargetStreamer *TS = getTargetStreamer()) if (MCTargetStreamer *TS = getTargetStreamer())
TS->emitDwarfFileDirective(OS1.str()); TS->emitDwarfFileDirective(OS1.str());
else else
EmitRawText(OS1.str()); emitRawText(OS1.str());
return FileNo; return FileNo;
} }
@ -1310,7 +1310,7 @@ void MCAsmStreamer::emitDwarfFile0Directive(StringRef Directory,
if (MCTargetStreamer *TS = getTargetStreamer()) if (MCTargetStreamer *TS = getTargetStreamer())
TS->emitDwarfFileDirective(OS1.str()); TS->emitDwarfFileDirective(OS1.str());
else else
EmitRawText(OS1.str()); emitRawText(OS1.str());
} }
void MCAsmStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line, void MCAsmStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line,
@ -1516,7 +1516,7 @@ void MCAsmStreamer::EmitCVFPOData(const MCSymbol *ProcSym, SMLoc L) {
EmitEOL(); EmitEOL();
} }
void MCAsmStreamer::EmitIdent(StringRef IdentString) { void MCAsmStreamer::emitIdent(StringRef IdentString) {
assert(MAI->hasIdentDirective() && ".ident directive not supported"); assert(MAI->hasIdentDirective() && ".ident directive not supported");
OS << "\t.ident\t"; OS << "\t.ident\t";
PrintQuotedString(IdentString, OS); PrintQuotedString(IdentString, OS);
@ -1973,24 +1973,24 @@ void MCAsmStreamer::emitInstruction(const MCInst &Inst,
EmitEOL(); EmitEOL();
} }
void MCAsmStreamer::EmitBundleAlignMode(unsigned AlignPow2) { void MCAsmStreamer::emitBundleAlignMode(unsigned AlignPow2) {
OS << "\t.bundle_align_mode " << AlignPow2; OS << "\t.bundle_align_mode " << AlignPow2;
EmitEOL(); EmitEOL();
} }
void MCAsmStreamer::EmitBundleLock(bool AlignToEnd) { void MCAsmStreamer::emitBundleLock(bool AlignToEnd) {
OS << "\t.bundle_lock"; OS << "\t.bundle_lock";
if (AlignToEnd) if (AlignToEnd)
OS << " align_to_end"; OS << " align_to_end";
EmitEOL(); EmitEOL();
} }
void MCAsmStreamer::EmitBundleUnlock() { void MCAsmStreamer::emitBundleUnlock() {
OS << "\t.bundle_unlock"; OS << "\t.bundle_unlock";
EmitEOL(); EmitEOL();
} }
bool MCAsmStreamer::EmitRelocDirective(const MCExpr &Offset, StringRef Name, bool MCAsmStreamer::emitRelocDirective(const MCExpr &Offset, StringRef Name,
const MCExpr *Expr, SMLoc, const MCExpr *Expr, SMLoc,
const MCSubtargetInfo &STI) { const MCSubtargetInfo &STI) {
OS << "\t.reloc "; OS << "\t.reloc ";
@ -2004,12 +2004,12 @@ bool MCAsmStreamer::EmitRelocDirective(const MCExpr &Offset, StringRef Name,
return false; return false;
} }
void MCAsmStreamer::EmitAddrsig() { void MCAsmStreamer::emitAddrsig() {
OS << "\t.addrsig"; OS << "\t.addrsig";
EmitEOL(); EmitEOL();
} }
void MCAsmStreamer::EmitAddrsigSym(const MCSymbol *Sym) { void MCAsmStreamer::emitAddrsigSym(const MCSymbol *Sym) {
OS << "\t.addrsig_sym "; OS << "\t.addrsig_sym ";
Sym->print(OS, MAI); Sym->print(OS, MAI);
EmitEOL(); EmitEOL();
@ -2018,7 +2018,7 @@ void MCAsmStreamer::EmitAddrsigSym(const MCSymbol *Sym) {
/// EmitRawText - If this file is backed by an assembly streamer, this dumps /// EmitRawText - If this file is backed by an assembly streamer, this dumps
/// the specified string in the output .s file. This capability is /// the specified string in the output .s file. This capability is
/// indicated by the hasRawTextSupport() predicate. /// indicated by the hasRawTextSupport() predicate.
void MCAsmStreamer::EmitRawTextImpl(StringRef String) { void MCAsmStreamer::emitRawTextImpl(StringRef String) {
if (!String.empty() && String.back() == '\n') if (!String.empty() && String.back() == '\n')
String = String.substr(0, String.size()-1); String = String.substr(0, String.size()-1);
OS << String; OS << String;

View File

@ -306,7 +306,7 @@ void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
emitValueToAlignment(ByteAlignment, 0, 1, 0); emitValueToAlignment(ByteAlignment, 0, 1, 0);
emitLabel(Symbol); emitLabel(Symbol);
EmitZeros(Size); emitZeros(Size);
SwitchSection(P.first, P.second); SwitchSection(P.first, P.second);
} else { } else {
@ -362,7 +362,7 @@ void MCELFStreamer::emitCGProfileEntry(const MCSymbolRefExpr *From,
getAssembler().CGProfile.push_back({From, To, Count}); getAssembler().CGProfile.push_back({From, To, Count});
} }
void MCELFStreamer::EmitIdent(StringRef IdentString) { void MCELFStreamer::emitIdent(StringRef IdentString) {
MCSection *Comment = getAssembler().getContext().getELFSection( MCSection *Comment = getAssembler().getContext().getELFSection(
".comment", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, ""); ".comment", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, "");
PushSection(); PushSection();
@ -600,7 +600,7 @@ void MCELFStreamer::EmitInstToData(const MCInst &Inst,
} }
} }
void MCELFStreamer::EmitBundleAlignMode(unsigned AlignPow2) { void MCELFStreamer::emitBundleAlignMode(unsigned AlignPow2) {
assert(AlignPow2 <= 30 && "Invalid bundle alignment"); assert(AlignPow2 <= 30 && "Invalid bundle alignment");
MCAssembler &Assembler = getAssembler(); MCAssembler &Assembler = getAssembler();
if (AlignPow2 > 0 && (Assembler.getBundleAlignSize() == 0 || if (AlignPow2 > 0 && (Assembler.getBundleAlignSize() == 0 ||
@ -610,7 +610,7 @@ void MCELFStreamer::EmitBundleAlignMode(unsigned AlignPow2) {
report_fatal_error(".bundle_align_mode cannot be changed once set"); report_fatal_error(".bundle_align_mode cannot be changed once set");
} }
void MCELFStreamer::EmitBundleLock(bool AlignToEnd) { void MCELFStreamer::emitBundleLock(bool AlignToEnd) {
MCSection &Sec = *getCurrentSectionOnly(); MCSection &Sec = *getCurrentSectionOnly();
// Sanity checks // Sanity checks
@ -631,7 +631,7 @@ void MCELFStreamer::EmitBundleLock(bool AlignToEnd) {
: MCSection::BundleLocked); : MCSection::BundleLocked);
} }
void MCELFStreamer::EmitBundleUnlock() { void MCELFStreamer::emitBundleUnlock() {
MCSection &Sec = *getCurrentSectionOnly(); MCSection &Sec = *getCurrentSectionOnly();
// Sanity checks // Sanity checks
@ -690,7 +690,7 @@ void MCELFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
llvm_unreachable("ELF doesn't support this directive"); llvm_unreachable("ELF doesn't support this directive");
} }
void MCELFStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, void MCELFStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) { uint64_t Size, unsigned ByteAlignment) {
llvm_unreachable("ELF doesn't support this directive"); llvm_unreachable("ELF doesn't support this directive");
} }

View File

@ -103,10 +103,10 @@ public:
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr, void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, unsigned ByteAlignment = 0, uint64_t Size = 0, unsigned ByteAlignment = 0,
SMLoc Loc = SMLoc()) override; SMLoc Loc = SMLoc()) override;
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment = 0) override; unsigned ByteAlignment = 0) override;
void EmitIdent(StringRef IdentString) override { void emitIdent(StringRef IdentString) override {
llvm_unreachable("macho doesn't support this directive"); llvm_unreachable("macho doesn't support this directive");
} }
@ -440,14 +440,14 @@ void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
if (Symbol) { if (Symbol) {
emitValueToAlignment(ByteAlignment, 0, 1, 0); emitValueToAlignment(ByteAlignment, 0, 1, 0);
emitLabel(Symbol); emitLabel(Symbol);
EmitZeros(Size); emitZeros(Size);
} }
PopSection(); PopSection();
} }
// This should always be called with the thread local bss section. Like the // This should always be called with the thread local bss section. Like the
// .zerofill directive this doesn't actually switch sections on us. // .zerofill directive this doesn't actually switch sections on us.
void MCMachOStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, void MCMachOStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) { uint64_t Size, unsigned ByteAlignment) {
emitZerofill(Section, Symbol, Size, ByteAlignment); emitZerofill(Section, Symbol, Size, ByteAlignment);
} }

View File

@ -23,7 +23,7 @@ namespace {
/// @{ /// @{
bool hasRawTextSupport() const override { return true; } bool hasRawTextSupport() const override { return true; }
void EmitRawTextImpl(StringRef String) override {} void emitRawTextImpl(StringRef String) override {}
bool emitSymbolAttribute(MCSymbol *Symbol, bool emitSymbolAttribute(MCSymbol *Symbol,
MCSymbolAttr Attribute) override { MCSymbolAttr Attribute) override {

View File

@ -431,15 +431,15 @@ static const char *const BundlingNotImplementedMsg =
"Aligned bundling is not implemented for this object format"; "Aligned bundling is not implemented for this object format";
#endif #endif
void MCObjectStreamer::EmitBundleAlignMode(unsigned AlignPow2) { void MCObjectStreamer::emitBundleAlignMode(unsigned AlignPow2) {
llvm_unreachable(BundlingNotImplementedMsg); llvm_unreachable(BundlingNotImplementedMsg);
} }
void MCObjectStreamer::EmitBundleLock(bool AlignToEnd) { void MCObjectStreamer::emitBundleLock(bool AlignToEnd) {
llvm_unreachable(BundlingNotImplementedMsg); llvm_unreachable(BundlingNotImplementedMsg);
} }
void MCObjectStreamer::EmitBundleUnlock() { void MCObjectStreamer::emitBundleUnlock() {
llvm_unreachable(BundlingNotImplementedMsg); llvm_unreachable(BundlingNotImplementedMsg);
} }
@ -660,7 +660,7 @@ void MCObjectStreamer::emitGPRel64Value(const MCExpr *Value) {
DF->getContents().resize(DF->getContents().size() + 8, 0); DF->getContents().resize(DF->getContents().size() + 8, 0);
} }
bool MCObjectStreamer::EmitRelocDirective(const MCExpr &Offset, StringRef Name, bool MCObjectStreamer::emitRelocDirective(const MCExpr &Offset, StringRef Name,
const MCExpr *Expr, SMLoc Loc, const MCExpr *Expr, SMLoc Loc,
const MCSubtargetInfo &STI) { const MCSubtargetInfo &STI) {
Optional<MCFixupKind> MaybeKind = Assembler->getBackend().getFixupKind(Name); Optional<MCFixupKind> MaybeKind = Assembler->getBackend().getFixupKind(Name);
@ -738,15 +738,15 @@ void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size,
insert(new MCFillFragment(Expr, Size, NumValues, Loc)); insert(new MCFillFragment(Expr, Size, NumValues, Loc));
} }
void MCObjectStreamer::EmitFileDirective(StringRef Filename) { void MCObjectStreamer::emitFileDirective(StringRef Filename) {
getAssembler().addFileName(Filename); getAssembler().addFileName(Filename);
} }
void MCObjectStreamer::EmitAddrsig() { void MCObjectStreamer::emitAddrsig() {
getAssembler().getWriter().emitAddrsigSection(); getAssembler().getWriter().emitAddrsigSection();
} }
void MCObjectStreamer::EmitAddrsigSym(const MCSymbol *Sym) { void MCObjectStreamer::emitAddrsigSym(const MCSymbol *Sym) {
getAssembler().registerSymbol(*Sym); getAssembler().registerSymbol(*Sym);
getAssembler().getWriter().addAddrsigSymbol(Sym); getAssembler().getWriter().addAddrsigSymbol(Sym);
} }

View File

@ -3029,7 +3029,7 @@ bool AsmParser::parseDirectiveReloc(SMLoc DirectiveLoc) {
const MCTargetAsmParser &MCT = getTargetParser(); const MCTargetAsmParser &MCT = getTargetParser();
const MCSubtargetInfo &STI = MCT.getSTI(); const MCSubtargetInfo &STI = MCT.getSTI();
if (getStreamer().EmitRelocDirective(*Offset, Name, Expr, DirectiveLoc, STI)) if (getStreamer().emitRelocDirective(*Offset, Name, Expr, DirectiveLoc, STI))
return Error(NameLoc, "unknown relocation name"); return Error(NameLoc, "unknown relocation name");
return false; return false;
@ -3419,7 +3419,7 @@ bool AsmParser::parseDirectiveFile(SMLoc DirectiveLoc) {
// numberless .file directives. This allows some portability of assembler // numberless .file directives. This allows some portability of assembler
// between different object file formats. // between different object file formats.
if (getContext().getAsmInfo()->hasSingleParameterDotFile()) if (getContext().getAsmInfo()->hasSingleParameterDotFile())
getStreamer().EmitFileDirective(Filename); getStreamer().emitFileDirective(Filename);
} else { } else {
// In case there is a -g option as well as debug info from directive .file, // In case there is a -g option as well as debug info from directive .file,
// we turn off the -g option, directly use the existing debug info instead. // we turn off the -g option, directly use the existing debug info instead.
@ -4661,7 +4661,7 @@ bool AsmParser::parseDirectiveBundleAlignMode() {
// Because of AlignSizePow2's verified range we can safely truncate it to // Because of AlignSizePow2's verified range we can safely truncate it to
// unsigned. // unsigned.
getStreamer().EmitBundleAlignMode(static_cast<unsigned>(AlignSizePow2)); getStreamer().emitBundleAlignMode(static_cast<unsigned>(AlignSizePow2));
return false; return false;
} }
@ -4686,7 +4686,7 @@ bool AsmParser::parseDirectiveBundleLock() {
AlignToEnd = true; AlignToEnd = true;
} }
getStreamer().EmitBundleLock(AlignToEnd); getStreamer().emitBundleLock(AlignToEnd);
return false; return false;
} }
@ -4698,7 +4698,7 @@ bool AsmParser::parseDirectiveBundleUnlock() {
"unexpected token in '.bundle_unlock' directive")) "unexpected token in '.bundle_unlock' directive"))
return true; return true;
getStreamer().EmitBundleUnlock(); getStreamer().emitBundleUnlock();
return false; return false;
} }
@ -5726,7 +5726,7 @@ bool AsmParser::parseDirectivePrint(SMLoc DirectiveLoc) {
} }
bool AsmParser::parseDirectiveAddrsig() { bool AsmParser::parseDirectiveAddrsig() {
getStreamer().EmitAddrsig(); getStreamer().emitAddrsig();
return false; return false;
} }
@ -5736,7 +5736,7 @@ bool AsmParser::parseDirectiveAddrsigSym() {
"expected identifier in '.addrsig_sym' directive")) "expected identifier in '.addrsig_sym' directive"))
return true; return true;
MCSymbol *Sym = getContext().getOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
getStreamer().EmitAddrsigSym(Sym); getStreamer().emitAddrsigSym(Sym);
return false; return false;
} }

View File

@ -870,11 +870,11 @@ bool DarwinAsmParser::parseDirectiveTBSS(StringRef, SMLoc) {
if (!Sym->isUndefined()) if (!Sym->isUndefined())
return Error(IDLoc, "invalid symbol redefinition"); return Error(IDLoc, "invalid symbol redefinition");
getStreamer().EmitTBSSSymbol(getContext().getMachOSection( getStreamer().emitTBSSSymbol(
"__DATA", "__thread_bss", getContext().getMachOSection("__DATA", "__thread_bss",
MachO::S_THREAD_LOCAL_ZEROFILL, MachO::S_THREAD_LOCAL_ZEROFILL, 0,
0, SectionKind::getThreadBSS()), SectionKind::getThreadBSS()),
Sym, Size, 1 << Pow2Alignment); Sym, Size, 1 << Pow2Alignment);
return false; return false;
} }

View File

@ -748,7 +748,7 @@ bool ELFAsmParser::ParseDirectiveIdent(StringRef, SMLoc) {
return TokError("unexpected token in '.ident' directive"); return TokError("unexpected token in '.ident' directive");
Lex(); Lex();
getStreamer().EmitIdent(Data); getStreamer().emitIdent(Data);
return false; return false;
} }

View File

@ -210,7 +210,7 @@ public:
if (getLexer().isNot(AsmToken::EndOfStatement)) if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in '.ident' directive"); return TokError("unexpected token in '.ident' directive");
Lex(); Lex();
getStreamer().EmitIdent(Data); getStreamer().emitIdent(Data);
return false; return false;
} }

View File

@ -63,7 +63,7 @@ void MCTargetStreamer::changeSection(const MCSection *CurSection,
} }
void MCTargetStreamer::emitDwarfFileDirective(StringRef Directive) { void MCTargetStreamer::emitDwarfFileDirective(StringRef Directive) {
Streamer.EmitRawText(Directive); Streamer.emitRawText(Directive);
} }
void MCTargetStreamer::emitValue(const MCExpr *Value) { void MCTargetStreamer::emitValue(const MCExpr *Value) {
@ -71,7 +71,7 @@ void MCTargetStreamer::emitValue(const MCExpr *Value) {
raw_svector_ostream OS(Str); raw_svector_ostream OS(Str);
Value->print(OS, Streamer.getContext().getAsmInfo()); Value->print(OS, Streamer.getContext().getAsmInfo());
Streamer.EmitRawText(OS.str()); Streamer.emitRawText(OS.str());
} }
void MCTargetStreamer::emitRawBytes(StringRef Data) { void MCTargetStreamer::emitRawBytes(StringRef Data) {
@ -82,7 +82,7 @@ void MCTargetStreamer::emitRawBytes(StringRef Data) {
raw_svector_ostream OS(Str); raw_svector_ostream OS(Str);
OS << Directive << (unsigned)C; OS << Directive << (unsigned)C;
Streamer.EmitRawText(OS.str()); Streamer.emitRawText(OS.str());
} }
} }
@ -205,9 +205,7 @@ void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) {
} }
/// The implementation in this class just redirects to emitFill. /// The implementation in this class just redirects to emitFill.
void MCStreamer::EmitZeros(uint64_t NumBytes) { void MCStreamer::emitZeros(uint64_t NumBytes) { emitFill(NumBytes, 0); }
emitFill(NumBytes, 0);
}
Expected<unsigned> Expected<unsigned>
MCStreamer::tryEmitDwarfFileDirective(unsigned FileNo, StringRef Directory, MCStreamer::tryEmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
@ -809,7 +807,7 @@ MCSection *MCStreamer::getAssociatedXDataSection(const MCSection *TextSec) {
TextSec); TextSec);
} }
void MCStreamer::EmitSyntaxDirective() {} void MCStreamer::emitSyntaxDirective() {}
static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg) { static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg) {
return Ctx.getRegisterInfo()->getSEHRegNum(Reg); return Ctx.getRegisterInfo()->getSEHRegNum(Reg);
@ -935,7 +933,7 @@ void MCStreamer::EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) {}
/// EmitRawText - If this file is backed by an assembly streamer, this dumps /// EmitRawText - If this file is backed by an assembly streamer, this dumps
/// the specified string in the output .s file. This capability is /// the specified string in the output .s file. This capability is
/// indicated by the hasRawTextSupport() predicate. /// indicated by the hasRawTextSupport() predicate.
void MCStreamer::EmitRawTextImpl(StringRef String) { void MCStreamer::emitRawTextImpl(StringRef String) {
// This is not llvm_unreachable for the sake of out of tree backend // This is not llvm_unreachable for the sake of out of tree backend
// developers who may not have assembly streamers and should serve as a // developers who may not have assembly streamers and should serve as a
// reminder to not accidentally call EmitRawText in the absence of such. // reminder to not accidentally call EmitRawText in the absence of such.
@ -944,9 +942,9 @@ void MCStreamer::EmitRawTextImpl(StringRef String) {
"implementation)"); "implementation)");
} }
void MCStreamer::EmitRawText(const Twine &T) { void MCStreamer::emitRawText(const Twine &T) {
SmallString<128> Str; SmallString<128> Str;
EmitRawTextImpl(T.toStringRef(Str)); emitRawTextImpl(T.toStringRef(Str));
} }
void MCStreamer::EmitWindowsUnwindTables() { void MCStreamer::EmitWindowsUnwindTables() {
@ -1056,14 +1054,14 @@ void MCStreamer::BeginCOFFSymbolDef(const MCSymbol *Symbol) {
void MCStreamer::EndCOFFSymbolDef() { void MCStreamer::EndCOFFSymbolDef() {
llvm_unreachable("this directive only supported on COFF targets"); llvm_unreachable("this directive only supported on COFF targets");
} }
void MCStreamer::EmitFileDirective(StringRef Filename) {} void MCStreamer::emitFileDirective(StringRef Filename) {}
void MCStreamer::EmitCOFFSymbolStorageClass(int StorageClass) { void MCStreamer::EmitCOFFSymbolStorageClass(int StorageClass) {
llvm_unreachable("this directive only supported on COFF targets"); llvm_unreachable("this directive only supported on COFF targets");
} }
void MCStreamer::EmitCOFFSymbolType(int Type) { void MCStreamer::EmitCOFFSymbolType(int Type) {
llvm_unreachable("this directive only supported on COFF targets"); llvm_unreachable("this directive only supported on COFF targets");
} }
void MCStreamer::EmitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, void MCStreamer::emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size,
MCSymbol *CsectSym, MCSymbol *CsectSym,
unsigned ByteAlign) { unsigned ByteAlign) {
llvm_unreachable("this directive only supported on XCOFF targets"); llvm_unreachable("this directive only supported on XCOFF targets");
@ -1073,7 +1071,7 @@ void MCStreamer::emitELFSymverDirective(StringRef AliasName,
const MCSymbol *Aliasee) {} const MCSymbol *Aliasee) {}
void MCStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, void MCStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) {} unsigned ByteAlignment) {}
void MCStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, void MCStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) {} uint64_t Size, unsigned ByteAlignment) {}
void MCStreamer::ChangeSection(MCSection *, const MCExpr *) {} void MCStreamer::ChangeSection(MCSection *, const MCExpr *) {}
void MCStreamer::emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {} void MCStreamer::emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {}
@ -1094,10 +1092,10 @@ void MCStreamer::emitCodeAlignment(unsigned ByteAlignment,
unsigned MaxBytesToEmit) {} unsigned MaxBytesToEmit) {}
void MCStreamer::emitValueToOffset(const MCExpr *Offset, unsigned char Value, void MCStreamer::emitValueToOffset(const MCExpr *Offset, unsigned char Value,
SMLoc Loc) {} SMLoc Loc) {}
void MCStreamer::EmitBundleAlignMode(unsigned AlignPow2) {} void MCStreamer::emitBundleAlignMode(unsigned AlignPow2) {}
void MCStreamer::EmitBundleLock(bool AlignToEnd) {} void MCStreamer::emitBundleLock(bool AlignToEnd) {}
void MCStreamer::FinishImpl() {} void MCStreamer::FinishImpl() {}
void MCStreamer::EmitBundleUnlock() {} void MCStreamer::emitBundleUnlock() {}
void MCStreamer::SwitchSection(MCSection *Section, const MCExpr *Subsection) { void MCStreamer::SwitchSection(MCSection *Section, const MCExpr *Subsection) {
assert(Section && "Cannot switch to a null section!"); assert(Section && "Cannot switch to a null section!");

View File

@ -160,7 +160,7 @@ void MCWasmStreamer::emitValueToAlignment(unsigned ByteAlignment, int64_t Value,
MaxBytesToEmit); MaxBytesToEmit);
} }
void MCWasmStreamer::EmitIdent(StringRef IdentString) { void MCWasmStreamer::emitIdent(StringRef IdentString) {
// TODO(sbc): Add the ident section once we support mergable strings // TODO(sbc): Add the ident section once we support mergable strings
// sections in the object format // sections in the object format
} }
@ -223,7 +223,7 @@ void MCWasmStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
llvm_unreachable("Wasm doesn't support this directive"); llvm_unreachable("Wasm doesn't support this directive");
} }
void MCWasmStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, void MCWasmStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) { uint64_t Size, unsigned ByteAlignment) {
llvm_unreachable("Wasm doesn't support this directive"); llvm_unreachable("Wasm doesn't support this directive");
} }

View File

@ -304,7 +304,7 @@ void MCWinCOFFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
emitValueToAlignment(ByteAlignment, 0, 1, 0); emitValueToAlignment(ByteAlignment, 0, 1, 0);
emitLabel(Symbol); emitLabel(Symbol);
Symbol->setExternal(false); Symbol->setExternal(false);
EmitZeros(Size); emitZeros(Size);
PopSection(); PopSection();
} }
@ -314,13 +314,13 @@ void MCWinCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
llvm_unreachable("not implemented"); llvm_unreachable("not implemented");
} }
void MCWinCOFFStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, void MCWinCOFFStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) { uint64_t Size, unsigned ByteAlignment) {
llvm_unreachable("not implemented"); llvm_unreachable("not implemented");
} }
// TODO: Implement this if you want to emit .comment section in COFF obj files. // TODO: Implement this if you want to emit .comment section in COFF obj files.
void MCWinCOFFStreamer::EmitIdent(StringRef IdentString) { void MCWinCOFFStreamer::emitIdent(StringRef IdentString) {
llvm_unreachable("not implemented"); llvm_unreachable("not implemented");
} }

View File

@ -52,7 +52,7 @@ void MCXCOFFStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
// Emit the alignment and storage for the variable to the section. // Emit the alignment and storage for the variable to the section.
emitValueToAlignment(ByteAlignment); emitValueToAlignment(ByteAlignment);
EmitZeros(Size); emitZeros(Size);
} }
void MCXCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol, void MCXCOFFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
@ -94,7 +94,7 @@ MCStreamer *llvm::createXCOFFStreamer(MCContext &Context,
return S; return S;
} }
void MCXCOFFStreamer::EmitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, void MCXCOFFStreamer::emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym,
uint64_t Size, uint64_t Size,
MCSymbol *CsectSym, MCSymbol *CsectSym,
unsigned ByteAlignment) { unsigned ByteAlignment) {

View File

@ -1067,7 +1067,7 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) {
SmallString<128> TmpStr; SmallString<128> TmpStr;
raw_svector_ostream OS(TmpStr); raw_svector_ostream OS(TmpStr);
PrintDebugValueComment(MI, OS); PrintDebugValueComment(MI, OS);
OutStreamer->EmitRawText(StringRef(OS.str())); OutStreamer->emitRawText(StringRef(OS.str()));
} }
return; return;

View File

@ -1810,7 +1810,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
return; return;
} }
case ARM::SPACE: case ARM::SPACE:
OutStreamer->EmitZeros(MI->getOperand(1).getImm()); OutStreamer->emitZeros(MI->getOperand(1).getImm());
return; return;
case ARM::TRAP: { case ARM::TRAP: {
// Non-Darwin binutils don't yet support the "trap" mnemonic. // Non-Darwin binutils don't yet support the "trap" mnemonic.

View File

@ -112,7 +112,7 @@ void HexagonMCELFStreamer::HexagonMCEmitCommonSymbol(MCSymbol *Symbol,
if (ELFSymbol->isUndefined()) { if (ELFSymbol->isUndefined()) {
emitValueToAlignment(ByteAlignment, 0, 1, 0); emitValueToAlignment(ByteAlignment, 0, 1, 0);
emitLabel(Symbol); emitLabel(Symbol);
EmitZeros(Size); emitZeros(Size);
} }
// Update the maximum alignment of the section if necessary. // Update the maximum alignment of the section if necessary.

View File

@ -2128,8 +2128,8 @@ bool MipsAsmParser::processInstruction(MCInst &Inst, SMLoc IDLoc,
MCSymbolRefExpr::create(JalSym, MCSymbolRefExpr::VK_None, MCSymbolRefExpr::create(JalSym, MCSymbolRefExpr::VK_None,
getContext(), IDLoc); getContext(), IDLoc);
TOut.getStreamer().EmitRelocDirective(*TmpExpr, TOut.getStreamer().emitRelocDirective(
inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR", *TmpExpr, inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR",
RelocJalrExpr, IDLoc, *STI); RelocJalrExpr, IDLoc, *STI);
TOut.getStreamer().emitLabel(TmpLabel); TOut.getStreamer().emitLabel(TmpLabel);
} }

View File

@ -113,10 +113,10 @@ private:
void sandboxIndirectJump(const MCInst &MI, const MCSubtargetInfo &STI) { void sandboxIndirectJump(const MCInst &MI, const MCSubtargetInfo &STI) {
unsigned AddrReg = MI.getOperand(0).getReg(); unsigned AddrReg = MI.getOperand(0).getReg();
EmitBundleLock(false); emitBundleLock(false);
emitMask(AddrReg, IndirectBranchMaskReg, STI); emitMask(AddrReg, IndirectBranchMaskReg, STI);
MipsELFStreamer::emitInstruction(MI, STI); MipsELFStreamer::emitInstruction(MI, STI);
EmitBundleUnlock(); emitBundleUnlock();
} }
// Sandbox memory access or SP change. Insert mask operation before and/or // Sandbox memory access or SP change. Insert mask operation before and/or
@ -124,7 +124,7 @@ private:
void sandboxLoadStoreStackChange(const MCInst &MI, unsigned AddrIdx, void sandboxLoadStoreStackChange(const MCInst &MI, unsigned AddrIdx,
const MCSubtargetInfo &STI, bool MaskBefore, const MCSubtargetInfo &STI, bool MaskBefore,
bool MaskAfter) { bool MaskAfter) {
EmitBundleLock(false); emitBundleLock(false);
if (MaskBefore) { if (MaskBefore) {
// Sandbox memory access. // Sandbox memory access.
unsigned BaseReg = MI.getOperand(AddrIdx).getReg(); unsigned BaseReg = MI.getOperand(AddrIdx).getReg();
@ -137,7 +137,7 @@ private:
assert((Mips::SP == SPReg) && "Unexpected stack-pointer register."); assert((Mips::SP == SPReg) && "Unexpected stack-pointer register.");
emitMask(SPReg, LoadStoreStackMaskReg, STI); emitMask(SPReg, LoadStoreStackMaskReg, STI);
} }
EmitBundleUnlock(); emitBundleUnlock();
} }
public: public:
@ -181,7 +181,7 @@ public:
report_fatal_error("Dangerous instruction in branch delay slot!"); report_fatal_error("Dangerous instruction in branch delay slot!");
// Start the sandboxing sequence by emitting call. // Start the sandboxing sequence by emitting call.
EmitBundleLock(true); emitBundleLock(true);
if (IsIndirectCall) { if (IsIndirectCall) {
unsigned TargetReg = Inst.getOperand(1).getReg(); unsigned TargetReg = Inst.getOperand(1).getReg();
emitMask(TargetReg, IndirectBranchMaskReg, STI); emitMask(TargetReg, IndirectBranchMaskReg, STI);
@ -193,7 +193,7 @@ public:
if (PendingCall) { if (PendingCall) {
// Finish the sandboxing sequence by emitting branch delay. // Finish the sandboxing sequence by emitting branch delay.
MipsELFStreamer::emitInstruction(Inst, STI); MipsELFStreamer::emitInstruction(Inst, STI);
EmitBundleUnlock(); emitBundleUnlock();
PendingCall = false; PendingCall = false;
return; return;
} }
@ -270,7 +270,7 @@ MCELFStreamer *createMipsNaClELFStreamer(MCContext &Context,
S->getAssembler().setRelaxAll(true); S->getAssembler().setRelaxAll(true);
// Set bundle-alignment as required by the NaCl ABI for the target. // Set bundle-alignment as required by the NaCl ABI for the target.
S->EmitBundleAlignMode(Log2(MIPS_NACL_BUNDLE_ALIGN)); S->emitBundleAlignMode(Log2(MIPS_NACL_BUNDLE_ALIGN));
return S; return S;
} }

View File

@ -174,10 +174,10 @@ static void emitDirectiveRelocJalr(const MachineInstr &MI,
MCSymbolRefExpr::create(OffsetLabel, OutContext); MCSymbolRefExpr::create(OffsetLabel, OutContext);
const MCExpr *CaleeExpr = const MCExpr *CaleeExpr =
MCSymbolRefExpr::create(Callee, OutContext); MCSymbolRefExpr::create(Callee, OutContext);
OutStreamer.EmitRelocDirective OutStreamer.emitRelocDirective(
(*OffsetExpr, *OffsetExpr,
Subtarget.inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR", Subtarget.inMicroMipsMode() ? "R_MICROMIPS_JALR" : "R_MIPS_JALR",
CaleeExpr, SMLoc(), *TM.getMCSubtargetInfo()); CaleeExpr, SMLoc(), *TM.getMCSubtargetInfo());
OutStreamer.emitLabel(OffsetLabel); OutStreamer.emitLabel(OffsetLabel);
return; return;
} }

View File

@ -26,13 +26,13 @@ NVPTXTargetStreamer::~NVPTXTargetStreamer() = default;
void NVPTXTargetStreamer::outputDwarfFileDirectives() { void NVPTXTargetStreamer::outputDwarfFileDirectives() {
for (const std::string &S : DwarfFiles) for (const std::string &S : DwarfFiles)
getStreamer().EmitRawText(S.data()); getStreamer().emitRawText(S.data());
DwarfFiles.clear(); DwarfFiles.clear();
} }
void NVPTXTargetStreamer::closeLastSection() { void NVPTXTargetStreamer::closeLastSection() {
if (HasSections) if (HasSections)
getStreamer().EmitRawText("\t}"); getStreamer().emitRawText("\t}");
} }
void NVPTXTargetStreamer::emitDwarfFileDirective(StringRef Directive) { void NVPTXTargetStreamer::emitDwarfFileDirective(StringRef Directive) {
@ -128,7 +128,7 @@ void NVPTXTargetStreamer::emitRawBytes(StringRef Data) {
if (Label == Directive) if (Label == Directive)
Label = ","; Label = ",";
} }
Streamer.EmitRawText(OS.str()); Streamer.emitRawText(OS.str());
} }
#endif #endif
} }

View File

@ -437,7 +437,7 @@ bool NVPTXAsmPrinter::isLoopHeaderOfNoUnroll(
void NVPTXAsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) { void NVPTXAsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
AsmPrinter::emitBasicBlockStart(MBB); AsmPrinter::emitBasicBlockStart(MBB);
if (isLoopHeaderOfNoUnroll(MBB)) if (isLoopHeaderOfNoUnroll(MBB))
OutStreamer->EmitRawText(StringRef("\t.pragma \"nounroll\";\n")); OutStreamer->emitRawText(StringRef("\t.pragma \"nounroll\";\n"));
} }
void NVPTXAsmPrinter::emitFunctionEntryLabel() { void NVPTXAsmPrinter::emitFunctionEntryLabel() {
@ -467,11 +467,11 @@ void NVPTXAsmPrinter::emitFunctionEntryLabel() {
if (isKernelFunction(*F)) if (isKernelFunction(*F))
emitKernelFunctionDirectives(*F, O); emitKernelFunctionDirectives(*F, O);
OutStreamer->EmitRawText(O.str()); OutStreamer->emitRawText(O.str());
VRegMapping.clear(); VRegMapping.clear();
// Emit open brace for function body. // Emit open brace for function body.
OutStreamer->EmitRawText(StringRef("{\n")); OutStreamer->emitRawText(StringRef("{\n"));
setAndEmitFunctionVirtualRegisters(*MF); setAndEmitFunctionVirtualRegisters(*MF);
// Emit initial .loc debug directive for correct relocation symbol data. // Emit initial .loc debug directive for correct relocation symbol data.
if (MMI && MMI->hasDebugInfo()) if (MMI && MMI->hasDebugInfo())
@ -485,7 +485,7 @@ bool NVPTXAsmPrinter::runOnMachineFunction(MachineFunction &F) {
// debug labels/data after the last basic block. // debug labels/data after the last basic block.
// We need to emit the closing brace here because we don't have function that // We need to emit the closing brace here because we don't have function that
// finished emission of the function body. // finished emission of the function body.
OutStreamer->EmitRawText(StringRef("}\n")); OutStreamer->emitRawText(StringRef("}\n"));
return Result; return Result;
} }
@ -493,7 +493,7 @@ void NVPTXAsmPrinter::emitFunctionBodyStart() {
SmallString<128> Str; SmallString<128> Str;
raw_svector_ostream O(Str); raw_svector_ostream O(Str);
emitDemotedVars(&MF->getFunction(), O); emitDemotedVars(&MF->getFunction(), O);
OutStreamer->EmitRawText(O.str()); OutStreamer->emitRawText(O.str());
} }
void NVPTXAsmPrinter::emitFunctionBodyEnd() { void NVPTXAsmPrinter::emitFunctionBodyEnd() {
@ -792,13 +792,13 @@ bool NVPTXAsmPrinter::doInitialization(Module &M) {
// Emit header before any dwarf directives are emitted below. // Emit header before any dwarf directives are emitted below.
emitHeader(M, OS1, *STI); emitHeader(M, OS1, *STI);
OutStreamer->EmitRawText(OS1.str()); OutStreamer->emitRawText(OS1.str());
// Emit module-level inline asm if it exists. // Emit module-level inline asm if it exists.
if (!M.getModuleInlineAsm().empty()) { if (!M.getModuleInlineAsm().empty()) {
OutStreamer->AddComment("Start of file scope inline assembly"); OutStreamer->AddComment("Start of file scope inline assembly");
OutStreamer->AddBlankLine(); OutStreamer->AddBlankLine();
OutStreamer->EmitRawText(StringRef(M.getModuleInlineAsm())); OutStreamer->emitRawText(StringRef(M.getModuleInlineAsm()));
OutStreamer->AddBlankLine(); OutStreamer->AddBlankLine();
OutStreamer->AddComment("End of file scope inline assembly"); OutStreamer->AddComment("End of file scope inline assembly");
OutStreamer->AddBlankLine(); OutStreamer->AddBlankLine();
@ -838,7 +838,7 @@ void NVPTXAsmPrinter::emitGlobals(const Module &M) {
OS2 << '\n'; OS2 << '\n';
OutStreamer->EmitRawText(OS2.str()); OutStreamer->emitRawText(OS2.str());
} }
void NVPTXAsmPrinter::emitHeader(Module &M, raw_ostream &O, void NVPTXAsmPrinter::emitHeader(Module &M, raw_ostream &O,
@ -929,7 +929,7 @@ bool NVPTXAsmPrinter::doFinalization(Module &M) {
static_cast<NVPTXTargetStreamer *>(OutStreamer->getTargetStreamer()) static_cast<NVPTXTargetStreamer *>(OutStreamer->getTargetStreamer())
->closeLastSection(); ->closeLastSection();
// Emit empty .debug_loc section for better support of the empty files. // Emit empty .debug_loc section for better support of the empty files.
OutStreamer->EmitRawText("\t.section\t.debug_loc\t{\t}"); OutStreamer->emitRawText("\t.section\t.debug_loc\t{\t}");
} }
// Output last DWARF .file directives, if any. // Output last DWARF .file directives, if any.
@ -1684,7 +1684,7 @@ void NVPTXAsmPrinter::setAndEmitFunctionVirtualRegisters(
} }
} }
OutStreamer->EmitRawText(O.str()); OutStreamer->emitRawText(O.str());
} }
void NVPTXAsmPrinter::printFPConstant(const ConstantFP *Fp, raw_ostream &O) { void NVPTXAsmPrinter::printFPConstant(const ConstantFP *Fp, raw_ostream &O) {

View File

@ -1623,7 +1623,7 @@ void PPCAIXAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
uint64_t Size = DL.getTypeAllocSize(GV->getType()->getElementType()); uint64_t Size = DL.getTypeAllocSize(GV->getType()->getElementType());
if (GVKind.isBSSLocal()) if (GVKind.isBSSLocal())
OutStreamer->EmitXCOFFLocalCommonSymbol( OutStreamer->emitXCOFFLocalCommonSymbol(
GVSym, Size, Csect->getQualNameSymbol(), Align); GVSym, Size, Csect->getQualNameSymbol(), Align);
else else
OutStreamer->emitCommonSymbol(Csect->getQualNameSymbol(), Size, Align); OutStreamer->emitCommonSymbol(Csect->getQualNameSymbol(), Size, Align);

View File

@ -643,7 +643,7 @@ void X86AsmPrinter::emitStartOfAsmFile(Module &M) {
OutStreamer->emitAssignment( OutStreamer->emitAssignment(
S, MCConstantExpr::create(Feat00Flags, MMI->getContext())); S, MCConstantExpr::create(Feat00Flags, MMI->getContext()));
} }
OutStreamer->EmitSyntaxDirective(); OutStreamer->emitSyntaxDirective();
// If this is not inline asm and we're in 16-bit // If this is not inline asm and we're in 16-bit
// mode prefix assembly with .code16. // mode prefix assembly with .code16.

View File

@ -158,7 +158,7 @@ void XCoreAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {
// The ABI requires that unsigned scalar types smaller than 32 bits // The ABI requires that unsigned scalar types smaller than 32 bits
// are padded to 32 bits. // are padded to 32 bits.
if (Size < 4) if (Size < 4)
OutStreamer->EmitZeros(4 - Size); OutStreamer->emitZeros(4 - Size);
// Mark the end of the global // Mark the end of the global
getTargetStreamer().emitCCBottomData(GVSym->getName()); getTargetStreamer().emitCCBottomData(GVSym->getName());
@ -267,7 +267,7 @@ void XCoreAsmPrinter::emitInstruction(const MachineInstr *MI) {
O << "\tmov " O << "\tmov "
<< XCoreInstPrinter::getRegisterName(MI->getOperand(0).getReg()) << ", " << XCoreInstPrinter::getRegisterName(MI->getOperand(0).getReg()) << ", "
<< XCoreInstPrinter::getRegisterName(MI->getOperand(1).getReg()); << XCoreInstPrinter::getRegisterName(MI->getOperand(1).getReg());
OutStreamer->EmitRawText(O.str()); OutStreamer->emitRawText(O.str());
return; return;
} }
break; break;
@ -280,7 +280,7 @@ void XCoreAsmPrinter::emitInstruction(const MachineInstr *MI) {
else else
printInlineJT32(MI, 0, O); printInlineJT32(MI, 0, O);
O << '\n'; O << '\n';
OutStreamer->EmitRawText(O.str()); OutStreamer->emitRawText(O.str());
return; return;
} }