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/Support/DataTypes.h"
18 #include "llvm/MC/MCDirectives.h"
19 #include "llvm/MC/MCDwarf.h"
20 #include "llvm/MC/MCWin64EH.h"
21 #include "llvm/ADT/ArrayRef.h"
22 #include "llvm/ADT/SmallVector.h"
35 class TargetLoweringObjectFile;
38 class formatted_raw_ostream;
40 /// MCStreamer - Streaming machine code generation interface. This interface
41 /// is intended to provide a programatic interface that is very similar to the
42 /// level that an assembler .s file provides. It has callbacks to emit bytes,
43 /// handle directives, etc. The implementation of this interface retains
44 /// state to know what the current section is etc.
46 /// There are multiple implementations of this interface: one for writing out
47 /// a .s file, and implementations that write out .o files of various formats.
52 MCStreamer(const MCStreamer&); // DO NOT IMPLEMENT
53 MCStreamer &operator=(const MCStreamer&); // DO NOT IMPLEMENT
58 std::vector<MCDwarfFrameInfo> FrameInfos;
59 MCDwarfFrameInfo *getCurrentFrameInfo();
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 unsigned UniqueCodeBeginSuffix;
75 unsigned UniqueDataBeginSuffix;
78 /// Indicator of whether the previous data-or-code indicator was for
79 /// code or not. Used to determine when we need to emit a new indicator.
87 DataType RegionIndicator;
90 MCStreamer(MCContext &Ctx);
92 const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A,
95 const MCExpr *ForceExpAbs(const MCExpr* Expr);
97 void RecordProcStart(MCDwarfFrameInfo &Frame);
98 virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
99 void RecordProcEnd(MCDwarfFrameInfo &Frame);
100 virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame);
101 void EmitFrames(bool usingCFI);
103 MCWin64EHUnwindInfo *getCurrentW64UnwindInfo(){return CurrentW64UnwindInfo;}
104 void EmitW64Tables();
107 virtual ~MCStreamer();
109 MCContext &getContext() const { return Context; }
111 unsigned getNumFrameInfos() {
112 return FrameInfos.size();
115 const MCDwarfFrameInfo &getFrameInfo(unsigned i) {
116 return FrameInfos[i];
119 ArrayRef<MCDwarfFrameInfo> getFrameInfos() {
123 unsigned getNumW64UnwindInfos() {
124 return W64UnwindInfos.size();
127 MCWin64EHUnwindInfo &getW64UnwindInfo(unsigned i) {
128 return *W64UnwindInfos[i];
131 /// @name Assembly File Formatting.
134 /// isVerboseAsm - Return true if this streamer supports verbose assembly
135 /// and if it is enabled.
136 virtual bool isVerboseAsm() const { return false; }
138 /// hasRawTextSupport - Return true if this asm streamer supports emitting
139 /// unformatted text to the .s file with EmitRawText.
140 virtual bool hasRawTextSupport() const { return false; }
142 /// AddComment - Add a comment that can be emitted to the generated .s
143 /// file if applicable as a QoI issue to make the output of the compiler
144 /// more readable. This only affects the MCAsmStreamer, and only when
145 /// verbose assembly output is enabled.
147 /// If the comment includes embedded \n's, they will each get the comment
148 /// prefix as appropriate. The added comment should not end with a \n.
149 virtual void AddComment(const Twine &T) {}
151 /// GetCommentOS - Return a raw_ostream that comments can be written to.
152 /// Unlike AddComment, you are required to terminate comments with \n if you
154 virtual raw_ostream &GetCommentOS();
156 /// AddBlankLine - Emit a blank line to a .s file to pretty it up.
157 virtual void AddBlankLine() {}
161 /// @name Symbol & Section Management
164 /// getCurrentSection - Return the current section that the streamer is
165 /// emitting code to.
166 const MCSection *getCurrentSection() const {
167 if (!SectionStack.empty())
168 return SectionStack.back().first;
172 /// getPreviousSection - Return the previous section that the streamer is
173 /// emitting code to.
174 const MCSection *getPreviousSection() const {
175 if (!SectionStack.empty())
176 return SectionStack.back().second;
180 /// ChangeSection - Update streamer for a new active section.
182 /// This is called by PopSection and SwitchSection, if the current
184 virtual void ChangeSection(const MCSection *) = 0;
186 /// pushSection - Save the current and previous section on the
189 SectionStack.push_back(std::make_pair(getCurrentSection(),
190 getPreviousSection()));
193 /// popSection - Restore the current and previous section from
194 /// the section stack. Calls ChangeSection as needed.
196 /// Returns false if the stack was empty.
198 if (SectionStack.size() <= 1)
200 const MCSection *oldSection = SectionStack.pop_back_val().first;
201 const MCSection *curSection = SectionStack.back().first;
203 if (oldSection != curSection)
204 ChangeSection(curSection);
208 /// SwitchSection - Set the current section where code is being emitted to
209 /// @p Section. This is required to update CurSection.
211 /// This corresponds to assembler directives like .section, .text, etc.
212 void SwitchSection(const MCSection *Section) {
213 assert(Section && "Cannot switch to a null section!");
214 const MCSection *curSection = SectionStack.back().first;
215 SectionStack.back().second = curSection;
216 if (Section != curSection) {
217 SectionStack.back().first = Section;
218 ChangeSection(Section);
222 /// SwitchSectionNoChange - Set the current section where code is being
223 /// emitted to @p Section. This is required to update CurSection. This
224 /// version does not call ChangeSection.
225 void SwitchSectionNoChange(const MCSection *Section) {
226 assert(Section && "Cannot switch to a null section!");
227 const MCSection *curSection = SectionStack.back().first;
228 SectionStack.back().second = curSection;
229 if (Section != curSection)
230 SectionStack.back().first = Section;
233 /// InitSections - Create the default sections and set the initial one.
234 virtual void InitSections() = 0;
236 /// EmitLabel - Emit a label for @p Symbol into the current section.
238 /// This corresponds to an assembler statement such as:
241 /// @param Symbol - The symbol to emit. A given symbol should only be
242 /// emitted as a label once, and symbols emitted as a label should never be
243 /// used in an assignment.
244 virtual void EmitLabel(MCSymbol *Symbol);
246 /// EmitDataRegion - Emit a label that marks the beginning of a data
248 /// On ELF targets, this corresponds to an assembler statement such as:
250 virtual void EmitDataRegion();
252 /// EmitJumpTable8Region - Emit a label that marks the beginning of a
253 /// jump table composed of 8-bit offsets.
254 /// On ELF targets, this corresponds to an assembler statement such as:
256 virtual void EmitJumpTable8Region();
258 /// EmitJumpTable16Region - Emit a label that marks the beginning of a
259 /// jump table composed of 16-bit offsets.
260 /// On ELF targets, this corresponds to an assembler statement such as:
262 virtual void EmitJumpTable16Region();
264 /// EmitJumpTable32Region - Emit a label that marks the beginning of a
265 /// jump table composed of 32-bit offsets.
266 /// On ELF targets, this corresponds to an assembler statement such as:
268 virtual void EmitJumpTable32Region();
270 /// EmitCodeRegion - Emit a label that marks the beginning of a code
272 /// On ELF targets, this corresponds to an assembler statement such as:
274 virtual void EmitCodeRegion();
276 /// ForceCodeRegion - Forcibly sets the current region mode to code. Used
277 /// at function entry points.
278 void ForceCodeRegion() { RegionIndicator = Code; }
281 virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
284 /// EmitAssemblerFlag - Note in the output the specified @p Flag
285 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) = 0;
287 /// EmitThumbFunc - Note in the output that the specified @p Func is
288 /// a Thumb mode function (ARM target only).
289 virtual void EmitThumbFunc(MCSymbol *Func) = 0;
291 /// EmitAssignment - Emit an assignment of @p Value to @p Symbol.
293 /// This corresponds to an assembler statement such as:
296 /// The assignment generates no code, but has the side effect of binding the
297 /// value in the current context. For the assembly streamer, this prints the
298 /// binding into the .s file.
300 /// @param Symbol - The symbol being assigned to.
301 /// @param Value - The value for the symbol.
302 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) = 0;
304 /// EmitWeakReference - Emit an weak reference from @p Alias to @p Symbol.
306 /// This corresponds to an assembler statement such as:
307 /// .weakref alias, symbol
309 /// @param Alias - The alias that is being created.
310 /// @param Symbol - The symbol being aliased.
311 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) = 0;
313 /// EmitSymbolAttribute - Add the given @p Attribute to @p Symbol.
314 virtual void EmitSymbolAttribute(MCSymbol *Symbol,
315 MCSymbolAttr Attribute) = 0;
317 /// EmitSymbolDesc - Set the @p DescValue for the @p Symbol.
319 /// @param Symbol - The symbol to have its n_desc field set.
320 /// @param DescValue - The value to set into the n_desc field.
321 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) = 0;
323 /// BeginCOFFSymbolDef - Start emitting COFF symbol definition
325 /// @param Symbol - The symbol to have its External & Type fields set.
326 virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) = 0;
328 /// EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.
330 /// @param StorageClass - The storage class the symbol should have.
331 virtual void EmitCOFFSymbolStorageClass(int StorageClass) = 0;
333 /// EmitCOFFSymbolType - Emit the type of the symbol.
335 /// @param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
336 virtual void EmitCOFFSymbolType(int Type) = 0;
338 /// EndCOFFSymbolDef - Marks the end of the symbol definition.
339 virtual void EndCOFFSymbolDef() = 0;
341 /// EmitCOFFSecRel32 - Emits a COFF section relative relocation.
343 /// @param Symbol - Symbol the section relative realocation should point to.
344 virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
346 /// EmitELFSize - Emit an ELF .size directive.
348 /// This corresponds to an assembler statement such as:
349 /// .size symbol, expression
351 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) = 0;
353 /// EmitCommonSymbol - Emit a common symbol.
355 /// @param Symbol - The common symbol to emit.
356 /// @param Size - The size of the common symbol.
357 /// @param ByteAlignment - The alignment of the symbol if
358 /// non-zero. This must be a power of 2.
359 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
360 unsigned ByteAlignment) = 0;
362 /// EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
364 /// @param Symbol - The common symbol to emit.
365 /// @param Size - The size of the common symbol.
366 /// @param ByteAlignment - The alignment of the common symbol in bytes.
367 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
368 unsigned ByteAlignment) = 0;
370 /// EmitZerofill - Emit the zerofill section and an optional symbol.
372 /// @param Section - The zerofill section to create and or to put the symbol
373 /// @param Symbol - The zerofill symbol to emit, if non-NULL.
374 /// @param Size - The size of the zerofill symbol.
375 /// @param ByteAlignment - The alignment of the zerofill symbol if
376 /// non-zero. This must be a power of 2 on some targets.
377 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
378 unsigned Size = 0,unsigned ByteAlignment = 0) = 0;
380 /// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
382 /// @param Section - The thread local common section.
383 /// @param Symbol - The thread local common symbol to emit.
384 /// @param Size - The size of the symbol.
385 /// @param ByteAlignment - The alignment of the thread local common symbol
386 /// if non-zero. This must be a power of 2 on some targets.
387 virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
388 uint64_t Size, unsigned ByteAlignment = 0) = 0;
391 /// @name Generating Data
394 /// EmitBytes - Emit the bytes in \arg Data into the output.
396 /// This is used to implement assembler directives such as .byte, .ascii,
398 virtual void EmitBytes(StringRef Data, unsigned AddrSpace) = 0;
400 /// EmitValue - Emit the expression @p Value into the output as a native
401 /// integer of the given @p Size bytes.
403 /// This is used to implement assembler directives such as .word, .quad,
406 /// @param Value - The value to emit.
407 /// @param Size - The size of the integer (in bytes) to emit. This must
408 /// match a native machine width.
409 virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
410 unsigned AddrSpace) = 0;
412 void EmitValue(const MCExpr *Value, unsigned Size, unsigned AddrSpace = 0);
414 /// EmitIntValue - Special case of EmitValue that avoids the client having
415 /// to pass in a MCExpr for constant integers.
416 virtual void EmitIntValue(uint64_t Value, unsigned Size,
417 unsigned AddrSpace = 0);
419 /// EmitAbsValue - Emit the Value, but try to avoid relocations. On MachO
420 /// this is done by producing
423 void EmitAbsValue(const MCExpr *Value, unsigned Size,
424 unsigned AddrSpace = 0);
426 virtual void EmitULEB128Value(const MCExpr *Value) = 0;
428 virtual void EmitSLEB128Value(const MCExpr *Value) = 0;
430 /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
431 /// client having to pass in a MCExpr for constant integers.
432 void EmitULEB128IntValue(uint64_t Value, unsigned AddrSpace = 0,
433 unsigned Padding = 0);
435 /// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
436 /// client having to pass in a MCExpr for constant integers.
437 void EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace = 0);
439 /// EmitSymbolValue - Special case of EmitValue that avoids the client
440 /// having to pass in a MCExpr for MCSymbols.
441 void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
442 unsigned AddrSpace = 0);
444 /// EmitGPRel64Value - Emit the expression @p Value into the output as a
445 /// gprel64 (64-bit GP relative) value.
447 /// This is used to implement assembler directives such as .gpdword on
448 /// targets that support them.
449 virtual void EmitGPRel64Value(const MCExpr *Value);
451 /// EmitGPRel32Value - Emit the expression @p Value into the output as a
452 /// gprel32 (32-bit GP relative) value.
454 /// This is used to implement assembler directives such as .gprel32 on
455 /// targets that support them.
456 virtual void EmitGPRel32Value(const MCExpr *Value);
458 /// EmitFill - Emit NumBytes bytes worth of the value specified by
459 /// FillValue. This implements directives such as '.space'.
460 virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue,
463 /// EmitZeros - Emit NumBytes worth of zeros. This is a convenience
464 /// function that just wraps EmitFill.
465 void EmitZeros(uint64_t NumBytes, unsigned AddrSpace) {
466 EmitFill(NumBytes, 0, AddrSpace);
470 /// EmitValueToAlignment - Emit some number of copies of @p Value until
471 /// the byte alignment @p ByteAlignment is reached.
473 /// If the number of bytes need to emit for the alignment is not a multiple
474 /// of @p ValueSize, then the contents of the emitted fill bytes is
477 /// This used to implement the .align assembler directive.
479 /// @param ByteAlignment - The alignment to reach. This must be a power of
480 /// two on some targets.
481 /// @param Value - The value to use when filling bytes.
482 /// @param ValueSize - The size of the integer (in bytes) to emit for
483 /// @p Value. This must match a native machine width.
484 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
485 /// the alignment cannot be reached in this many bytes, no bytes are
487 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
488 unsigned ValueSize = 1,
489 unsigned MaxBytesToEmit = 0) = 0;
491 /// EmitCodeAlignment - Emit nops until the byte alignment @p ByteAlignment
494 /// This used to align code where the alignment bytes may be executed. This
495 /// can emit different bytes for different sizes to optimize execution.
497 /// @param ByteAlignment - The alignment to reach. This must be a power of
498 /// two on some targets.
499 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
500 /// the alignment cannot be reached in this many bytes, no bytes are
502 virtual void EmitCodeAlignment(unsigned ByteAlignment,
503 unsigned MaxBytesToEmit = 0) = 0;
505 /// EmitValueToOffset - Emit some number of copies of @p Value until the
506 /// byte offset @p Offset is reached.
508 /// This is used to implement assembler directives such as .org.
510 /// @param Offset - The offset to reach. This may be an expression, but the
511 /// expression must be associated with the current section.
512 /// @param Value - The value to use when filling bytes.
513 /// @return false on success, true if the offset was invalid.
514 virtual bool EmitValueToOffset(const MCExpr *Offset,
515 unsigned char Value = 0) = 0;
519 /// EmitFileDirective - Switch to a new logical file. This is used to
520 /// implement the '.file "foo.c"' assembler directive.
521 virtual void EmitFileDirective(StringRef Filename) = 0;
523 /// EmitDwarfFileDirective - Associate a filename with a specified logical
524 /// file number. This implements the DWARF2 '.file 4 "foo.c"' assembler
526 virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
529 /// EmitDwarfLocDirective - This implements the DWARF2
530 // '.loc fileno lineno ...' assembler directive.
531 virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
532 unsigned Column, unsigned Flags,
534 unsigned Discriminator,
537 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
538 const MCSymbol *LastLabel,
539 const MCSymbol *Label,
540 unsigned PointerSize) = 0;
542 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
543 const MCSymbol *Label) {
546 void EmitDwarfSetLineAddr(int64_t LineDelta, const MCSymbol *Label,
549 virtual void EmitCompactUnwindEncoding(uint32_t CompactUnwindEncoding);
550 virtual void EmitCFISections(bool EH, bool Debug);
551 void EmitCFIStartProc();
552 void EmitCFIEndProc();
553 virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
554 virtual void EmitCFIDefCfaOffset(int64_t Offset);
555 virtual void EmitCFIDefCfaRegister(int64_t Register);
556 virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
557 virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
558 virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
559 virtual void EmitCFIRememberState();
560 virtual void EmitCFIRestoreState();
561 virtual void EmitCFISameValue(int64_t Register);
562 virtual void EmitCFIRestore(int64_t Register);
563 virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
564 virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
565 virtual void EmitCFIEscape(StringRef Values);
566 virtual void EmitCFISignalFrame();
568 virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
569 virtual void EmitWin64EHEndProc();
570 virtual void EmitWin64EHStartChained();
571 virtual void EmitWin64EHEndChained();
572 virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
574 virtual void EmitWin64EHHandlerData();
575 virtual void EmitWin64EHPushReg(unsigned Register);
576 virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
577 virtual void EmitWin64EHAllocStack(unsigned Size);
578 virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
579 virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
580 virtual void EmitWin64EHPushFrame(bool Code);
581 virtual void EmitWin64EHEndProlog();
583 /// EmitInstruction - Emit the given @p Instruction into the current
585 virtual void EmitInstruction(const MCInst &Inst) = 0;
587 /// EmitRawText - If this file is backed by a assembly streamer, this dumps
588 /// the specified string in the output .s file. This capability is
589 /// indicated by the hasRawTextSupport() predicate. By default this aborts.
590 virtual void EmitRawText(StringRef String);
591 void EmitRawText(const Twine &String);
593 /// ARM-related methods.
594 /// FIXME: Eventually we should have some "target MC streamer" and move
595 /// these methods there.
596 virtual void EmitFnStart();
597 virtual void EmitFnEnd();
598 virtual void EmitCantUnwind();
599 virtual void EmitPersonality(const MCSymbol *Personality);
600 virtual void EmitHandlerData();
601 virtual void EmitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0);
602 virtual void EmitPad(int64_t Offset);
603 virtual void EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
606 /// FinishImpl - Streamer specific finalization.
607 virtual void FinishImpl() = 0;
608 /// Finish - Finish emission of machine code.
612 /// createNullStreamer - Create a dummy machine code streamer, which does
613 /// nothing. This is useful for timing the assembler front end.
614 MCStreamer *createNullStreamer(MCContext &Ctx);
616 /// createAsmStreamer - Create a machine code streamer which will print out
617 /// assembly for the native target, suitable for compiling with a native
620 /// \param InstPrint - If given, the instruction printer to use. If not given
621 /// the MCInst representation will be printed. This method takes ownership of
624 /// \param CE - If given, a code emitter to use to show the instruction
625 /// encoding inline with the assembly. This method takes ownership of \arg CE.
627 /// \param TAB - If given, a target asm backend to use to show the fixup
628 /// information in conjunction with encoding information. This method takes
629 /// ownership of \arg TAB.
631 /// \param ShowInst - Whether to show the MCInst representation inline with
634 /// \param DecodeLSDA - If true, emit comments that translates the LSDA into a
635 /// human readable format. Only usable with CFI.
636 MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
640 bool useDwarfDirectory,
641 MCInstPrinter *InstPrint = 0,
642 MCCodeEmitter *CE = 0,
643 MCAsmBackend *TAB = 0,
644 bool ShowInst = false);
646 /// createMachOStreamer - Create a machine code streamer which will generate
647 /// Mach-O format object files.
649 /// Takes ownership of \arg TAB and \arg CE.
650 MCStreamer *createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB,
651 raw_ostream &OS, MCCodeEmitter *CE,
652 bool RelaxAll = false);
654 /// createWinCOFFStreamer - Create a machine code streamer which will
655 /// generate Microsoft COFF format object files.
657 /// Takes ownership of \arg TAB and \arg CE.
658 MCStreamer *createWinCOFFStreamer(MCContext &Ctx,
660 MCCodeEmitter &CE, raw_ostream &OS,
661 bool RelaxAll = false);
663 /// createELFStreamer - Create a machine code streamer which will generate
664 /// ELF format object files.
665 MCStreamer *createELFStreamer(MCContext &Ctx, MCAsmBackend &TAB,
666 raw_ostream &OS, MCCodeEmitter *CE,
667 bool RelaxAll, bool NoExecStack);
669 /// createPureStreamer - Create a machine code streamer which will generate
670 /// "pure" MC object files, for use with MC-JIT and testing tools.
672 /// Takes ownership of \arg TAB and \arg CE.
673 MCStreamer *createPureStreamer(MCContext &Ctx, MCAsmBackend &TAB,
674 raw_ostream &OS, MCCodeEmitter *CE);
676 } // end namespace llvm