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"
36 class formatted_raw_ostream;
38 /// MCStreamer - Streaming machine code generation interface. This interface
39 /// is intended to provide a programatic interface that is very similar to the
40 /// level that an assembler .s file provides. It has callbacks to emit bytes,
41 /// handle directives, etc. The implementation of this interface retains
42 /// state to know what the current section is etc.
44 /// There are multiple implementations of this interface: one for writing out
45 /// a .s file, and implementations that write out .o files of various formats.
50 MCStreamer(const MCStreamer&); // DO NOT IMPLEMENT
51 MCStreamer &operator=(const MCStreamer&); // DO NOT IMPLEMENT
56 std::vector<MCDwarfFrameInfo> FrameInfos;
57 MCDwarfFrameInfo *getCurrentFrameInfo();
58 void EnsureValidFrame();
60 std::vector<MCWin64EHUnwindInfo *> W64UnwindInfos;
61 MCWin64EHUnwindInfo *CurrentW64UnwindInfo;
62 void setCurrentW64UnwindInfo(MCWin64EHUnwindInfo *Frame);
63 void EnsureValidW64UnwindInfo();
67 /// SectionStack - This is stack of current and previous section
68 /// values saved by PushSection.
69 SmallVector<std::pair<const MCSection *,
70 const MCSection *>, 4> SectionStack;
72 unsigned UniqueCodeBeginSuffix;
73 unsigned UniqueDataBeginSuffix;
76 /// Indicator of whether the previous data-or-code indicator was for
77 /// code or not. Used to determine when we need to emit a new indicator.
85 DataType RegionIndicator;
88 MCStreamer(MCContext &Ctx);
90 const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A,
93 const MCExpr *ForceExpAbs(const MCExpr* Expr);
95 void RecordProcStart(MCDwarfFrameInfo &Frame);
96 virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
97 void RecordProcEnd(MCDwarfFrameInfo &Frame);
98 virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame);
99 void EmitFrames(bool usingCFI);
101 MCWin64EHUnwindInfo *getCurrentW64UnwindInfo(){return CurrentW64UnwindInfo;}
102 void EmitW64Tables();
105 virtual ~MCStreamer();
107 MCContext &getContext() const { return Context; }
109 unsigned getNumFrameInfos() {
110 return FrameInfos.size();
113 const MCDwarfFrameInfo &getFrameInfo(unsigned i) {
114 return FrameInfos[i];
117 ArrayRef<MCDwarfFrameInfo> getFrameInfos() {
121 unsigned getNumW64UnwindInfos() {
122 return W64UnwindInfos.size();
125 MCWin64EHUnwindInfo &getW64UnwindInfo(unsigned i) {
126 return *W64UnwindInfos[i];
129 /// @name Assembly File Formatting.
132 /// isVerboseAsm - Return true if this streamer supports verbose assembly
133 /// and if it is enabled.
134 virtual bool isVerboseAsm() const { return false; }
136 /// hasRawTextSupport - Return true if this asm streamer supports emitting
137 /// unformatted text to the .s file with EmitRawText.
138 virtual bool hasRawTextSupport() const { return false; }
140 /// AddComment - Add a comment that can be emitted to the generated .s
141 /// file if applicable as a QoI issue to make the output of the compiler
142 /// more readable. This only affects the MCAsmStreamer, and only when
143 /// verbose assembly output is enabled.
145 /// If the comment includes embedded \n's, they will each get the comment
146 /// prefix as appropriate. The added comment should not end with a \n.
147 virtual void AddComment(const Twine &T) {}
149 /// GetCommentOS - Return a raw_ostream that comments can be written to.
150 /// Unlike AddComment, you are required to terminate comments with \n if you
152 virtual raw_ostream &GetCommentOS();
154 /// AddBlankLine - Emit a blank line to a .s file to pretty it up.
155 virtual void AddBlankLine() {}
159 /// @name Symbol & Section Management
162 /// getCurrentSection - Return the current section that the streamer is
163 /// emitting code to.
164 const MCSection *getCurrentSection() const {
165 if (!SectionStack.empty())
166 return SectionStack.back().first;
170 /// getPreviousSection - Return the previous section that the streamer is
171 /// emitting code to.
172 const MCSection *getPreviousSection() const {
173 if (!SectionStack.empty())
174 return SectionStack.back().second;
178 /// ChangeSection - Update streamer for a new active section.
180 /// This is called by PopSection and SwitchSection, if the current
182 virtual void ChangeSection(const MCSection *) = 0;
184 /// pushSection - Save the current and previous section on the
187 SectionStack.push_back(std::make_pair(getCurrentSection(),
188 getPreviousSection()));
191 /// popSection - Restore the current and previous section from
192 /// the section stack. Calls ChangeSection as needed.
194 /// Returns false if the stack was empty.
196 if (SectionStack.size() <= 1)
198 const MCSection *oldSection = SectionStack.pop_back_val().first;
199 const MCSection *curSection = SectionStack.back().first;
201 if (oldSection != curSection)
202 ChangeSection(curSection);
206 /// SwitchSection - Set the current section where code is being emitted to
207 /// @p Section. This is required to update CurSection.
209 /// This corresponds to assembler directives like .section, .text, etc.
210 void SwitchSection(const MCSection *Section) {
211 assert(Section && "Cannot switch to a null section!");
212 const MCSection *curSection = SectionStack.back().first;
213 SectionStack.back().second = curSection;
214 if (Section != curSection) {
215 SectionStack.back().first = Section;
216 ChangeSection(Section);
220 /// SwitchSectionNoChange - Set the current section where code is being
221 /// emitted to @p Section. This is required to update CurSection. This
222 /// version does not call ChangeSection.
223 void SwitchSectionNoChange(const MCSection *Section) {
224 assert(Section && "Cannot switch to a null section!");
225 const MCSection *curSection = SectionStack.back().first;
226 SectionStack.back().second = curSection;
227 if (Section != curSection)
228 SectionStack.back().first = Section;
231 /// InitSections - Create the default sections and set the initial one.
232 virtual void InitSections() = 0;
234 /// EmitLabel - Emit a label for @p Symbol into the current section.
236 /// This corresponds to an assembler statement such as:
239 /// @param Symbol - The symbol to emit. A given symbol should only be
240 /// emitted as a label once, and symbols emitted as a label should never be
241 /// used in an assignment.
242 virtual void EmitLabel(MCSymbol *Symbol);
244 /// EmitDataRegion - Emit a label that marks the beginning of a data
246 /// On ELF targets, this corresponds to an assembler statement such as:
248 virtual void EmitDataRegion();
250 /// EmitJumpTable8Region - Emit a label that marks the beginning of a
251 /// jump table composed of 8-bit offsets.
252 /// On ELF targets, this corresponds to an assembler statement such as:
254 virtual void EmitJumpTable8Region();
256 /// EmitJumpTable16Region - Emit a label that marks the beginning of a
257 /// jump table composed of 16-bit offsets.
258 /// On ELF targets, this corresponds to an assembler statement such as:
260 virtual void EmitJumpTable16Region();
262 /// EmitJumpTable32Region - Emit a label that marks the beginning of a
263 /// jump table composed of 32-bit offsets.
264 /// On ELF targets, this corresponds to an assembler statement such as:
266 virtual void EmitJumpTable32Region();
268 /// EmitCodeRegion - Emit a label that marks the beginning of a code
270 /// On ELF targets, this corresponds to an assembler statement such as:
272 virtual void EmitCodeRegion();
274 /// ForceCodeRegion - Forcibly sets the current region mode to code. Used
275 /// at function entry points.
276 void ForceCodeRegion() { RegionIndicator = Code; }
279 virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
282 /// EmitAssemblerFlag - Note in the output the specified @p Flag
283 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) = 0;
285 /// EmitThumbFunc - Note in the output that the specified @p Func is
286 /// a Thumb mode function (ARM target only).
287 virtual void EmitThumbFunc(MCSymbol *Func) = 0;
289 /// EmitAssignment - Emit an assignment of @p Value to @p Symbol.
291 /// This corresponds to an assembler statement such as:
294 /// The assignment generates no code, but has the side effect of binding the
295 /// value in the current context. For the assembly streamer, this prints the
296 /// binding into the .s file.
298 /// @param Symbol - The symbol being assigned to.
299 /// @param Value - The value for the symbol.
300 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) = 0;
302 /// EmitWeakReference - Emit an weak reference from @p Alias to @p Symbol.
304 /// This corresponds to an assembler statement such as:
305 /// .weakref alias, symbol
307 /// @param Alias - The alias that is being created.
308 /// @param Symbol - The symbol being aliased.
309 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) = 0;
311 /// EmitSymbolAttribute - Add the given @p Attribute to @p Symbol.
312 virtual void EmitSymbolAttribute(MCSymbol *Symbol,
313 MCSymbolAttr Attribute) = 0;
315 /// EmitSymbolDesc - Set the @p DescValue for the @p Symbol.
317 /// @param Symbol - The symbol to have its n_desc field set.
318 /// @param DescValue - The value to set into the n_desc field.
319 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) = 0;
321 /// BeginCOFFSymbolDef - Start emitting COFF symbol definition
323 /// @param Symbol - The symbol to have its External & Type fields set.
324 virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) = 0;
326 /// EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.
328 /// @param StorageClass - The storage class the symbol should have.
329 virtual void EmitCOFFSymbolStorageClass(int StorageClass) = 0;
331 /// EmitCOFFSymbolType - Emit the type of the symbol.
333 /// @param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
334 virtual void EmitCOFFSymbolType(int Type) = 0;
336 /// EndCOFFSymbolDef - Marks the end of the symbol definition.
337 virtual void EndCOFFSymbolDef() = 0;
339 /// EmitCOFFSecRel32 - Emits a COFF section relative relocation.
341 /// @param Symbol - Symbol the section relative realocation should point to.
342 virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
344 /// EmitELFSize - Emit an ELF .size directive.
346 /// This corresponds to an assembler statement such as:
347 /// .size symbol, expression
349 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) = 0;
351 /// EmitCommonSymbol - Emit a common symbol.
353 /// @param Symbol - The common symbol to emit.
354 /// @param Size - The size of the common symbol.
355 /// @param ByteAlignment - The alignment of the symbol if
356 /// non-zero. This must be a power of 2.
357 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
358 unsigned ByteAlignment) = 0;
360 /// EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
362 /// @param Symbol - The common symbol to emit.
363 /// @param Size - The size of the common symbol.
364 /// @param ByteAlignment - The alignment of the common symbol in bytes.
365 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
366 unsigned ByteAlignment) = 0;
368 /// EmitZerofill - Emit the zerofill section and an optional symbol.
370 /// @param Section - The zerofill section to create and or to put the symbol
371 /// @param Symbol - The zerofill symbol to emit, if non-NULL.
372 /// @param Size - The size of the zerofill symbol.
373 /// @param ByteAlignment - The alignment of the zerofill symbol if
374 /// non-zero. This must be a power of 2 on some targets.
375 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
376 unsigned Size = 0,unsigned ByteAlignment = 0) = 0;
378 /// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
380 /// @param Section - The thread local common section.
381 /// @param Symbol - The thread local common symbol to emit.
382 /// @param Size - The size of the symbol.
383 /// @param ByteAlignment - The alignment of the thread local common symbol
384 /// if non-zero. This must be a power of 2 on some targets.
385 virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
386 uint64_t Size, unsigned ByteAlignment = 0) = 0;
389 /// @name Generating Data
392 /// EmitBytes - Emit the bytes in \arg Data into the output.
394 /// This is used to implement assembler directives such as .byte, .ascii,
396 virtual void EmitBytes(StringRef Data, unsigned AddrSpace) = 0;
398 /// EmitValue - Emit the expression @p Value into the output as a native
399 /// integer of the given @p Size bytes.
401 /// This is used to implement assembler directives such as .word, .quad,
404 /// @param Value - The value to emit.
405 /// @param Size - The size of the integer (in bytes) to emit. This must
406 /// match a native machine width.
407 virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
408 unsigned AddrSpace) = 0;
410 void EmitValue(const MCExpr *Value, unsigned Size, unsigned AddrSpace = 0);
412 /// EmitIntValue - Special case of EmitValue that avoids the client having
413 /// to pass in a MCExpr for constant integers.
414 virtual void EmitIntValue(uint64_t Value, unsigned Size,
415 unsigned AddrSpace = 0);
417 /// EmitAbsValue - Emit the Value, but try to avoid relocations. On MachO
418 /// this is done by producing
421 void EmitAbsValue(const MCExpr *Value, unsigned Size,
422 unsigned AddrSpace = 0);
424 virtual void EmitULEB128Value(const MCExpr *Value) = 0;
426 virtual void EmitSLEB128Value(const MCExpr *Value) = 0;
428 /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
429 /// client having to pass in a MCExpr for constant integers.
430 void EmitULEB128IntValue(uint64_t Value, unsigned AddrSpace = 0,
431 unsigned Padding = 0);
433 /// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
434 /// client having to pass in a MCExpr for constant integers.
435 void EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace = 0);
437 /// EmitSymbolValue - Special case of EmitValue that avoids the client
438 /// having to pass in a MCExpr for MCSymbols.
439 void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
440 unsigned AddrSpace = 0);
442 /// EmitGPRel64Value - Emit the expression @p Value into the output as a
443 /// gprel64 (64-bit GP relative) value.
445 /// This is used to implement assembler directives such as .gpdword on
446 /// targets that support them.
447 virtual void EmitGPRel64Value(const MCExpr *Value);
449 /// EmitGPRel32Value - Emit the expression @p Value into the output as a
450 /// gprel32 (32-bit GP relative) value.
452 /// This is used to implement assembler directives such as .gprel32 on
453 /// targets that support them.
454 virtual void EmitGPRel32Value(const MCExpr *Value);
456 /// EmitFill - Emit NumBytes bytes worth of the value specified by
457 /// FillValue. This implements directives such as '.space'.
458 virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue,
461 /// EmitZeros - Emit NumBytes worth of zeros. This is a convenience
462 /// function that just wraps EmitFill.
463 void EmitZeros(uint64_t NumBytes, unsigned AddrSpace) {
464 EmitFill(NumBytes, 0, AddrSpace);
468 /// EmitValueToAlignment - Emit some number of copies of @p Value until
469 /// the byte alignment @p ByteAlignment is reached.
471 /// If the number of bytes need to emit for the alignment is not a multiple
472 /// of @p ValueSize, then the contents of the emitted fill bytes is
475 /// This used to implement the .align assembler directive.
477 /// @param ByteAlignment - The alignment to reach. This must be a power of
478 /// two on some targets.
479 /// @param Value - The value to use when filling bytes.
480 /// @param ValueSize - The size of the integer (in bytes) to emit for
481 /// @p Value. This must match a native machine width.
482 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
483 /// the alignment cannot be reached in this many bytes, no bytes are
485 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
486 unsigned ValueSize = 1,
487 unsigned MaxBytesToEmit = 0) = 0;
489 /// EmitCodeAlignment - Emit nops until the byte alignment @p ByteAlignment
492 /// This used to align code where the alignment bytes may be executed. This
493 /// can emit different bytes for different sizes to optimize execution.
495 /// @param ByteAlignment - The alignment to reach. This must be a power of
496 /// two on some targets.
497 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
498 /// the alignment cannot be reached in this many bytes, no bytes are
500 virtual void EmitCodeAlignment(unsigned ByteAlignment,
501 unsigned MaxBytesToEmit = 0) = 0;
503 /// EmitValueToOffset - Emit some number of copies of @p Value until the
504 /// byte offset @p Offset is reached.
506 /// This is used to implement assembler directives such as .org.
508 /// @param Offset - The offset to reach. This may be an expression, but the
509 /// expression must be associated with the current section.
510 /// @param Value - The value to use when filling bytes.
511 /// @return false on success, true if the offset was invalid.
512 virtual bool EmitValueToOffset(const MCExpr *Offset,
513 unsigned char Value = 0) = 0;
517 /// EmitFileDirective - Switch to a new logical file. This is used to
518 /// implement the '.file "foo.c"' assembler directive.
519 virtual void EmitFileDirective(StringRef Filename) = 0;
521 /// EmitDwarfFileDirective - Associate a filename with a specified logical
522 /// file number. This implements the DWARF2 '.file 4 "foo.c"' assembler
524 virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
527 /// EmitDwarfLocDirective - This implements the DWARF2
528 // '.loc fileno lineno ...' assembler directive.
529 virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
530 unsigned Column, unsigned Flags,
532 unsigned Discriminator,
535 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
536 const MCSymbol *LastLabel,
537 const MCSymbol *Label,
538 unsigned PointerSize) = 0;
540 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
541 const MCSymbol *Label) {
544 void EmitDwarfSetLineAddr(int64_t LineDelta, const MCSymbol *Label,
547 virtual void EmitCompactUnwindEncoding(uint32_t CompactUnwindEncoding);
548 virtual void EmitCFISections(bool EH, bool Debug);
549 void EmitCFIStartProc();
550 void EmitCFIEndProc();
551 virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
552 virtual void EmitCFIDefCfaOffset(int64_t Offset);
553 virtual void EmitCFIDefCfaRegister(int64_t Register);
554 virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
555 virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
556 virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
557 virtual void EmitCFIRememberState();
558 virtual void EmitCFIRestoreState();
559 virtual void EmitCFISameValue(int64_t Register);
560 virtual void EmitCFIRestore(int64_t Register);
561 virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
562 virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
563 virtual void EmitCFIEscape(StringRef Values);
564 virtual void EmitCFISignalFrame();
566 virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
567 virtual void EmitWin64EHEndProc();
568 virtual void EmitWin64EHStartChained();
569 virtual void EmitWin64EHEndChained();
570 virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
572 virtual void EmitWin64EHHandlerData();
573 virtual void EmitWin64EHPushReg(unsigned Register);
574 virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
575 virtual void EmitWin64EHAllocStack(unsigned Size);
576 virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
577 virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
578 virtual void EmitWin64EHPushFrame(bool Code);
579 virtual void EmitWin64EHEndProlog();
581 /// EmitInstruction - Emit the given @p Instruction into the current
583 virtual void EmitInstruction(const MCInst &Inst) = 0;
585 /// EmitRawText - If this file is backed by a assembly streamer, this dumps
586 /// the specified string in the output .s file. This capability is
587 /// indicated by the hasRawTextSupport() predicate. By default this aborts.
588 virtual void EmitRawText(StringRef String);
589 void EmitRawText(const Twine &String);
591 /// ARM-related methods.
592 /// FIXME: Eventually we should have some "target MC streamer" and move
593 /// these methods there.
594 virtual void EmitFnStart();
595 virtual void EmitFnEnd();
596 virtual void EmitCantUnwind();
597 virtual void EmitPersonality(const MCSymbol *Personality);
598 virtual void EmitHandlerData();
599 virtual void EmitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0);
600 virtual void EmitPad(int64_t Offset);
601 virtual void EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
604 /// FinishImpl - Streamer specific finalization.
605 virtual void FinishImpl() = 0;
606 /// Finish - Finish emission of machine code.
610 /// createNullStreamer - Create a dummy machine code streamer, which does
611 /// nothing. This is useful for timing the assembler front end.
612 MCStreamer *createNullStreamer(MCContext &Ctx);
614 /// createAsmStreamer - Create a machine code streamer which will print out
615 /// assembly for the native target, suitable for compiling with a native
618 /// \param InstPrint - If given, the instruction printer to use. If not given
619 /// the MCInst representation will be printed. This method takes ownership of
622 /// \param CE - If given, a code emitter to use to show the instruction
623 /// encoding inline with the assembly. This method takes ownership of \arg CE.
625 /// \param TAB - If given, a target asm backend to use to show the fixup
626 /// information in conjunction with encoding information. This method takes
627 /// ownership of \arg TAB.
629 /// \param ShowInst - Whether to show the MCInst representation inline with
632 /// \param DecodeLSDA - If true, emit comments that translates the LSDA into a
633 /// human readable format. Only usable with CFI.
634 MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
638 bool useDwarfDirectory,
639 MCInstPrinter *InstPrint = 0,
640 MCCodeEmitter *CE = 0,
641 MCAsmBackend *TAB = 0,
642 bool ShowInst = false);
644 /// createMachOStreamer - Create a machine code streamer which will generate
645 /// Mach-O format object files.
647 /// Takes ownership of \arg TAB and \arg CE.
648 MCStreamer *createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB,
649 raw_ostream &OS, MCCodeEmitter *CE,
650 bool RelaxAll = false);
652 /// createWinCOFFStreamer - Create a machine code streamer which will
653 /// generate Microsoft COFF format object files.
655 /// Takes ownership of \arg TAB and \arg CE.
656 MCStreamer *createWinCOFFStreamer(MCContext &Ctx,
658 MCCodeEmitter &CE, raw_ostream &OS,
659 bool RelaxAll = false);
661 /// createELFStreamer - Create a machine code streamer which will generate
662 /// ELF format object files.
663 MCStreamer *createELFStreamer(MCContext &Ctx, MCAsmBackend &TAB,
664 raw_ostream &OS, MCCodeEmitter *CE,
665 bool RelaxAll, bool NoExecStack);
667 /// createPureStreamer - Create a machine code streamer which will generate
668 /// "pure" MC object files, for use with MC-JIT and testing tools.
670 /// Takes ownership of \arg TAB and \arg CE.
671 MCStreamer *createPureStreamer(MCContext &Ctx, MCAsmBackend &TAB,
672 raw_ostream &OS, MCCodeEmitter *CE);
674 } // end namespace llvm