1 //===- MCStreamer.h - High-level Streaming Machine Code Output --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the MCStreamer class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_MC_MCSTREAMER_H
15 #define LLVM_MC_MCSTREAMER_H
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/SmallVector.h"
19 #include "llvm/MC/MCDirectives.h"
20 #include "llvm/MC/MCDwarf.h"
21 #include "llvm/MC/MCWin64EH.h"
22 #include "llvm/Support/DataTypes.h"
37 class formatted_raw_ostream;
39 /// MCStreamer - Streaming machine code generation interface. This interface
40 /// is intended to provide a programatic interface that is very similar to the
41 /// level that an assembler .s file provides. It has callbacks to emit bytes,
42 /// handle directives, etc. The implementation of this interface retains
43 /// state to know what the current section is etc.
45 /// There are multiple implementations of this interface: one for writing out
46 /// a .s file, and implementations that write out .o files of various formats.
51 MCStreamer(const MCStreamer&) LLVM_DELETED_FUNCTION;
52 MCStreamer &operator=(const MCStreamer&) LLVM_DELETED_FUNCTION;
57 std::vector<MCDwarfFrameInfo> FrameInfos;
58 MCDwarfFrameInfo *getCurrentFrameInfo();
59 MCSymbol *EmitCFICommon();
60 void EnsureValidFrame();
62 std::vector<MCWin64EHUnwindInfo *> W64UnwindInfos;
63 MCWin64EHUnwindInfo *CurrentW64UnwindInfo;
64 void setCurrentW64UnwindInfo(MCWin64EHUnwindInfo *Frame);
65 void EnsureValidW64UnwindInfo();
69 /// SectionStack - This is stack of current and previous section
70 /// values saved by PushSection.
71 SmallVector<std::pair<const MCSection *,
72 const MCSection *>, 4> SectionStack;
74 bool AutoInitSections;
77 MCStreamer(MCContext &Ctx);
79 const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A,
82 const MCExpr *ForceExpAbs(const MCExpr* Expr);
84 void RecordProcStart(MCDwarfFrameInfo &Frame);
85 virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
86 void RecordProcEnd(MCDwarfFrameInfo &Frame);
87 virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame);
88 void EmitFrames(bool usingCFI);
90 MCWin64EHUnwindInfo *getCurrentW64UnwindInfo(){return CurrentW64UnwindInfo;}
94 virtual ~MCStreamer();
100 MCContext &getContext() const { return Context; }
102 unsigned getNumFrameInfos() {
103 return FrameInfos.size();
106 const MCDwarfFrameInfo &getFrameInfo(unsigned i) {
107 return FrameInfos[i];
110 ArrayRef<MCDwarfFrameInfo> getFrameInfos() {
114 unsigned getNumW64UnwindInfos() {
115 return W64UnwindInfos.size();
118 MCWin64EHUnwindInfo &getW64UnwindInfo(unsigned i) {
119 return *W64UnwindInfos[i];
122 /// @name Assembly File Formatting.
125 /// isVerboseAsm - Return true if this streamer supports verbose assembly
126 /// and if it is enabled.
127 virtual bool isVerboseAsm() const { return false; }
129 /// hasRawTextSupport - Return true if this asm streamer supports emitting
130 /// unformatted text to the .s file with EmitRawText.
131 virtual bool hasRawTextSupport() const { return false; }
133 /// AddComment - Add a comment that can be emitted to the generated .s
134 /// file if applicable as a QoI issue to make the output of the compiler
135 /// more readable. This only affects the MCAsmStreamer, and only when
136 /// verbose assembly output is enabled.
138 /// If the comment includes embedded \n's, they will each get the comment
139 /// prefix as appropriate. The added comment should not end with a \n.
140 virtual void AddComment(const Twine &T) {}
142 /// GetCommentOS - Return a raw_ostream that comments can be written to.
143 /// Unlike AddComment, you are required to terminate comments with \n if you
145 virtual raw_ostream &GetCommentOS();
147 /// AddBlankLine - Emit a blank line to a .s file to pretty it up.
148 virtual void AddBlankLine() {}
152 /// @name Symbol & Section Management
155 /// getCurrentSection - Return the current section that the streamer is
156 /// emitting code to.
157 const MCSection *getCurrentSection() const {
158 if (!SectionStack.empty())
159 return SectionStack.back().first;
163 /// getPreviousSection - Return the previous section that the streamer is
164 /// emitting code to.
165 const MCSection *getPreviousSection() const {
166 if (!SectionStack.empty())
167 return SectionStack.back().second;
171 /// ChangeSection - Update streamer for a new active section.
173 /// This is called by PopSection and SwitchSection, if the current
175 virtual void ChangeSection(const MCSection *) = 0;
177 /// pushSection - Save the current and previous section on the
180 SectionStack.push_back(std::make_pair(getCurrentSection(),
181 getPreviousSection()));
184 /// popSection - Restore the current and previous section from
185 /// the section stack. Calls ChangeSection as needed.
187 /// Returns false if the stack was empty.
189 if (SectionStack.size() <= 1)
191 const MCSection *oldSection = SectionStack.pop_back_val().first;
192 const MCSection *curSection = SectionStack.back().first;
194 if (oldSection != curSection)
195 ChangeSection(curSection);
199 /// SwitchSection - Set the current section where code is being emitted to
200 /// @p Section. This is required to update CurSection.
202 /// This corresponds to assembler directives like .section, .text, etc.
203 void SwitchSection(const MCSection *Section) {
204 assert(Section && "Cannot switch to a null section!");
205 const MCSection *curSection = SectionStack.back().first;
206 SectionStack.back().second = curSection;
207 if (Section != curSection) {
208 SectionStack.back().first = Section;
209 ChangeSection(Section);
213 /// SwitchSectionNoChange - Set the current section where code is being
214 /// emitted to @p Section. This is required to update CurSection. This
215 /// version does not call ChangeSection.
216 void SwitchSectionNoChange(const MCSection *Section) {
217 assert(Section && "Cannot switch to a null section!");
218 const MCSection *curSection = SectionStack.back().first;
219 SectionStack.back().second = curSection;
220 if (Section != curSection)
221 SectionStack.back().first = Section;
224 /// Initialize the streamer.
225 void InitStreamer() {
226 if (AutoInitSections)
230 /// Tell this MCStreamer to call InitSections upon initialization.
231 void setAutoInitSections(bool AutoInitSections) {
232 this->AutoInitSections = AutoInitSections;
235 /// InitSections - Create the default sections and set the initial one.
236 virtual void InitSections() = 0;
238 /// InitToTextSection - Create a text section and switch the streamer to it.
239 virtual void InitToTextSection() = 0;
241 /// EmitLabel - Emit a label for @p Symbol into the current section.
243 /// This corresponds to an assembler statement such as:
246 /// @param Symbol - The symbol to emit. A given symbol should only be
247 /// emitted as a label once, and symbols emitted as a label should never be
248 /// used in an assignment.
249 virtual void EmitLabel(MCSymbol *Symbol);
251 virtual void EmitDebugLabel(MCSymbol *Symbol);
253 virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
256 /// EmitAssemblerFlag - Note in the output the specified @p Flag.
257 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) = 0;
259 /// EmitLinkerOptions - Emit the given list @p Options of strings as linker
260 /// options into the output.
261 virtual void EmitLinkerOptions(ArrayRef<std::string> Kind) {}
263 /// EmitDataRegion - Note in the output the specified region @p Kind.
264 virtual void EmitDataRegion(MCDataRegionType Kind) {}
266 /// EmitThumbFunc - Note in the output that the specified @p Func is
267 /// a Thumb mode function (ARM target only).
268 virtual void EmitThumbFunc(MCSymbol *Func) = 0;
270 /// EmitAssignment - Emit an assignment of @p Value to @p Symbol.
272 /// This corresponds to an assembler statement such as:
275 /// The assignment generates no code, but has the side effect of binding the
276 /// value in the current context. For the assembly streamer, this prints the
277 /// binding into the .s file.
279 /// @param Symbol - The symbol being assigned to.
280 /// @param Value - The value for the symbol.
281 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) = 0;
283 /// EmitWeakReference - Emit an weak reference from @p Alias to @p Symbol.
285 /// This corresponds to an assembler statement such as:
286 /// .weakref alias, symbol
288 /// @param Alias - The alias that is being created.
289 /// @param Symbol - The symbol being aliased.
290 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) = 0;
292 /// EmitSymbolAttribute - Add the given @p Attribute to @p Symbol.
293 virtual void EmitSymbolAttribute(MCSymbol *Symbol,
294 MCSymbolAttr Attribute) = 0;
296 /// EmitSymbolDesc - Set the @p DescValue for the @p Symbol.
298 /// @param Symbol - The symbol to have its n_desc field set.
299 /// @param DescValue - The value to set into the n_desc field.
300 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) = 0;
302 /// BeginCOFFSymbolDef - Start emitting COFF symbol definition
304 /// @param Symbol - The symbol to have its External & Type fields set.
305 virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) = 0;
307 /// EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.
309 /// @param StorageClass - The storage class the symbol should have.
310 virtual void EmitCOFFSymbolStorageClass(int StorageClass) = 0;
312 /// EmitCOFFSymbolType - Emit the type of the symbol.
314 /// @param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
315 virtual void EmitCOFFSymbolType(int Type) = 0;
317 /// EndCOFFSymbolDef - Marks the end of the symbol definition.
318 virtual void EndCOFFSymbolDef() = 0;
320 /// EmitCOFFSecRel32 - Emits a COFF section relative relocation.
322 /// @param Symbol - Symbol the section relative realocation should point to.
323 virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
325 /// EmitELFSize - Emit an ELF .size directive.
327 /// This corresponds to an assembler statement such as:
328 /// .size symbol, expression
330 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) = 0;
332 /// EmitCommonSymbol - Emit a common symbol.
334 /// @param Symbol - The common symbol to emit.
335 /// @param Size - The size of the common symbol.
336 /// @param ByteAlignment - The alignment of the symbol if
337 /// non-zero. This must be a power of 2.
338 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
339 unsigned ByteAlignment) = 0;
341 /// EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
343 /// @param Symbol - The common symbol to emit.
344 /// @param Size - The size of the common symbol.
345 /// @param ByteAlignment - The alignment of the common symbol in bytes.
346 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
347 unsigned ByteAlignment) = 0;
349 /// EmitZerofill - Emit the zerofill section and an optional symbol.
351 /// @param Section - The zerofill section to create and or to put the symbol
352 /// @param Symbol - The zerofill symbol to emit, if non-NULL.
353 /// @param Size - The size of the zerofill symbol.
354 /// @param ByteAlignment - The alignment of the zerofill symbol if
355 /// non-zero. This must be a power of 2 on some targets.
356 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
357 uint64_t Size = 0,unsigned ByteAlignment = 0) = 0;
359 /// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
361 /// @param Section - The thread local common section.
362 /// @param Symbol - The thread local common symbol to emit.
363 /// @param Size - The size of the symbol.
364 /// @param ByteAlignment - The alignment of the thread local common symbol
365 /// if non-zero. This must be a power of 2 on some targets.
366 virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
367 uint64_t Size, unsigned ByteAlignment = 0) = 0;
370 /// @name Generating Data
373 /// EmitBytes - Emit the bytes in \p Data into the output.
375 /// This is used to implement assembler directives such as .byte, .ascii,
377 virtual void EmitBytes(StringRef Data, unsigned AddrSpace = 0) = 0;
379 /// EmitValue - Emit the expression @p Value into the output as a native
380 /// integer of the given @p Size bytes.
382 /// This is used to implement assembler directives such as .word, .quad,
385 /// @param Value - The value to emit.
386 /// @param Size - The size of the integer (in bytes) to emit. This must
387 /// match a native machine width.
388 virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
389 unsigned AddrSpace) = 0;
391 void EmitValue(const MCExpr *Value, unsigned Size, unsigned AddrSpace = 0);
393 /// EmitIntValue - Special case of EmitValue that avoids the client having
394 /// to pass in a MCExpr for constant integers.
395 virtual void EmitIntValue(uint64_t Value, unsigned Size,
396 unsigned AddrSpace = 0);
398 /// EmitAbsValue - Emit the Value, but try to avoid relocations. On MachO
399 /// this is done by producing
402 void EmitAbsValue(const MCExpr *Value, unsigned Size,
403 unsigned AddrSpace = 0);
405 virtual void EmitULEB128Value(const MCExpr *Value) = 0;
407 virtual void EmitSLEB128Value(const MCExpr *Value) = 0;
409 /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
410 /// client having to pass in a MCExpr for constant integers.
411 void EmitULEB128IntValue(uint64_t Value, unsigned Padding = 0,
412 unsigned AddrSpace = 0);
414 /// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
415 /// client having to pass in a MCExpr for constant integers.
416 void EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace = 0);
418 /// EmitSymbolValue - Special case of EmitValue that avoids the client
419 /// having to pass in a MCExpr for MCSymbols.
420 void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
421 unsigned AddrSpace = 0);
423 /// EmitGPRel64Value - Emit the expression @p Value into the output as a
424 /// gprel64 (64-bit GP relative) value.
426 /// This is used to implement assembler directives such as .gpdword on
427 /// targets that support them.
428 virtual void EmitGPRel64Value(const MCExpr *Value);
430 /// EmitGPRel32Value - Emit the expression @p Value into the output as a
431 /// gprel32 (32-bit GP relative) value.
433 /// This is used to implement assembler directives such as .gprel32 on
434 /// targets that support them.
435 virtual void EmitGPRel32Value(const MCExpr *Value);
437 /// EmitFill - Emit NumBytes bytes worth of the value specified by
438 /// FillValue. This implements directives such as '.space'.
439 virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue,
440 unsigned AddrSpace = 0);
442 /// EmitZeros - Emit NumBytes worth of zeros. This is a convenience
443 /// function that just wraps EmitFill.
444 void EmitZeros(uint64_t NumBytes, unsigned AddrSpace = 0) {
445 EmitFill(NumBytes, 0, AddrSpace);
448 /// EmitValueToAlignment - Emit some number of copies of @p Value until
449 /// the byte alignment @p ByteAlignment is reached.
451 /// If the number of bytes need to emit for the alignment is not a multiple
452 /// of @p ValueSize, then the contents of the emitted fill bytes is
455 /// This used to implement the .align assembler directive.
457 /// @param ByteAlignment - The alignment to reach. This must be a power of
458 /// two on some targets.
459 /// @param Value - The value to use when filling bytes.
460 /// @param ValueSize - The size of the integer (in bytes) to emit for
461 /// @p Value. This must match a native machine width.
462 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
463 /// the alignment cannot be reached in this many bytes, no bytes are
465 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
466 unsigned ValueSize = 1,
467 unsigned MaxBytesToEmit = 0) = 0;
469 /// EmitCodeAlignment - Emit nops until the byte alignment @p ByteAlignment
472 /// This used to align code where the alignment bytes may be executed. This
473 /// can emit different bytes for different sizes to optimize execution.
475 /// @param ByteAlignment - The alignment to reach. This must be a power of
476 /// two on some targets.
477 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
478 /// the alignment cannot be reached in this many bytes, no bytes are
480 virtual void EmitCodeAlignment(unsigned ByteAlignment,
481 unsigned MaxBytesToEmit = 0) = 0;
483 /// EmitValueToOffset - Emit some number of copies of @p Value until the
484 /// byte offset @p Offset is reached.
486 /// This is used to implement assembler directives such as .org.
488 /// @param Offset - The offset to reach. This may be an expression, but the
489 /// expression must be associated with the current section.
490 /// @param Value - The value to use when filling bytes.
491 /// @return false on success, true if the offset was invalid.
492 virtual bool EmitValueToOffset(const MCExpr *Offset,
493 unsigned char Value = 0) = 0;
497 /// EmitFileDirective - Switch to a new logical file. This is used to
498 /// implement the '.file "foo.c"' assembler directive.
499 virtual void EmitFileDirective(StringRef Filename) = 0;
501 /// EmitDwarfFileDirective - Associate a filename with a specified logical
502 /// file number. This implements the DWARF2 '.file 4 "foo.c"' assembler
504 virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
507 /// EmitDwarfLocDirective - This implements the DWARF2
508 // '.loc fileno lineno ...' assembler directive.
509 virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
510 unsigned Column, unsigned Flags,
512 unsigned Discriminator,
515 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
516 const MCSymbol *LastLabel,
517 const MCSymbol *Label,
518 unsigned PointerSize) = 0;
520 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
521 const MCSymbol *Label) {
524 void EmitDwarfSetLineAddr(int64_t LineDelta, const MCSymbol *Label,
527 virtual void EmitCompactUnwindEncoding(uint32_t CompactUnwindEncoding);
528 virtual void EmitCFISections(bool EH, bool Debug);
529 void EmitCFIStartProc();
530 void EmitCFIEndProc();
531 virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
532 virtual void EmitCFIDefCfaOffset(int64_t Offset);
533 virtual void EmitCFIDefCfaRegister(int64_t Register);
534 virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
535 virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
536 virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
537 virtual void EmitCFIRememberState();
538 virtual void EmitCFIRestoreState();
539 virtual void EmitCFISameValue(int64_t Register);
540 virtual void EmitCFIRestore(int64_t Register);
541 virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
542 virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
543 virtual void EmitCFIEscape(StringRef Values);
544 virtual void EmitCFISignalFrame();
545 virtual void EmitCFIUndefined(int64_t Register);
546 virtual void EmitCFIRegister(int64_t Register1, int64_t Register2);
548 virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
549 virtual void EmitWin64EHEndProc();
550 virtual void EmitWin64EHStartChained();
551 virtual void EmitWin64EHEndChained();
552 virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
554 virtual void EmitWin64EHHandlerData();
555 virtual void EmitWin64EHPushReg(unsigned Register);
556 virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
557 virtual void EmitWin64EHAllocStack(unsigned Size);
558 virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
559 virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
560 virtual void EmitWin64EHPushFrame(bool Code);
561 virtual void EmitWin64EHEndProlog();
563 /// EmitInstruction - Emit the given @p Instruction into the current
565 virtual void EmitInstruction(const MCInst &Inst) = 0;
567 /// \brief Set the bundle alignment mode from now on in the section.
568 /// The argument is the power of 2 to which the alignment is set. The
569 /// value 0 means turn the bundle alignment off.
570 virtual void EmitBundleAlignMode(unsigned AlignPow2) = 0;
572 /// \brief The following instructions are a bundle-locked group.
574 /// \param AlignToEnd - If true, the bundle-locked group will be aligned to
575 /// the end of a bundle.
576 virtual void EmitBundleLock(bool AlignToEnd) = 0;
578 /// \brief Ends a bundle-locked group.
579 virtual void EmitBundleUnlock() = 0;
581 /// EmitRawText - If this file is backed by a assembly streamer, this dumps
582 /// the specified string in the output .s file. This capability is
583 /// indicated by the hasRawTextSupport() predicate. By default this aborts.
584 virtual void EmitRawText(StringRef String);
585 void EmitRawText(const Twine &String);
587 /// ARM-related methods.
588 /// FIXME: Eventually we should have some "target MC streamer" and move
589 /// these methods there.
590 virtual void EmitFnStart();
591 virtual void EmitFnEnd();
592 virtual void EmitCantUnwind();
593 virtual void EmitPersonality(const MCSymbol *Personality);
594 virtual void EmitHandlerData();
595 virtual void EmitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0);
596 virtual void EmitPad(int64_t Offset);
597 virtual void EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
600 /// PPC-related methods.
601 /// FIXME: Eventually replace it with some "target MC streamer" and move
602 /// these methods there.
603 virtual void EmitTCEntry(const MCSymbol &S);
605 /// FinishImpl - Streamer specific finalization.
606 virtual void FinishImpl() = 0;
607 /// Finish - Finish emission of machine code.
611 /// createNullStreamer - Create a dummy machine code streamer, which does
612 /// nothing. This is useful for timing the assembler front end.
613 MCStreamer *createNullStreamer(MCContext &Ctx);
615 /// createAsmStreamer - Create a machine code streamer which will print out
616 /// assembly for the native target, suitable for compiling with a native
619 /// \param InstPrint - If given, the instruction printer to use. If not given
620 /// the MCInst representation will be printed. This method takes ownership of
623 /// \param CE - If given, a code emitter to use to show the instruction
624 /// encoding inline with the assembly. This method takes ownership of \p CE.
626 /// \param TAB - If given, a target asm backend to use to show the fixup
627 /// information in conjunction with encoding information. This method takes
628 /// ownership of \p TAB.
630 /// \param ShowInst - Whether to show the MCInst representation inline with
632 MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
636 bool useDwarfDirectory,
637 MCInstPrinter *InstPrint = 0,
638 MCCodeEmitter *CE = 0,
639 MCAsmBackend *TAB = 0,
640 bool ShowInst = false);
642 /// createMachOStreamer - Create a machine code streamer which will generate
643 /// Mach-O format object files.
645 /// Takes ownership of \p TAB and \p CE.
646 MCStreamer *createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB,
647 raw_ostream &OS, MCCodeEmitter *CE,
648 bool RelaxAll = false);
650 /// createWinCOFFStreamer - Create a machine code streamer which will
651 /// generate Microsoft COFF format object files.
653 /// Takes ownership of \p TAB and \p CE.
654 MCStreamer *createWinCOFFStreamer(MCContext &Ctx,
656 MCCodeEmitter &CE, raw_ostream &OS,
657 bool RelaxAll = false);
659 /// createELFStreamer - Create a machine code streamer which will generate
660 /// ELF format object files.
661 MCStreamer *createELFStreamer(MCContext &Ctx, MCAsmBackend &TAB,
662 raw_ostream &OS, MCCodeEmitter *CE,
663 bool RelaxAll, bool NoExecStack);
665 /// createPureStreamer - Create a machine code streamer which will generate
666 /// "pure" MC object files, for use with MC-JIT and testing tools.
668 /// Takes ownership of \p TAB and \p CE.
669 MCStreamer *createPureStreamer(MCContext &Ctx, MCAsmBackend &TAB,
670 raw_ostream &OS, MCCodeEmitter *CE);
672 } // end namespace llvm