MCStreamer.cpp revision 9c77398d1c89f615735d304cd7eda3c3e9b1504f
1868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)//===- lib/MC/MCStreamer.cpp - Streaming Machine Code Output --------------===//
2868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)//
3868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)//                     The LLVM Compiler Infrastructure
4868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)//
5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// This file is distributed under the University of Illinois Open Source
6868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// License. See LICENSE.TXT for details.
7868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)//
8868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)//===----------------------------------------------------------------------===//
9868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
109ab5563a3196760eb381d102cbb2bc0f7abc6a50Ben Murdoch#include "llvm/MC/MCAsmInfo.h"
115e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)#include "llvm/MC/MCContext.h"
125e3f23d412006dc4db4e659864679f29341e113fTorne (Richard Coles)#include "llvm/MC/MCStreamer.h"
13eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "llvm/MC/MCExpr.h"
14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "llvm/MC/MCObjectWriter.h"
15868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "llvm/MC/MCSymbol.h"
16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "llvm/Support/ErrorHandling.h"
17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "llvm/Support/raw_ostream.h"
18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "llvm/ADT/SmallString.h"
19868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "llvm/ADT/Twine.h"
20868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include <cstdlib>
21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)using namespace llvm;
22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)MCStreamer::MCStreamer(MCContext &Ctx) : Context(Ctx), EmitEHFrame(true),
24868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                         EmitDebugFrame(false) {
25868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  const MCSection *section = NULL;
26868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  SectionStack.push_back(std::make_pair(section, section));
27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
28868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)MCStreamer::~MCStreamer() {
30868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
31868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
32868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const MCExpr *MCStreamer::BuildSymbolDiff(MCContext &Context,
33868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                          const MCSymbol *A,
34868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                          const MCSymbol *B) {
35868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
36868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  const MCExpr *ARef =
37868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    MCSymbolRefExpr::Create(A, Variant, Context);
38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  const MCExpr *BRef =
39868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    MCSymbolRefExpr::Create(B, Variant, Context);
40868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  const MCExpr *AddrDelta =
41868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    MCBinaryExpr::Create(MCBinaryExpr::Sub, ARef, BRef, Context);
42868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  return AddrDelta;
43868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
44868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
45868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)const MCExpr *MCStreamer::ForceExpAbs(MCStreamer *Streamer,
46868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                      MCContext &Context, const MCExpr* Expr) {
47868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) if (Context.getAsmInfo().hasAggressiveSymbolFolding())
48868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)   return Expr;
49868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
50868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) MCSymbol *ABS = Context.CreateTempSymbol();
51868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) Streamer->EmitAssignment(ABS, Expr);
52868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) return MCSymbolRefExpr::Create(ABS, Context);
53868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
54868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
55868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)raw_ostream &MCStreamer::GetCommentOS() {
56868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // By default, discard comments.
57868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  return nulls();
58868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
59868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
60868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitDwarfSetLineAddr(int64_t LineDelta,
61868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                      const MCSymbol *Label, int PointerSize) {
62868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // emit the sequence to set the address
63868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitIntValue(dwarf::DW_LNS_extended_op, 1);
64868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitULEB128IntValue(PointerSize + 1);
65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitIntValue(dwarf::DW_LNE_set_address, 1);
66868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitSymbolValue(Label, PointerSize);
67868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
68868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // emit the sequence for the LineDelta (from 1) and a zero address delta.
69868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfLineAddr::Emit(this, LineDelta, 0);
70868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
71868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
72868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// EmitIntValue - Special case of EmitValue that avoids the client having to
73868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// pass in a MCExpr for constant integers.
74868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size,
75868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                              unsigned AddrSpace) {
76868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  assert(Size <= 8 && "Invalid size");
77868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  assert((isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) &&
78868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)         "Invalid size");
79868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  char buf[8];
80868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // FIXME: Endianness assumption.
81868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  for (unsigned i = 0; i != Size; ++i)
82868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    buf[i] = uint8_t(Value >> (i * 8));
83868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitBytes(StringRef(buf, Size), AddrSpace);
84868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
85868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
86868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
87868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// client having to pass in a MCExpr for constant integers.
88868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned AddrSpace) {
89868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  SmallString<32> Tmp;
90868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  raw_svector_ostream OSE(Tmp);
91868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCObjectWriter::EncodeULEB128(Value, OSE);
92868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitBytes(OSE.str(), AddrSpace);
93868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
94868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
95868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
96868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// client having to pass in a MCExpr for constant integers.
97868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace) {
98868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  SmallString<32> Tmp;
99868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  raw_svector_ostream OSE(Tmp);
100868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCObjectWriter::EncodeSLEB128(Value, OSE);
101868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitBytes(OSE.str(), AddrSpace);
102868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
103868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
104868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size,
105868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                              unsigned AddrSpace) {
106868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (getContext().getAsmInfo().hasAggressiveSymbolFolding()) {
107868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    EmitValue(Value, Size, AddrSpace);
108868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    return;
109868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  }
110868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *ABS = getContext().CreateTempSymbol();
111868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitAssignment(ABS, Value);
112868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitSymbolValue(ABS, Size, AddrSpace);
113868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
114868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
115868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
116868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size,
117868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                           unsigned AddrSpace) {
118868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitValueImpl(Value, Size, AddrSpace);
119868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
120868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
121868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
122868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                  unsigned AddrSpace) {
123868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitValueImpl(MCSymbolRefExpr::Create(Sym, getContext()), Size,
124868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                AddrSpace);
125868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
126868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
127868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitGPRel32Value(const MCExpr *Value) {
128868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  report_fatal_error("unsupported directive in streamer");
129868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
130868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
131868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// EmitFill - Emit NumBytes bytes worth of the value specified by
132868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// FillValue.  This implements directives such as '.space'.
133868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue,
134868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                          unsigned AddrSpace) {
135868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  const MCExpr *E = MCConstantExpr::Create(FillValue, getContext());
136868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  for (uint64_t i = 0, e = NumBytes; i != e; ++i)
137868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    EmitValue(E, 1, AddrSpace);
138868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
139868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
140868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)bool MCStreamer::EmitDwarfFileDirective(unsigned FileNo,
141868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                        StringRef Filename) {
142868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  return getContext().GetDwarfFile(Filename, FileNo) == 0;
143868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
144868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
145868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
146868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                       unsigned Column, unsigned Flags,
147868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                       unsigned Isa,
148868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                       unsigned Discriminator,
149868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                       StringRef FileName) {
150868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa,
151868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                  Discriminator);
152868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
153868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
154868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)MCDwarfFrameInfo *MCStreamer::getCurrentFrameInfo() {
155868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (FrameInfos.empty())
156868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    return NULL;
157868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  return &FrameInfos.back();
158868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
159868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
160868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EnsureValidFrame() {
161868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
162868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (!CurFrame || CurFrame->End)
163868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    report_fatal_error("No open frame");
164868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
165868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
166a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)void MCStreamer::EmitEHSymAttributes(const MCSymbol *Symbol,
167868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                     MCSymbol *EHSymbol) {
168868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
169868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
170868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitLabel(MCSymbol *Symbol) {
171868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
172868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  assert(getCurrentSection() && "Cannot emit before setting section!");
173868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  Symbol->setSection(*getCurrentSection());
174868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
175868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  StringRef Prefix = getContext().getAsmInfo().getPrivateGlobalPrefix();
176868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (!Symbol->getName().startswith(Prefix))
177868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    LastNonPrivate = Symbol;
178868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
179868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
180868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFISections(bool EH, bool Debug) {
181868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  assert(EH || Debug);
182868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitEHFrame = EH;
183868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitDebugFrame = Debug;
184868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
185868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
186868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIStartProc() {
187868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
188868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (CurFrame && !CurFrame->End)
189868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    report_fatal_error("Starting a frame before finishing the previous one!");
190868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo Frame;
191868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  Frame.Begin = getContext().CreateTempSymbol();
192868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  Frame.Function = LastNonPrivate;
193868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Frame.Begin);
194868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  FrameInfos.push_back(Frame);
195868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
196868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
197868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIEndProc() {
198868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
199868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
200868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->End = getContext().CreateTempSymbol();
201868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(CurFrame->End);
202868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
203868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
204868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIDefCfa(int64_t Register, int64_t Offset) {
205868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
206868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
207868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
208868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
209868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Dest(MachineLocation::VirtualFP);
210868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Source(Register, -Offset);
211868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(Label, Dest, Source);
212868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
213868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
214868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
215868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIDefCfaOffset(int64_t Offset) {
216868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
217868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
218868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
219868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
220868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Dest(MachineLocation::VirtualFP);
221868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Source(MachineLocation::VirtualFP, -Offset);
222868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(Label, Dest, Source);
223868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
224868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
225868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
226868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIAdjustCfaOffset(int64_t Adjustment) {
227868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
228868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
229868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
230868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
231868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Dest(MachineLocation::VirtualFP);
232868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Source(MachineLocation::VirtualFP, Adjustment);
233868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(MCCFIInstruction::RelMove, Label, Dest, Source);
234868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
235868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
236868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
237868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIDefCfaRegister(int64_t Register) {
238868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
239868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
240868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
241868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
242868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Dest(Register);
243868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Source(MachineLocation::VirtualFP);
244868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(Label, Dest, Source);
245868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
246868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
247868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
248868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIOffset(int64_t Register, int64_t Offset) {
249868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
250868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
251868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
252868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
253868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Dest(Register, Offset);
254868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Source(Register, Offset);
255868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(Label, Dest, Source);
256868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
257a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}
258868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
259868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIRelOffset(int64_t Register, int64_t Offset) {
260868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
261868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
262868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
263868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
264868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Dest(Register, Offset);
265868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MachineLocation Source(Register, Offset);
266868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(MCCFIInstruction::RelMove, Label, Dest, Source);
267868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
268868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
269868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
270868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIPersonality(const MCSymbol *Sym,
271868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                                    unsigned Encoding) {
272868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
273868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
274868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Personality = Sym;
275868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->PersonalityEncoding = Encoding;
276868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
277868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
278868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFILsda(const MCSymbol *Sym, unsigned Encoding) {
279868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
280868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
281868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Lsda = Sym;
282868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->LsdaEncoding = Encoding;
283868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
284868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
285868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIRememberState() {
286868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
287868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
288868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
289868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
290868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(MCCFIInstruction::Remember, Label);
291868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
292868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
293868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
294868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFIRestoreState() {
295868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // FIXME: Error if there is no matching cfi_remember_state.
296868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
297868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
298868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
299868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
300868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(MCCFIInstruction::Restore, Label);
301868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
302868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
303868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
304868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCFISameValue(int64_t Register) {
305868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EnsureValidFrame();
306868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
307868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCSymbol *Label = getContext().CreateTempSymbol();
308868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitLabel(Label);
309868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  MCCFIInstruction Instruction(MCCFIInstruction::SameValue, Label, Register);
310868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  CurFrame->Instructions.push_back(Instruction);
311868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
312868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
313868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHStartProc(MCSymbol *Symbol, MCSymbol *EHandler)
314868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
315868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
316868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
317868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
318868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
319868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHEndProc()
320868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
321868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
322868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
323868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
324868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
325868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHPushReg(int64_t Register)
326868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
327868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
328868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
329868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
330868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
331868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHSetFrame(int64_t Register, int64_t Offset)
332868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
333868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
334868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
335868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
336868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
337868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHAllocStack(int64_t Size)
338868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
339868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
340868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
341868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
342868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
343868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHSaveReg(int64_t Register, int64_t Offset)
344868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
345868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
346868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
347868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
348868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
349868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHPushFrame(bool Code)
350868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
351868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
352868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
353868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
354868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
355868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitWin64EHEndProlog()
356868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles){
357868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
358868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
359868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
360868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
361868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitFnStart() {
362868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
363868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
364868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
365868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
366868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitFnEnd() {
367868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
368868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
369868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
370868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
371868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitCantUnwind() {
372868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
373868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
374868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
375868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
376868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitHandlerData() {
377868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
378868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
379868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
380868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
381868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitPersonality(const MCSymbol *Personality) {
382868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
383868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
384868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
385868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
386868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset) {
387868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
388868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
389868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
390868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
391868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitPad(int64_t Offset) {
392868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
393868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
394868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
395868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
396868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitRegSave(const SmallVectorImpl<unsigned> &RegList, bool) {
397868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "Not implemented yet\n";
398868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
399868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
400868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
401868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// EmitRawText - If this file is backed by an assembly streamer, this dumps
402868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// the specified string in the output .s file.  This capability is
403868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)/// indicated by the hasRawTextSupport() predicate.
404868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitRawText(StringRef String) {
405868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  errs() << "EmitRawText called on an MCStreamer that doesn't support it, "
406868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  " something must not be fully mc'ized\n";
407868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  abort();
408868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
409868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
410868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitRawText(const Twine &T) {
411868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  SmallString<128> Str;
412868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  T.toVector(Str);
413868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  EmitRawText(Str.str());
414868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
415868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
416868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void MCStreamer::EmitFrames(bool usingCFI) {
417868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (!getNumFrameInfos())
418868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    return;
419868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
420868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (EmitEHFrame)
421868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    MCDwarfFrameEmitter::Emit(*this, usingCFI, true);
422868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
423868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (EmitDebugFrame)
424868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    MCDwarfFrameEmitter::Emit(*this, usingCFI, false);
425868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
426868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)