#include "llvm/MC/MCELFStreamer.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCFragment.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolELF.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <cstdint>
usingnamespacellvm;
MCELFStreamer::MCELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> TAB,
std::unique_ptr<MCObjectWriter> OW,
std::unique_ptr<MCCodeEmitter> Emitter)
: … { … }
ELFObjectWriter &MCELFStreamer::getWriter() { … }
bool MCELFStreamer::isBundleLocked() const { … }
void MCELFStreamer::initSections(bool NoExecStack, const MCSubtargetInfo &STI) { … }
void MCELFStreamer::emitLabel(MCSymbol *S, SMLoc Loc) { … }
void MCELFStreamer::emitLabelAtPos(MCSymbol *S, SMLoc Loc, MCDataFragment &F,
uint64_t Offset) { … }
void MCELFStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) { … }
static void setSectionAlignmentForBundling(const MCAssembler &Assembler,
MCSection *Section) { … }
void MCELFStreamer::changeSection(MCSection *Section, uint32_t Subsection) { … }
void MCELFStreamer::emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) { … }
static unsigned CombineSymbolTypes(unsigned T1, unsigned T2) { … }
bool MCELFStreamer::emitSymbolAttribute(MCSymbol *S, MCSymbolAttr Attribute) { … }
void MCELFStreamer::emitCommonSymbol(MCSymbol *S, uint64_t Size,
Align ByteAlignment) { … }
void MCELFStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) { … }
void MCELFStreamer::emitELFSymverDirective(const MCSymbol *OriginalSym,
StringRef Name,
bool KeepOriginalSym) { … }
void MCELFStreamer::emitLocalCommonSymbol(MCSymbol *S, uint64_t Size,
Align ByteAlignment) { … }
void MCELFStreamer::emitValueImpl(const MCExpr *Value, unsigned Size,
SMLoc Loc) { … }
void MCELFStreamer::emitValueToAlignment(Align Alignment, int64_t Value,
unsigned ValueSize,
unsigned MaxBytesToEmit) { … }
void MCELFStreamer::emitCGProfileEntry(const MCSymbolRefExpr *From,
const MCSymbolRefExpr *To,
uint64_t Count) { … }
void MCELFStreamer::emitIdent(StringRef IdentString) { … }
void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) { … }
void MCELFStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE,
uint64_t Offset) { … }
void MCELFStreamer::finalizeCGProfile() { … }
void MCELFStreamer::emitInstToFragment(const MCInst &Inst,
const MCSubtargetInfo &STI) { … }
static void CheckBundleSubtargets(const MCSubtargetInfo *OldSTI,
const MCSubtargetInfo *NewSTI) { … }
void MCELFStreamer::emitInstToData(const MCInst &Inst,
const MCSubtargetInfo &STI) { … }
void MCELFStreamer::emitBundleAlignMode(Align Alignment) { … }
void MCELFStreamer::emitBundleLock(bool AlignToEnd) { … }
void MCELFStreamer::emitBundleUnlock() { … }
void MCELFStreamer::finishImpl() { … }
void MCELFStreamer::emitThumbFunc(MCSymbol *Func) { … }
void MCELFStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { … }
void MCELFStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, Align ByteAlignment,
SMLoc Loc) { … }
void MCELFStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, Align ByteAlignment) { … }
void MCELFStreamer::setAttributeItem(unsigned Attribute, unsigned Value,
bool OverwriteExisting) { … }
void MCELFStreamer::setAttributeItem(unsigned Attribute, StringRef Value,
bool OverwriteExisting) { … }
void MCELFStreamer::setAttributeItems(unsigned Attribute, unsigned IntValue,
StringRef StringValue,
bool OverwriteExisting) { … }
MCELFStreamer::AttributeItem *
MCELFStreamer::getAttributeItem(unsigned Attribute) { … }
size_t
MCELFStreamer::calculateContentSize(SmallVector<AttributeItem, 64> &AttrsVec) { … }
void MCELFStreamer::createAttributesSection(
StringRef Vendor, const Twine &Section, unsigned Type,
MCSection *&AttributeSection, SmallVector<AttributeItem, 64> &AttrsVec) { … }
MCStreamer *llvm::createELFStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
std::unique_ptr<MCObjectWriter> &&OW,
std::unique_ptr<MCCodeEmitter> &&CE) { … }