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"
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&) LLVM_DELETED_FUNCTION;
51 MCStreamer &operator=(const MCStreamer&) LLVM_DELETED_FUNCTION;
56 std::vector<MCDwarfFrameInfo> FrameInfos;
57 MCDwarfFrameInfo *getCurrentFrameInfo();
58 MCSymbol *EmitCFICommon();
59 void EnsureValidFrame();
61 std::vector<MCWin64EHUnwindInfo *> W64UnwindInfos;
62 MCWin64EHUnwindInfo *CurrentW64UnwindInfo;
63 void setCurrentW64UnwindInfo(MCWin64EHUnwindInfo *Frame);
64 void EnsureValidW64UnwindInfo();
68 /// SectionStack - This is stack of current and previous section
69 /// values saved by PushSection.
70 SmallVector<std::pair<const MCSection *,
71 const MCSection *>, 4> SectionStack;
73 bool AutoInitSections;
76 MCStreamer(MCContext &Ctx);
78 const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A,
81 const MCExpr *ForceExpAbs(const MCExpr* Expr);
83 void RecordProcStart(MCDwarfFrameInfo &Frame);
84 virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
85 void RecordProcEnd(MCDwarfFrameInfo &Frame);
86 virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame);
87 void EmitFrames(bool usingCFI);
89 MCWin64EHUnwindInfo *getCurrentW64UnwindInfo(){return CurrentW64UnwindInfo;}
93 virtual ~MCStreamer();
99 MCContext &getContext() const { return Context; }
101 unsigned getNumFrameInfos() {
102 return FrameInfos.size();
105 const MCDwarfFrameInfo &getFrameInfo(unsigned i) {
106 return FrameInfos[i];
109 ArrayRef<MCDwarfFrameInfo> getFrameInfos() {
113 unsigned getNumW64UnwindInfos() {
114 return W64UnwindInfos.size();
117 MCWin64EHUnwindInfo &getW64UnwindInfo(unsigned i) {
118 return *W64UnwindInfos[i];
121 /// @name Assembly File Formatting.
124 /// isVerboseAsm - Return true if this streamer supports verbose assembly
125 /// and if it is enabled.
126 virtual bool isVerboseAsm() const { return false; }
128 /// hasRawTextSupport - Return true if this asm streamer supports emitting
129 /// unformatted text to the .s file with EmitRawText.
130 virtual bool hasRawTextSupport() const { return false; }
132 /// AddComment - Add a comment that can be emitted to the generated .s
133 /// file if applicable as a QoI issue to make the output of the compiler
134 /// more readable. This only affects the MCAsmStreamer, and only when
135 /// verbose assembly output is enabled.
137 /// If the comment includes embedded \n's, they will each get the comment
138 /// prefix as appropriate. The added comment should not end with a \n.
139 virtual void AddComment(const Twine &T) {}
141 /// GetCommentOS - Return a raw_ostream that comments can be written to.
142 /// Unlike AddComment, you are required to terminate comments with \n if you
144 virtual raw_ostream &GetCommentOS();
146 /// AddBlankLine - Emit a blank line to a .s file to pretty it up.
147 virtual void AddBlankLine() {}
151 /// @name Symbol & Section Management
154 /// getCurrentSection - Return the current section that the streamer is
155 /// emitting code to.
156 const MCSection *getCurrentSection() const {
157 if (!SectionStack.empty())
158 return SectionStack.back().first;
162 /// getPreviousSection - Return the previous section that the streamer is
163 /// emitting code to.
164 const MCSection *getPreviousSection() const {
165 if (!SectionStack.empty())
166 return SectionStack.back().second;
170 /// ChangeSection - Update streamer for a new active section.
172 /// This is called by PopSection and SwitchSection, if the current
174 virtual void ChangeSection(const MCSection *) = 0;
176 /// pushSection - Save the current and previous section on the
179 SectionStack.push_back(std::make_pair(getCurrentSection(),
180 getPreviousSection()));
183 /// popSection - Restore the current and previous section from
184 /// the section stack. Calls ChangeSection as needed.
186 /// Returns false if the stack was empty.
188 if (SectionStack.size() <= 1)
190 const MCSection *oldSection = SectionStack.pop_back_val().first;
191 const MCSection *curSection = SectionStack.back().first;
193 if (oldSection != curSection)
194 ChangeSection(curSection);
198 /// SwitchSection - Set the current section where code is being emitted to
199 /// @p Section. This is required to update CurSection.
201 /// This corresponds to assembler directives like .section, .text, etc.
202 void SwitchSection(const MCSection *Section) {
203 assert(Section && "Cannot switch to a null section!");
204 const MCSection *curSection = SectionStack.back().first;
205 SectionStack.back().second = curSection;
206 if (Section != curSection) {
207 SectionStack.back().first = Section;
208 ChangeSection(Section);
212 /// SwitchSectionNoChange - Set the current section where code is being
213 /// emitted to @p Section. This is required to update CurSection. This
214 /// version does not call ChangeSection.
215 void SwitchSectionNoChange(const MCSection *Section) {
216 assert(Section && "Cannot switch to a null section!");
217 const MCSection *curSection = SectionStack.back().first;
218 SectionStack.back().second = curSection;
219 if (Section != curSection)
220 SectionStack.back().first = Section;
223 /// Initialize the streamer.
224 void InitStreamer() {
225 if (AutoInitSections)
229 /// Tell this MCStreamer to call InitSections upon initialization.
230 void setAutoInitSections(bool AutoInitSections) {
231 this->AutoInitSections = AutoInitSections;
234 /// InitSections - Create the default sections and set the initial one.
235 virtual void InitSections() = 0;
237 /// EmitLabel - Emit a label for @p Symbol into the current section.
239 /// This corresponds to an assembler statement such as:
242 /// @param Symbol - The symbol to emit. A given symbol should only be
243 /// emitted as a label once, and symbols emitted as a label should never be
244 /// used in an assignment.
245 virtual void EmitLabel(MCSymbol *Symbol);
247 virtual void EmitDebugLabel(MCSymbol *Symbol);
249 virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
252 /// EmitAssemblerFlag - Note in the output the specified @p Flag.
253 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) = 0;
255 /// EmitDataRegion - Note in the output the specified region @p Kind.
256 virtual void EmitDataRegion(MCDataRegionType Kind) {}
258 /// EmitThumbFunc - Note in the output that the specified @p Func is
259 /// a Thumb mode function (ARM target only).
260 virtual void EmitThumbFunc(MCSymbol *Func) = 0;
262 /// EmitAssignment - Emit an assignment of @p Value to @p Symbol.
264 /// This corresponds to an assembler statement such as:
267 /// The assignment generates no code, but has the side effect of binding the
268 /// value in the current context. For the assembly streamer, this prints the
269 /// binding into the .s file.
271 /// @param Symbol - The symbol being assigned to.
272 /// @param Value - The value for the symbol.
273 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) = 0;
275 /// EmitWeakReference - Emit an weak reference from @p Alias to @p Symbol.
277 /// This corresponds to an assembler statement such as:
278 /// .weakref alias, symbol
280 /// @param Alias - The alias that is being created.
281 /// @param Symbol - The symbol being aliased.
282 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) = 0;
284 /// EmitSymbolAttribute - Add the given @p Attribute to @p Symbol.
285 virtual void EmitSymbolAttribute(MCSymbol *Symbol,
286 MCSymbolAttr Attribute) = 0;
288 /// EmitSymbolDesc - Set the @p DescValue for the @p Symbol.
290 /// @param Symbol - The symbol to have its n_desc field set.
291 /// @param DescValue - The value to set into the n_desc field.
292 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) = 0;
294 /// BeginCOFFSymbolDef - Start emitting COFF symbol definition
296 /// @param Symbol - The symbol to have its External & Type fields set.
297 virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) = 0;
299 /// EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.
301 /// @param StorageClass - The storage class the symbol should have.
302 virtual void EmitCOFFSymbolStorageClass(int StorageClass) = 0;
304 /// EmitCOFFSymbolType - Emit the type of the symbol.
306 /// @param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
307 virtual void EmitCOFFSymbolType(int Type) = 0;
309 /// EndCOFFSymbolDef - Marks the end of the symbol definition.
310 virtual void EndCOFFSymbolDef() = 0;
312 /// EmitCOFFSecRel32 - Emits a COFF section relative relocation.
314 /// @param Symbol - Symbol the section relative realocation should point to.
315 virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
317 /// EmitELFSize - Emit an ELF .size directive.
319 /// This corresponds to an assembler statement such as:
320 /// .size symbol, expression
322 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) = 0;
324 /// EmitCommonSymbol - Emit a common symbol.
326 /// @param Symbol - The common symbol to emit.
327 /// @param Size - The size of the common symbol.
328 /// @param ByteAlignment - The alignment of the symbol if
329 /// non-zero. This must be a power of 2.
330 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
331 unsigned ByteAlignment) = 0;
333 /// EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
335 /// @param Symbol - The common symbol to emit.
336 /// @param Size - The size of the common symbol.
337 /// @param ByteAlignment - The alignment of the common symbol in bytes.
338 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
339 unsigned ByteAlignment) = 0;
341 /// EmitZerofill - Emit the zerofill section and an optional symbol.
343 /// @param Section - The zerofill section to create and or to put the symbol
344 /// @param Symbol - The zerofill symbol to emit, if non-NULL.
345 /// @param Size - The size of the zerofill symbol.
346 /// @param ByteAlignment - The alignment of the zerofill symbol if
347 /// non-zero. This must be a power of 2 on some targets.
348 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
349 uint64_t Size = 0,unsigned ByteAlignment = 0) = 0;
351 /// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
353 /// @param Section - The thread local common section.
354 /// @param Symbol - The thread local common symbol to emit.
355 /// @param Size - The size of the symbol.
356 /// @param ByteAlignment - The alignment of the thread local common symbol
357 /// if non-zero. This must be a power of 2 on some targets.
358 virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
359 uint64_t Size, unsigned ByteAlignment = 0) = 0;
362 /// @name Generating Data
365 /// EmitBytes - Emit the bytes in \p Data into the output.
367 /// This is used to implement assembler directives such as .byte, .ascii,
369 virtual void EmitBytes(StringRef Data, unsigned AddrSpace = 0) = 0;
371 /// EmitValue - Emit the expression @p Value into the output as a native
372 /// integer of the given @p Size bytes.
374 /// This is used to implement assembler directives such as .word, .quad,
377 /// @param Value - The value to emit.
378 /// @param Size - The size of the integer (in bytes) to emit. This must
379 /// match a native machine width.
380 virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
381 unsigned AddrSpace) = 0;
383 void EmitValue(const MCExpr *Value, unsigned Size, unsigned AddrSpace = 0);
385 /// EmitIntValue - Special case of EmitValue that avoids the client having
386 /// to pass in a MCExpr for constant integers.
387 virtual void EmitIntValue(uint64_t Value, unsigned Size,
388 unsigned AddrSpace = 0);
390 /// EmitAbsValue - Emit the Value, but try to avoid relocations. On MachO
391 /// this is done by producing
394 void EmitAbsValue(const MCExpr *Value, unsigned Size,
395 unsigned AddrSpace = 0);
397 virtual void EmitULEB128Value(const MCExpr *Value) = 0;
399 virtual void EmitSLEB128Value(const MCExpr *Value) = 0;
401 /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
402 /// client having to pass in a MCExpr for constant integers.
403 void EmitULEB128IntValue(uint64_t Value, unsigned Padding = 0,
404 unsigned AddrSpace = 0);
406 /// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
407 /// client having to pass in a MCExpr for constant integers.
408 void EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace = 0);
410 /// EmitSymbolValue - Special case of EmitValue that avoids the client
411 /// having to pass in a MCExpr for MCSymbols.
412 void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
413 unsigned AddrSpace = 0);
415 /// EmitGPRel64Value - Emit the expression @p Value into the output as a
416 /// gprel64 (64-bit GP relative) value.
418 /// This is used to implement assembler directives such as .gpdword on
419 /// targets that support them.
420 virtual void EmitGPRel64Value(const MCExpr *Value);
422 /// EmitGPRel32Value - Emit the expression @p Value into the output as a
423 /// gprel32 (32-bit GP relative) value.
425 /// This is used to implement assembler directives such as .gprel32 on
426 /// targets that support them.
427 virtual void EmitGPRel32Value(const MCExpr *Value);
429 /// EmitFill - Emit NumBytes bytes worth of the value specified by
430 /// FillValue. This implements directives such as '.space'.
431 virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue,
432 unsigned AddrSpace = 0);
434 /// EmitZeros - Emit NumBytes worth of zeros. This is a convenience
435 /// function that just wraps EmitFill.
436 void EmitZeros(uint64_t NumBytes, unsigned AddrSpace = 0) {
437 EmitFill(NumBytes, 0, AddrSpace);
440 /// EmitValueToAlignment - Emit some number of copies of @p Value until
441 /// the byte alignment @p ByteAlignment is reached.
443 /// If the number of bytes need to emit for the alignment is not a multiple
444 /// of @p ValueSize, then the contents of the emitted fill bytes is
447 /// This used to implement the .align assembler directive.
449 /// @param ByteAlignment - The alignment to reach. This must be a power of
450 /// two on some targets.
451 /// @param Value - The value to use when filling bytes.
452 /// @param ValueSize - The size of the integer (in bytes) to emit for
453 /// @p Value. This must match a native machine width.
454 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
455 /// the alignment cannot be reached in this many bytes, no bytes are
457 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
458 unsigned ValueSize = 1,
459 unsigned MaxBytesToEmit = 0) = 0;
461 /// EmitCodeAlignment - Emit nops until the byte alignment @p ByteAlignment
464 /// This used to align code where the alignment bytes may be executed. This
465 /// can emit different bytes for different sizes to optimize execution.
467 /// @param ByteAlignment - The alignment to reach. This must be a power of
468 /// two on some targets.
469 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
470 /// the alignment cannot be reached in this many bytes, no bytes are
472 virtual void EmitCodeAlignment(unsigned ByteAlignment,
473 unsigned MaxBytesToEmit = 0) = 0;
475 /// EmitValueToOffset - Emit some number of copies of @p Value until the
476 /// byte offset @p Offset is reached.
478 /// This is used to implement assembler directives such as .org.
480 /// @param Offset - The offset to reach. This may be an expression, but the
481 /// expression must be associated with the current section.
482 /// @param Value - The value to use when filling bytes.
483 /// @return false on success, true if the offset was invalid.
484 virtual bool EmitValueToOffset(const MCExpr *Offset,
485 unsigned char Value = 0) = 0;
489 /// EmitFileDirective - Switch to a new logical file. This is used to
490 /// implement the '.file "foo.c"' assembler directive.
491 virtual void EmitFileDirective(StringRef Filename) = 0;
493 /// EmitDwarfFileDirective - Associate a filename with a specified logical
494 /// file number. This implements the DWARF2 '.file 4 "foo.c"' assembler
496 virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
499 /// EmitDwarfLocDirective - This implements the DWARF2
500 // '.loc fileno lineno ...' assembler directive.
501 virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
502 unsigned Column, unsigned Flags,
504 unsigned Discriminator,
507 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
508 const MCSymbol *LastLabel,
509 const MCSymbol *Label,
510 unsigned PointerSize) = 0;
512 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
513 const MCSymbol *Label) {
516 void EmitDwarfSetLineAddr(int64_t LineDelta, const MCSymbol *Label,
519 virtual void EmitCompactUnwindEncoding(uint32_t CompactUnwindEncoding);
520 virtual void EmitCFISections(bool EH, bool Debug);
521 void EmitCFIStartProc();
522 void EmitCFIEndProc();
523 virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
524 virtual void EmitCFIDefCfaOffset(int64_t Offset);
525 virtual void EmitCFIDefCfaRegister(int64_t Register);
526 virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
527 virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
528 virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
529 virtual void EmitCFIRememberState();
530 virtual void EmitCFIRestoreState();
531 virtual void EmitCFISameValue(int64_t Register);
532 virtual void EmitCFIRestore(int64_t Register);
533 virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
534 virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
535 virtual void EmitCFIEscape(StringRef Values);
536 virtual void EmitCFISignalFrame();
537 virtual void EmitCFIUndefined(int64_t Register);
538 virtual void EmitCFIRegister(int64_t Register1, int64_t Register2);
540 virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
541 virtual void EmitWin64EHEndProc();
542 virtual void EmitWin64EHStartChained();
543 virtual void EmitWin64EHEndChained();
544 virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
546 virtual void EmitWin64EHHandlerData();
547 virtual void EmitWin64EHPushReg(unsigned Register);
548 virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
549 virtual void EmitWin64EHAllocStack(unsigned Size);
550 virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
551 virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
552 virtual void EmitWin64EHPushFrame(bool Code);
553 virtual void EmitWin64EHEndProlog();
555 /// EmitInstruction - Emit the given @p Instruction into the current
557 virtual void EmitInstruction(const MCInst &Inst) = 0;
559 /// \brief Set the bundle alignment mode from now on in the section.
560 /// The argument is the power of 2 to which the alignment is set. The
561 /// value 0 means turn the bundle alignment off.
562 virtual void EmitBundleAlignMode(unsigned AlignPow2) = 0;
564 /// \brief The following instructions are a bundle-locked group.
566 /// \param AlignToEnd - If true, the bundle-locked group will be aligned to
567 /// the end of a bundle.
568 virtual void EmitBundleLock(bool AlignToEnd) = 0;
570 /// \brief Ends a bundle-locked group.
571 virtual void EmitBundleUnlock() = 0;
573 /// EmitRawText - If this file is backed by a assembly streamer, this dumps
574 /// the specified string in the output .s file. This capability is
575 /// indicated by the hasRawTextSupport() predicate. By default this aborts.
576 virtual void EmitRawText(StringRef String);
577 void EmitRawText(const Twine &String);
579 /// ARM-related methods.
580 /// FIXME: Eventually we should have some "target MC streamer" and move
581 /// these methods there.
582 virtual void EmitFnStart();
583 virtual void EmitFnEnd();
584 virtual void EmitCantUnwind();
585 virtual void EmitPersonality(const MCSymbol *Personality);
586 virtual void EmitHandlerData();
587 virtual void EmitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0);
588 virtual void EmitPad(int64_t Offset);
589 virtual void EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
592 /// PPC-related methods.
593 /// FIXME: Eventually replace it with some "target MC streamer" and move
594 /// these methods there.
595 virtual void EmitTCEntry(const MCSymbol &S);
597 /// FinishImpl - Streamer specific finalization.
598 virtual void FinishImpl() = 0;
599 /// Finish - Finish emission of machine code.
603 /// createNullStreamer - Create a dummy machine code streamer, which does
604 /// nothing. This is useful for timing the assembler front end.
605 MCStreamer *createNullStreamer(MCContext &Ctx);
607 /// createAsmStreamer - Create a machine code streamer which will print out
608 /// assembly for the native target, suitable for compiling with a native
611 /// \param InstPrint - If given, the instruction printer to use. If not given
612 /// the MCInst representation will be printed. This method takes ownership of
615 /// \param CE - If given, a code emitter to use to show the instruction
616 /// encoding inline with the assembly. This method takes ownership of \p CE.
618 /// \param TAB - If given, a target asm backend to use to show the fixup
619 /// information in conjunction with encoding information. This method takes
620 /// ownership of \p TAB.
622 /// \param ShowInst - Whether to show the MCInst representation inline with
624 MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
628 bool useDwarfDirectory,
629 MCInstPrinter *InstPrint = 0,
630 MCCodeEmitter *CE = 0,
631 MCAsmBackend *TAB = 0,
632 bool ShowInst = false);
634 /// createMachOStreamer - Create a machine code streamer which will generate
635 /// Mach-O format object files.
637 /// Takes ownership of \p TAB and \p CE.
638 MCStreamer *createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB,
639 raw_ostream &OS, MCCodeEmitter *CE,
640 bool RelaxAll = false);
642 /// createWinCOFFStreamer - Create a machine code streamer which will
643 /// generate Microsoft COFF format object files.
645 /// Takes ownership of \p TAB and \p CE.
646 MCStreamer *createWinCOFFStreamer(MCContext &Ctx,
648 MCCodeEmitter &CE, raw_ostream &OS,
649 bool RelaxAll = false);
651 /// createELFStreamer - Create a machine code streamer which will generate
652 /// ELF format object files.
653 MCStreamer *createELFStreamer(MCContext &Ctx, MCAsmBackend &TAB,
654 raw_ostream &OS, MCCodeEmitter *CE,
655 bool RelaxAll, bool NoExecStack);
657 /// createPureStreamer - Create a machine code streamer which will generate
658 /// "pure" MC object files, for use with MC-JIT and testing tools.
660 /// Takes ownership of \p TAB and \p CE.
661 MCStreamer *createPureStreamer(MCContext &Ctx, MCAsmBackend &TAB,
662 raw_ostream &OS, MCCodeEmitter *CE);
664 } // end namespace llvm