#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCFixup.h"
#include "llvm/MC/MCFragment.h"
#include "llvm/MC/MCLinkerOptimizationHint.h"
#include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolMachO.h"
#include "llvm/MC/MCValue.h"
#include "llvm/MC/SectionKind.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <vector>
namespace llvm {
class MCInst;
class MCStreamer;
class MCSubtargetInfo;
class Triple;
}
usingnamespacellvm;
namespace {
class MCMachOStreamer : public MCObjectStreamer { … };
}
void MCMachOStreamer::changeSection(MCSection *Section, uint32_t Subsection) { … }
void MCMachOStreamer::emitEHSymAttributes(const MCSymbol *Symbol,
MCSymbol *EHSymbol) { … }
void MCMachOStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) { … }
void MCMachOStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) { … }
void MCMachOStreamer::emitDataRegion(MachO::DataRegionType Kind) { … }
void MCMachOStreamer::emitDataRegionEnd() { … }
void MCMachOStreamer::emitAssemblerFlag(MCAssemblerFlag Flag) { … }
void MCMachOStreamer::emitLinkerOptions(ArrayRef<std::string> Options) { … }
void MCMachOStreamer::emitDataRegion(MCDataRegionType Kind) { … }
void MCMachOStreamer::emitVersionMin(MCVersionMinType Kind, unsigned Major,
unsigned Minor, unsigned Update,
VersionTuple SDKVersion) { … }
void MCMachOStreamer::emitBuildVersion(unsigned Platform, unsigned Major,
unsigned Minor, unsigned Update,
VersionTuple SDKVersion) { … }
void MCMachOStreamer::emitDarwinTargetVariantBuildVersion(
unsigned Platform, unsigned Major, unsigned Minor, unsigned Update,
VersionTuple SDKVersion) { … }
void MCMachOStreamer::emitThumbFunc(MCSymbol *Symbol) { … }
bool MCMachOStreamer::emitSymbolAttribute(MCSymbol *Sym,
MCSymbolAttr Attribute) { … }
void MCMachOStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { … }
void MCMachOStreamer::emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Align ByteAlignment) { … }
void MCMachOStreamer::emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Align ByteAlignment) { … }
void MCMachOStreamer::emitZerofill(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, Align ByteAlignment,
SMLoc Loc) { … }
void MCMachOStreamer::emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
uint64_t Size, Align ByteAlignment) { … }
void MCMachOStreamer::emitInstToData(const MCInst &Inst,
const MCSubtargetInfo &STI) { … }
void MCMachOStreamer::finishImpl() { … }
void MCMachOStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) { … }
void MCMachOStreamer::finalizeCGProfile() { … }
MCStreamer *llvm::createMachOStreamer(MCContext &Context,
std::unique_ptr<MCAsmBackend> &&MAB,
std::unique_ptr<MCObjectWriter> &&OW,
std::unique_ptr<MCCodeEmitter> &&CE,
bool DWARFMustBeAtTheEnd,
bool LabelSections) { … }
void MCMachOStreamer::createAddrSigSection() { … }