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/MCAssembler.h"
20 #include "llvm/MC/MCDirectives.h"
21 #include "llvm/MC/MCDwarf.h"
22 #include "llvm/MC/MCWin64EH.h"
23 #include "llvm/Support/DataTypes.h"
38 class formatted_raw_ostream;
40 typedef std::pair<const MCSection *, const MCExpr *> MCSectionSubPair;
42 /// MCStreamer - Streaming machine code generation interface. This interface
43 /// is intended to provide a programatic interface that is very similar to the
44 /// level that an assembler .s file provides. It has callbacks to emit bytes,
45 /// handle directives, etc. The implementation of this interface retains
46 /// state to know what the current section is etc.
48 /// There are multiple implementations of this interface: one for writing out
49 /// a .s file, and implementations that write out .o files of various formats.
58 // MCObjectStreamer subclasses.
68 const StreamerKind Kind;
71 MCStreamer(const MCStreamer&) LLVM_DELETED_FUNCTION;
72 MCStreamer &operator=(const MCStreamer&) LLVM_DELETED_FUNCTION;
77 std::vector<MCDwarfFrameInfo> FrameInfos;
78 MCDwarfFrameInfo *getCurrentFrameInfo();
79 MCSymbol *EmitCFICommon();
80 void EnsureValidFrame();
82 std::vector<MCWin64EHUnwindInfo *> W64UnwindInfos;
83 MCWin64EHUnwindInfo *CurrentW64UnwindInfo;
84 void setCurrentW64UnwindInfo(MCWin64EHUnwindInfo *Frame);
85 void EnsureValidW64UnwindInfo();
89 /// SectionStack - This is stack of current and previous section
90 /// values saved by PushSection.
91 SmallVector<std::pair<MCSectionSubPair, MCSectionSubPair>, 4> SectionStack;
93 bool AutoInitSections;
96 MCStreamer(StreamerKind Kind, MCContext &Ctx);
98 const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A,
101 const MCExpr *ForceExpAbs(const MCExpr* Expr);
103 void RecordProcStart(MCDwarfFrameInfo &Frame);
104 virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame);
105 void RecordProcEnd(MCDwarfFrameInfo &Frame);
106 virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame);
107 void EmitFrames(bool usingCFI);
109 MCWin64EHUnwindInfo *getCurrentW64UnwindInfo(){return CurrentW64UnwindInfo;}
110 void EmitW64Tables();
113 virtual ~MCStreamer();
115 StreamerKind getKind() const { return Kind; }
119 virtual void reset();
121 MCContext &getContext() const { return Context; }
123 unsigned getNumFrameInfos() {
124 return FrameInfos.size();
127 const MCDwarfFrameInfo &getFrameInfo(unsigned i) {
128 return FrameInfos[i];
131 ArrayRef<MCDwarfFrameInfo> getFrameInfos() {
135 unsigned getNumW64UnwindInfos() {
136 return W64UnwindInfos.size();
139 MCWin64EHUnwindInfo &getW64UnwindInfo(unsigned i) {
140 return *W64UnwindInfos[i];
143 /// @name Assembly File Formatting.
146 /// isVerboseAsm - Return true if this streamer supports verbose assembly
147 /// and if it is enabled.
148 virtual bool isVerboseAsm() const { return false; }
150 /// hasRawTextSupport - Return true if this asm streamer supports emitting
151 /// unformatted text to the .s file with EmitRawText.
152 virtual bool hasRawTextSupport() const { return false; }
154 /// AddComment - Add a comment that can be emitted to the generated .s
155 /// file if applicable as a QoI issue to make the output of the compiler
156 /// more readable. This only affects the MCAsmStreamer, and only when
157 /// verbose assembly output is enabled.
159 /// If the comment includes embedded \n's, they will each get the comment
160 /// prefix as appropriate. The added comment should not end with a \n.
161 virtual void AddComment(const Twine &T) {}
163 /// GetCommentOS - Return a raw_ostream that comments can be written to.
164 /// Unlike AddComment, you are required to terminate comments with \n if you
166 virtual raw_ostream &GetCommentOS();
168 /// AddBlankLine - Emit a blank line to a .s file to pretty it up.
169 virtual void AddBlankLine() {}
173 /// @name Symbol & Section Management
176 /// getCurrentSection - Return the current section that the streamer is
177 /// emitting code to.
178 MCSectionSubPair getCurrentSection() const {
179 if (!SectionStack.empty())
180 return SectionStack.back().first;
181 return MCSectionSubPair();
184 /// getPreviousSection - Return the previous section that the streamer is
185 /// emitting code to.
186 MCSectionSubPair getPreviousSection() const {
187 if (!SectionStack.empty())
188 return SectionStack.back().second;
189 return MCSectionSubPair();
192 /// ChangeSection - Update streamer for a new active section.
194 /// This is called by PopSection and SwitchSection, if the current
196 virtual void ChangeSection(const MCSection *, const MCExpr *) = 0;
198 /// pushSection - Save the current and previous section on the
201 SectionStack.push_back(std::make_pair(getCurrentSection(),
202 getPreviousSection()));
205 /// popSection - Restore the current and previous section from
206 /// the section stack. Calls ChangeSection as needed.
208 /// Returns false if the stack was empty.
210 if (SectionStack.size() <= 1)
212 MCSectionSubPair oldSection = SectionStack.pop_back_val().first;
213 MCSectionSubPair curSection = SectionStack.back().first;
215 if (oldSection != curSection)
216 ChangeSection(curSection.first, curSection.second);
220 bool SubSection(const MCExpr *Subsection) {
221 if (SectionStack.empty())
224 SwitchSection(SectionStack.back().first.first, Subsection);
228 /// SwitchSection - Set the current section where code is being emitted to
229 /// @p Section. This is required to update CurSection.
231 /// This corresponds to assembler directives like .section, .text, etc.
232 void SwitchSection(const MCSection *Section, const MCExpr *Subsection = 0) {
233 assert(Section && "Cannot switch to a null section!");
234 MCSectionSubPair curSection = SectionStack.back().first;
235 SectionStack.back().second = curSection;
236 if (MCSectionSubPair(Section, Subsection) != curSection) {
237 SectionStack.back().first = MCSectionSubPair(Section, Subsection);
238 ChangeSection(Section, Subsection);
242 /// SwitchSectionNoChange - Set the current section where code is being
243 /// emitted to @p Section. This is required to update CurSection. This
244 /// version does not call ChangeSection.
245 void SwitchSectionNoChange(const MCSection *Section,
246 const MCExpr *Subsection = 0) {
247 assert(Section && "Cannot switch to a null section!");
248 MCSectionSubPair curSection = SectionStack.back().first;
249 SectionStack.back().second = curSection;
250 if (MCSectionSubPair(Section, Subsection) != curSection)
251 SectionStack.back().first = MCSectionSubPair(Section, Subsection);
254 /// Initialize the streamer.
255 void InitStreamer() {
256 if (AutoInitSections)
260 /// Tell this MCStreamer to call InitSections upon initialization.
261 void setAutoInitSections(bool AutoInitSections) {
262 this->AutoInitSections = AutoInitSections;
265 /// InitSections - Create the default sections and set the initial one.
266 virtual void InitSections() = 0;
268 /// InitToTextSection - Create a text section and switch the streamer to it.
269 virtual void InitToTextSection() = 0;
271 /// EmitLabel - Emit a label for @p Symbol into the current section.
273 /// This corresponds to an assembler statement such as:
276 /// @param Symbol - The symbol to emit. A given symbol should only be
277 /// emitted as a label once, and symbols emitted as a label should never be
278 /// used in an assignment.
279 virtual void EmitLabel(MCSymbol *Symbol);
281 virtual void EmitDebugLabel(MCSymbol *Symbol);
283 virtual void EmitEHSymAttributes(const MCSymbol *Symbol,
286 /// EmitAssemblerFlag - Note in the output the specified @p Flag.
287 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) = 0;
289 /// EmitLinkerOptions - Emit the given list @p Options of strings as linker
290 /// options into the output.
291 virtual void EmitLinkerOptions(ArrayRef<std::string> Kind) {}
293 /// EmitDataRegion - Note in the output the specified region @p Kind.
294 virtual void EmitDataRegion(MCDataRegionType Kind) {}
296 /// EmitThumbFunc - Note in the output that the specified @p Func is
297 /// a Thumb mode function (ARM target only).
298 virtual void EmitThumbFunc(MCSymbol *Func) = 0;
300 /// getOrCreateSymbolData - Get symbol data for given symbol.
301 virtual MCSymbolData &getOrCreateSymbolData(MCSymbol *Symbol);
303 /// EmitAssignment - Emit an assignment of @p Value to @p Symbol.
305 /// This corresponds to an assembler statement such as:
308 /// The assignment generates no code, but has the side effect of binding the
309 /// value in the current context. For the assembly streamer, this prints the
310 /// binding into the .s file.
312 /// @param Symbol - The symbol being assigned to.
313 /// @param Value - The value for the symbol.
314 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) = 0;
316 /// EmitWeakReference - Emit an weak reference from @p Alias to @p Symbol.
318 /// This corresponds to an assembler statement such as:
319 /// .weakref alias, symbol
321 /// @param Alias - The alias that is being created.
322 /// @param Symbol - The symbol being aliased.
323 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) = 0;
325 /// EmitSymbolAttribute - Add the given @p Attribute to @p Symbol.
326 virtual bool EmitSymbolAttribute(MCSymbol *Symbol,
327 MCSymbolAttr Attribute) = 0;
329 /// EmitSymbolDesc - Set the @p DescValue for the @p Symbol.
331 /// @param Symbol - The symbol to have its n_desc field set.
332 /// @param DescValue - The value to set into the n_desc field.
333 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) = 0;
335 /// BeginCOFFSymbolDef - Start emitting COFF symbol definition
337 /// @param Symbol - The symbol to have its External & Type fields set.
338 virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) = 0;
340 /// EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.
342 /// @param StorageClass - The storage class the symbol should have.
343 virtual void EmitCOFFSymbolStorageClass(int StorageClass) = 0;
345 /// EmitCOFFSymbolType - Emit the type of the symbol.
347 /// @param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h)
348 virtual void EmitCOFFSymbolType(int Type) = 0;
350 /// EndCOFFSymbolDef - Marks the end of the symbol definition.
351 virtual void EndCOFFSymbolDef() = 0;
353 /// EmitCOFFSecRel32 - Emits a COFF section relative relocation.
355 /// @param Symbol - Symbol the section relative realocation should point to.
356 virtual void EmitCOFFSecRel32(MCSymbol const *Symbol);
358 /// EmitELFSize - Emit an ELF .size directive.
360 /// This corresponds to an assembler statement such as:
361 /// .size symbol, expression
363 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) = 0;
365 /// EmitCommonSymbol - Emit a common symbol.
367 /// @param Symbol - The common symbol to emit.
368 /// @param Size - The size of the common symbol.
369 /// @param ByteAlignment - The alignment of the symbol if
370 /// non-zero. This must be a power of 2.
371 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
372 unsigned ByteAlignment) = 0;
374 /// EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
376 /// @param Symbol - The common symbol to emit.
377 /// @param Size - The size of the common symbol.
378 /// @param ByteAlignment - The alignment of the common symbol in bytes.
379 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
380 unsigned ByteAlignment) = 0;
382 /// EmitZerofill - Emit the zerofill section and an optional symbol.
384 /// @param Section - The zerofill section to create and or to put the symbol
385 /// @param Symbol - The zerofill symbol to emit, if non-NULL.
386 /// @param Size - The size of the zerofill symbol.
387 /// @param ByteAlignment - The alignment of the zerofill symbol if
388 /// non-zero. This must be a power of 2 on some targets.
389 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
390 uint64_t Size = 0,unsigned ByteAlignment = 0) = 0;
392 /// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
394 /// @param Section - The thread local common section.
395 /// @param Symbol - The thread local common symbol to emit.
396 /// @param Size - The size of the symbol.
397 /// @param ByteAlignment - The alignment of the thread local common symbol
398 /// if non-zero. This must be a power of 2 on some targets.
399 virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
400 uint64_t Size, unsigned ByteAlignment = 0) = 0;
403 /// @name Generating Data
406 /// EmitBytes - Emit the bytes in \p Data into the output.
408 /// This is used to implement assembler directives such as .byte, .ascii,
410 virtual void EmitBytes(StringRef Data) = 0;
412 /// EmitValue - Emit the expression @p Value into the output as a native
413 /// integer of the given @p Size bytes.
415 /// This is used to implement assembler directives such as .word, .quad,
418 /// @param Value - The value to emit.
419 /// @param Size - The size of the integer (in bytes) to emit. This must
420 /// match a native machine width.
421 virtual void EmitValueImpl(const MCExpr *Value, unsigned Size) = 0;
423 void EmitValue(const MCExpr *Value, unsigned Size);
425 /// EmitIntValue - Special case of EmitValue that avoids the client having
426 /// to pass in a MCExpr for constant integers.
427 virtual void EmitIntValue(uint64_t Value, unsigned Size);
429 /// EmitAbsValue - Emit the Value, but try to avoid relocations. On MachO
430 /// this is done by producing
433 void EmitAbsValue(const MCExpr *Value, unsigned Size);
435 virtual void EmitULEB128Value(const MCExpr *Value) = 0;
437 virtual void EmitSLEB128Value(const MCExpr *Value) = 0;
439 /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
440 /// client having to pass in a MCExpr for constant integers.
441 void EmitULEB128IntValue(uint64_t Value, unsigned Padding = 0);
443 /// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
444 /// client having to pass in a MCExpr for constant integers.
445 void EmitSLEB128IntValue(int64_t Value);
447 /// EmitSymbolValue - Special case of EmitValue that avoids the client
448 /// having to pass in a MCExpr for MCSymbols.
449 void EmitSymbolValue(const MCSymbol *Sym, unsigned Size);
451 /// EmitGPRel64Value - Emit the expression @p Value into the output as a
452 /// gprel64 (64-bit GP relative) value.
454 /// This is used to implement assembler directives such as .gpdword on
455 /// targets that support them.
456 virtual void EmitGPRel64Value(const MCExpr *Value);
458 /// EmitGPRel32Value - Emit the expression @p Value into the output as a
459 /// gprel32 (32-bit GP relative) value.
461 /// This is used to implement assembler directives such as .gprel32 on
462 /// targets that support them.
463 virtual void EmitGPRel32Value(const MCExpr *Value);
465 /// EmitFill - Emit NumBytes bytes worth of the value specified by
466 /// FillValue. This implements directives such as '.space'.
467 virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue);
469 /// \brief Emit NumBytes worth of zeros.
470 /// This function properly handles data in virtual sections.
471 virtual void EmitZeros(uint64_t NumBytes);
473 /// EmitValueToAlignment - Emit some number of copies of @p Value until
474 /// the byte alignment @p ByteAlignment is reached.
476 /// If the number of bytes need to emit for the alignment is not a multiple
477 /// of @p ValueSize, then the contents of the emitted fill bytes is
480 /// This used to implement the .align assembler directive.
482 /// @param ByteAlignment - The alignment to reach. This must be a power of
483 /// two on some targets.
484 /// @param Value - The value to use when filling bytes.
485 /// @param ValueSize - The size of the integer (in bytes) to emit for
486 /// @p Value. This must match a native machine width.
487 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
488 /// the alignment cannot be reached in this many bytes, no bytes are
490 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
491 unsigned ValueSize = 1,
492 unsigned MaxBytesToEmit = 0) = 0;
494 /// EmitCodeAlignment - Emit nops until the byte alignment @p ByteAlignment
497 /// This used to align code where the alignment bytes may be executed. This
498 /// can emit different bytes for different sizes to optimize execution.
500 /// @param ByteAlignment - The alignment to reach. This must be a power of
501 /// two on some targets.
502 /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If
503 /// the alignment cannot be reached in this many bytes, no bytes are
505 virtual void EmitCodeAlignment(unsigned ByteAlignment,
506 unsigned MaxBytesToEmit = 0) = 0;
508 /// EmitValueToOffset - Emit some number of copies of @p Value until the
509 /// byte offset @p Offset is reached.
511 /// This is used to implement assembler directives such as .org.
513 /// @param Offset - The offset to reach. This may be an expression, but the
514 /// expression must be associated with the current section.
515 /// @param Value - The value to use when filling bytes.
516 /// @return false on success, true if the offset was invalid.
517 virtual bool EmitValueToOffset(const MCExpr *Offset,
518 unsigned char Value = 0) = 0;
522 /// EmitFileDirective - Switch to a new logical file. This is used to
523 /// implement the '.file "foo.c"' assembler directive.
524 virtual void EmitFileDirective(StringRef Filename) = 0;
526 /// EmitDwarfFileDirective - Associate a filename with a specified logical
527 /// file number. This implements the DWARF2 '.file 4 "foo.c"' assembler
529 virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
530 StringRef Filename, unsigned CUID = 0);
532 /// EmitDwarfLocDirective - This implements the DWARF2
533 // '.loc fileno lineno ...' assembler directive.
534 virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
535 unsigned Column, unsigned Flags,
537 unsigned Discriminator,
540 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
541 const MCSymbol *LastLabel,
542 const MCSymbol *Label,
543 unsigned PointerSize) = 0;
545 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
546 const MCSymbol *Label) {
549 void EmitDwarfSetLineAddr(int64_t LineDelta, const MCSymbol *Label,
552 virtual void EmitCompactUnwindEncoding(uint32_t CompactUnwindEncoding);
553 virtual void EmitCFISections(bool EH, bool Debug);
554 void EmitCFIStartProc();
555 void EmitCFIEndProc();
556 virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
557 virtual void EmitCFIDefCfaOffset(int64_t Offset);
558 virtual void EmitCFIDefCfaRegister(int64_t Register);
559 virtual void EmitCFIOffset(int64_t Register, int64_t Offset);
560 virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding);
561 virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding);
562 virtual void EmitCFIRememberState();
563 virtual void EmitCFIRestoreState();
564 virtual void EmitCFISameValue(int64_t Register);
565 virtual void EmitCFIRestore(int64_t Register);
566 virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset);
567 virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment);
568 virtual void EmitCFIEscape(StringRef Values);
569 virtual void EmitCFISignalFrame();
570 virtual void EmitCFIUndefined(int64_t Register);
571 virtual void EmitCFIRegister(int64_t Register1, int64_t Register2);
573 virtual void EmitWin64EHStartProc(const MCSymbol *Symbol);
574 virtual void EmitWin64EHEndProc();
575 virtual void EmitWin64EHStartChained();
576 virtual void EmitWin64EHEndChained();
577 virtual void EmitWin64EHHandler(const MCSymbol *Sym, bool Unwind,
579 virtual void EmitWin64EHHandlerData();
580 virtual void EmitWin64EHPushReg(unsigned Register);
581 virtual void EmitWin64EHSetFrame(unsigned Register, unsigned Offset);
582 virtual void EmitWin64EHAllocStack(unsigned Size);
583 virtual void EmitWin64EHSaveReg(unsigned Register, unsigned Offset);
584 virtual void EmitWin64EHSaveXMM(unsigned Register, unsigned Offset);
585 virtual void EmitWin64EHPushFrame(bool Code);
586 virtual void EmitWin64EHEndProlog();
588 /// EmitInstruction - Emit the given @p Instruction into the current
590 virtual void EmitInstruction(const MCInst &Inst) = 0;
592 /// \brief Set the bundle alignment mode from now on in the section.
593 /// The argument is the power of 2 to which the alignment is set. The
594 /// value 0 means turn the bundle alignment off.
595 virtual void EmitBundleAlignMode(unsigned AlignPow2) = 0;
597 /// \brief The following instructions are a bundle-locked group.
599 /// \param AlignToEnd - If true, the bundle-locked group will be aligned to
600 /// the end of a bundle.
601 virtual void EmitBundleLock(bool AlignToEnd) = 0;
603 /// \brief Ends a bundle-locked group.
604 virtual void EmitBundleUnlock() = 0;
606 /// EmitRawText - If this file is backed by a assembly streamer, this dumps
607 /// the specified string in the output .s file. This capability is
608 /// indicated by the hasRawTextSupport() predicate. By default this aborts.
609 virtual void EmitRawText(StringRef String);
610 void EmitRawText(const Twine &String);
612 /// ARM-related methods.
613 /// FIXME: Eventually we should have some "target MC streamer" and move
614 /// these methods there.
615 virtual void EmitFnStart();
616 virtual void EmitFnEnd();
617 virtual void EmitCantUnwind();
618 virtual void EmitPersonality(const MCSymbol *Personality);
619 virtual void EmitHandlerData();
620 virtual void EmitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0);
621 virtual void EmitPad(int64_t Offset);
622 virtual void EmitRegSave(const SmallVectorImpl<unsigned> &RegList,
625 /// PPC-related methods.
626 /// FIXME: Eventually replace it with some "target MC streamer" and move
627 /// these methods there.
628 virtual void EmitTCEntry(const MCSymbol &S);
630 /// FinishImpl - Streamer specific finalization.
631 virtual void FinishImpl() = 0;
632 /// Finish - Finish emission of machine code.
636 /// createNullStreamer - Create a dummy machine code streamer, which does
637 /// nothing. This is useful for timing the assembler front end.
638 MCStreamer *createNullStreamer(MCContext &Ctx);
640 /// createAsmStreamer - Create a machine code streamer which will print out
641 /// assembly for the native target, suitable for compiling with a native
644 /// \param InstPrint - If given, the instruction printer to use. If not given
645 /// the MCInst representation will be printed. This method takes ownership of
648 /// \param CE - If given, a code emitter to use to show the instruction
649 /// encoding inline with the assembly. This method takes ownership of \p CE.
651 /// \param TAB - If given, a target asm backend to use to show the fixup
652 /// information in conjunction with encoding information. This method takes
653 /// ownership of \p TAB.
655 /// \param ShowInst - Whether to show the MCInst representation inline with
657 MCStreamer *createAsmStreamer(MCContext &Ctx, formatted_raw_ostream &OS,
661 bool useDwarfDirectory,
662 MCInstPrinter *InstPrint = 0,
663 MCCodeEmitter *CE = 0,
664 MCAsmBackend *TAB = 0,
665 bool ShowInst = false);
667 /// createMachOStreamer - Create a machine code streamer which will generate
668 /// Mach-O format object files.
670 /// Takes ownership of \p TAB and \p CE.
671 MCStreamer *createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB,
672 raw_ostream &OS, MCCodeEmitter *CE,
673 bool RelaxAll = false);
675 /// createWinCOFFStreamer - Create a machine code streamer which will
676 /// generate Microsoft COFF format object files.
678 /// Takes ownership of \p TAB and \p CE.
679 MCStreamer *createWinCOFFStreamer(MCContext &Ctx,
681 MCCodeEmitter &CE, raw_ostream &OS,
682 bool RelaxAll = false);
684 /// createELFStreamer - Create a machine code streamer which will generate
685 /// ELF format object files.
686 MCStreamer *createELFStreamer(MCContext &Ctx, MCAsmBackend &TAB,
687 raw_ostream &OS, MCCodeEmitter *CE,
688 bool RelaxAll, bool NoExecStack);
690 /// createPureStreamer - Create a machine code streamer which will generate
691 /// "pure" MC object files, for use with MC-JIT and testing tools.
693 /// Takes ownership of \p TAB and \p CE.
694 MCStreamer *createPureStreamer(MCContext &Ctx, MCAsmBackend &TAB,
695 raw_ostream &OS, MCCodeEmitter *CE);
697 } // end namespace llvm