MCStreamer *llvm::createMachOStreamer(MCContext &Context, MCAsmBackend &MAB, raw_ostream &OS, MCCodeEmitter *CE, bool RelaxAll, bool LabelSections) { MCMachOStreamer *S = new MCMachOStreamer(Context, MAB, OS, CE, LabelSections); const Triple &TT = Context.getObjectFileInfo()->getTargetTriple(); if (TT.isOSDarwin()) { unsigned Major, Minor, Update; TT.getOSVersion(Major, Minor, Update); // If there is a version specified, Major will be non-zero. if (Major) { MCVersionMinType VersionType; if (TT.isWatchOS()) VersionType = MCVM_WatchOSVersionMin; else if (TT.isMacOSX()) VersionType = MCVM_OSXVersionMin; else { assert(TT.isiOS() && "Must only be iOS platform left"); VersionType = MCVM_IOSVersionMin; } S->EmitVersionMin(VersionType, Major, Minor, Update); } } if (RelaxAll) S->getAssembler().setRelaxAll(true); return S; }
MCStreamer *llvm::createMachOStreamer(MCContext &Context, TargetAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *CE, bool RelaxAll) { MCMachOStreamer *S = new MCMachOStreamer(Context, TAB, OS, CE); if (RelaxAll) S->getAssembler().setRelaxAll(true); return S; }
MCStreamer *llvm::createMachOStreamer(MCContext &Context, MCAsmBackend &MAB, raw_ostream &OS, MCCodeEmitter *CE, bool RelaxAll, bool LabelSections) { MCMachOStreamer *S = new MCMachOStreamer(Context, MAB, OS, CE, LabelSections); if (RelaxAll) S->getAssembler().setRelaxAll(true); return S; }
MCStreamer *llvm::createMachOStreamer(MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *CE, bool RelaxAll, bool DWARFMustBeAtTheEnd, bool LabelSections) { MCMachOStreamer *S = new MCMachOStreamer(Context, MAB, OS, CE, DWARFMustBeAtTheEnd, LabelSections); const Triple &TT = Context.getObjectFileInfo()->getTargetTriple(); if (TT.isOSDarwin()) { unsigned Major, Minor, Update; TT.getOSVersion(Major, Minor, Update); // If there is a version specified, Major will be non-zero. if (Major) S->EmitVersionMin((TT.isMacOSX() ? MCVM_OSXVersionMin : MCVM_IOSVersionMin), Major, Minor, Update); } if (RelaxAll) S->getAssembler().setRelaxAll(true); return S; }