blob: b6960695625da104e532c135cceedc7673d95faa [file] [log] [blame]
Chris Lattner9efd1182010-04-04 19:09:29 +00001//===-- AsmPrinterDwarf.cpp - AsmPrinter Dwarf Support --------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file implements the Dwarf emissions parts of AsmPrinter.
11//
12//===----------------------------------------------------------------------===//
13
14#define DEBUG_TYPE "asm-printer"
Eric Christopher29e874d2014-03-07 22:40:37 +000015#include "ByteStreamer.h"
Chris Lattner9efd1182010-04-04 19:09:29 +000016#include "llvm/CodeGen/AsmPrinter.h"
Eric Christopher698a8ab2014-03-07 01:44:14 +000017#include "llvm/ADT/SmallBitVector.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000018#include "llvm/ADT/Twine.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000019#include "llvm/IR/DataLayout.h"
Chris Lattner9efd1182010-04-04 19:09:29 +000020#include "llvm/MC/MCAsmInfo.h"
Chris Lattner70a4fce2010-04-04 23:25:33 +000021#include "llvm/MC/MCSection.h"
Chris Lattner9efd1182010-04-04 19:09:29 +000022#include "llvm/MC/MCStreamer.h"
Chris Lattner70a4fce2010-04-04 23:25:33 +000023#include "llvm/MC/MCSymbol.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000024#include "llvm/MC/MachineLocation.h"
25#include "llvm/Support/Dwarf.h"
26#include "llvm/Support/ErrorHandling.h"
Anton Korobeynikov2f931282011-01-10 12:39:04 +000027#include "llvm/Target/TargetFrameLowering.h"
Chris Lattnere619c0d2010-04-04 20:20:50 +000028#include "llvm/Target/TargetLoweringObjectFile.h"
29#include "llvm/Target/TargetMachine.h"
Chris Lattneraabc6042010-04-04 23:41:46 +000030#include "llvm/Target/TargetRegisterInfo.h"
Chris Lattner9efd1182010-04-04 19:09:29 +000031using namespace llvm;
32
Chris Lattneraabc6042010-04-04 23:41:46 +000033//===----------------------------------------------------------------------===//
34// Dwarf Emission Helper Routines
35//===----------------------------------------------------------------------===//
36
Chris Lattner9efd1182010-04-04 19:09:29 +000037/// EmitSLEB128 - emit the specified signed leb128 value.
David Blaikie5acff7e2013-06-23 18:31:11 +000038void AsmPrinter::EmitSLEB128(int64_t Value, const char *Desc) const {
Chris Lattner9efd1182010-04-04 19:09:29 +000039 if (isVerbose() && Desc)
40 OutStreamer.AddComment(Desc);
Chris Lattner9efd1182010-04-04 19:09:29 +000041
Benjamin Kramerc74798d2011-11-05 11:52:44 +000042 OutStreamer.EmitSLEB128IntValue(Value);
Chris Lattner9efd1182010-04-04 19:09:29 +000043}
44
45/// EmitULEB128 - emit the specified signed leb128 value.
David Blaikie5acff7e2013-06-23 18:31:11 +000046void AsmPrinter::EmitULEB128(uint64_t Value, const char *Desc,
Chris Lattner9efd1182010-04-04 19:09:29 +000047 unsigned PadTo) const {
48 if (isVerbose() && Desc)
49 OutStreamer.AddComment(Desc);
Rafael Espindola38d07562010-11-04 18:17:08 +000050
Eric Christopherbf7bc492013-01-09 03:52:05 +000051 OutStreamer.EmitULEB128IntValue(Value, PadTo);
Chris Lattner9efd1182010-04-04 19:09:29 +000052}
53
Chris Lattnerbaf2be02010-04-04 20:01:25 +000054/// EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value.
55void AsmPrinter::EmitCFAByte(unsigned Val) const {
56 if (isVerbose()) {
Eric Christopher596077b2013-12-04 22:26:43 +000057 if (Val >= dwarf::DW_CFA_offset && Val < dwarf::DW_CFA_offset + 64)
Eric Christopher1d6bd412012-11-20 20:34:47 +000058 OutStreamer.AddComment("DW_CFA_offset + Reg (" +
Eric Christopher596077b2013-12-04 22:26:43 +000059 Twine(Val - dwarf::DW_CFA_offset) + ")");
Chris Lattnerbaf2be02010-04-04 20:01:25 +000060 else
61 OutStreamer.AddComment(dwarf::CallFrameString(Val));
62 }
Eric Christopherce0cfce2013-01-09 01:35:34 +000063 OutStreamer.EmitIntValue(Val, 1);
Chris Lattnerbaf2be02010-04-04 20:01:25 +000064}
65
Chris Lattnerb75af3c2010-04-04 20:04:21 +000066static const char *DecodeDWARFEncoding(unsigned Encoding) {
67 switch (Encoding) {
Eric Christopher596077b2013-12-04 22:26:43 +000068 case dwarf::DW_EH_PE_absptr:
69 return "absptr";
70 case dwarf::DW_EH_PE_omit:
71 return "omit";
72 case dwarf::DW_EH_PE_pcrel:
73 return "pcrel";
74 case dwarf::DW_EH_PE_udata4:
75 return "udata4";
76 case dwarf::DW_EH_PE_udata8:
77 return "udata8";
78 case dwarf::DW_EH_PE_sdata4:
79 return "sdata4";
80 case dwarf::DW_EH_PE_sdata8:
81 return "sdata8";
82 case dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata4:
83 return "pcrel udata4";
84 case dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4:
85 return "pcrel sdata4";
86 case dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8:
87 return "pcrel udata8";
88 case dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata8:
89 return "pcrel sdata8";
90 case dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata4
91 :
Chris Lattnerb75af3c2010-04-04 20:04:21 +000092 return "indirect pcrel udata4";
Eric Christopher596077b2013-12-04 22:26:43 +000093 case dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4
94 :
Chris Lattnerb75af3c2010-04-04 20:04:21 +000095 return "indirect pcrel sdata4";
Eric Christopher596077b2013-12-04 22:26:43 +000096 case dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8
97 :
Chris Lattnerb75af3c2010-04-04 20:04:21 +000098 return "indirect pcrel udata8";
Eric Christopher596077b2013-12-04 22:26:43 +000099 case dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata8
100 :
Chris Lattnerb75af3c2010-04-04 20:04:21 +0000101 return "indirect pcrel sdata8";
102 }
Eric Christopher1d6bd412012-11-20 20:34:47 +0000103
Chris Lattnerb75af3c2010-04-04 20:04:21 +0000104 return "<unknown encoding>";
105}
106
Chris Lattnerb75af3c2010-04-04 20:04:21 +0000107/// EmitEncodingByte - Emit a .byte 42 directive that corresponds to an
108/// encoding. If verbose assembly output is enabled, we output comments
109/// describing the encoding. Desc is an optional string saying what the
110/// encoding is specifying (e.g. "LSDA").
Chris Lattneraabc6042010-04-04 23:41:46 +0000111void AsmPrinter::EmitEncodingByte(unsigned Val, const char *Desc) const {
Chris Lattnerb75af3c2010-04-04 20:04:21 +0000112 if (isVerbose()) {
Eric Christophercb7119e2013-12-04 22:29:02 +0000113 if (Desc)
Eric Christopher596077b2013-12-04 22:26:43 +0000114 OutStreamer.AddComment(Twine(Desc) + " Encoding = " +
Chris Lattnerb75af3c2010-04-04 20:04:21 +0000115 Twine(DecodeDWARFEncoding(Val)));
116 else
Eric Christopher596077b2013-12-04 22:26:43 +0000117 OutStreamer.AddComment(Twine("Encoding = ") + DecodeDWARFEncoding(Val));
Chris Lattnerb75af3c2010-04-04 20:04:21 +0000118 }
Eric Christopher1d6bd412012-11-20 20:34:47 +0000119
Eric Christopherce0cfce2013-01-09 01:35:34 +0000120 OutStreamer.EmitIntValue(Val, 1);
Chris Lattnerb75af3c2010-04-04 20:04:21 +0000121}
122
Chris Lattnere619c0d2010-04-04 20:20:50 +0000123/// GetSizeOfEncodedValue - Return the size of the encoding in bytes.
124unsigned AsmPrinter::GetSizeOfEncodedValue(unsigned Encoding) const {
125 if (Encoding == dwarf::DW_EH_PE_omit)
126 return 0;
Eric Christopher1d6bd412012-11-20 20:34:47 +0000127
Chris Lattnere619c0d2010-04-04 20:20:50 +0000128 switch (Encoding & 0x07) {
Eric Christopher596077b2013-12-04 22:26:43 +0000129 default:
130 llvm_unreachable("Invalid encoded value.");
131 case dwarf::DW_EH_PE_absptr:
132 return TM.getDataLayout()->getPointerSize();
133 case dwarf::DW_EH_PE_udata2:
134 return 2;
135 case dwarf::DW_EH_PE_udata4:
136 return 4;
137 case dwarf::DW_EH_PE_udata8:
138 return 8;
Chris Lattnere619c0d2010-04-04 20:20:50 +0000139 }
140}
141
Eric Christopher1d6bd412012-11-20 20:34:47 +0000142void AsmPrinter::EmitTTypeReference(const GlobalValue *GV,
143 unsigned Encoding) const {
Anton Korobeynikov097b0e92012-11-19 21:17:20 +0000144 if (GV) {
145 const TargetLoweringObjectFile &TLOF = getObjFileLowering();
Eric Christopher1d6bd412012-11-20 20:34:47 +0000146
Anton Korobeynikov097b0e92012-11-19 21:17:20 +0000147 const MCExpr *Exp =
Rafael Espindoladaeafb42014-02-19 17:23:20 +0000148 TLOF.getTTypeGlobalReference(GV, Encoding, *Mang, TM, MMI, OutStreamer);
Eric Christopherce0cfce2013-01-09 01:35:34 +0000149 OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding));
Anton Korobeynikov097b0e92012-11-19 21:17:20 +0000150 } else
Eric Christopherce0cfce2013-01-09 01:35:34 +0000151 OutStreamer.EmitIntValue(0, GetSizeOfEncodedValue(Encoding));
Chris Lattnere619c0d2010-04-04 20:20:50 +0000152}
Chris Lattner70a4fce2010-04-04 23:25:33 +0000153
154/// EmitSectionOffset - Emit the 4-byte offset of Label from the start of its
155/// section. This can be done with a special directive if the target supports
156/// it (e.g. cygwin) or by emitting it as an offset from a label at the start
157/// of the section.
158///
159/// SectionLabel is a temporary label emitted at the start of the section that
160/// Label lives in.
161void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
162 const MCSymbol *SectionLabel) const {
163 // On COFF targets, we have to emit the special .secrel32 directive.
Matt Arsenault034ca0f2013-04-22 22:49:11 +0000164 if (MAI->needsDwarfSectionOffsetDirective()) {
Rafael Espindolad3df3d32011-12-17 01:14:52 +0000165 OutStreamer.EmitCOFFSecRel32(Label);
Chris Lattner70a4fce2010-04-04 23:25:33 +0000166 return;
167 }
Eric Christopher1d6bd412012-11-20 20:34:47 +0000168
Chris Lattner70a4fce2010-04-04 23:25:33 +0000169 // Get the section that we're referring to, based on SectionLabel.
170 const MCSection &Section = SectionLabel->getSection();
Eric Christopher1d6bd412012-11-20 20:34:47 +0000171
Chris Lattner70a4fce2010-04-04 23:25:33 +0000172 // If Label has already been emitted, verify that it is in the same section as
173 // section label for sanity.
174 assert((!Label->isInSection() || &Label->getSection() == &Section) &&
175 "Section offset using wrong section base for label");
Eric Christopher1d6bd412012-11-20 20:34:47 +0000176
Duncan Sandsb847bf52011-03-12 13:07:37 +0000177 // If the section in question will end up with an address of 0 anyway, we can
178 // just emit an absolute reference to save a relocation.
179 if (Section.isBaseAddressKnownZero()) {
Eric Christopherce0cfce2013-01-09 01:35:34 +0000180 OutStreamer.EmitSymbolValue(Label, 4);
Duncan Sandsb847bf52011-03-12 13:07:37 +0000181 return;
182 }
Eric Christopher1d6bd412012-11-20 20:34:47 +0000183
Chris Lattner70a4fce2010-04-04 23:25:33 +0000184 // Otherwise, emit it as a label difference from the start of the section.
185 EmitLabelDifference(Label, SectionLabel, 4);
186}
187
Eric Christopher698a8ab2014-03-07 01:44:14 +0000188/// Emit a dwarf register operation.
Eric Christopher29e874d2014-03-07 22:40:37 +0000189static void emitDwarfRegOp(ByteStreamer &Streamer, int Reg) {
Eric Christopher698a8ab2014-03-07 01:44:14 +0000190 assert(Reg >= 0);
191 if (Reg < 32) {
Eric Christopher29e874d2014-03-07 22:40:37 +0000192 Streamer.EmitInt8(dwarf::DW_OP_reg0 + Reg,
193 dwarf::OperationEncodingString(dwarf::DW_OP_reg0 + Reg));
Eric Christopher698a8ab2014-03-07 01:44:14 +0000194 } else {
Eric Christopher29e874d2014-03-07 22:40:37 +0000195 Streamer.EmitInt8(dwarf::DW_OP_regx, "DW_OP_regx");
196 Streamer.EmitULEB128(Reg, Twine(Reg));
Eric Christopher698a8ab2014-03-07 01:44:14 +0000197 }
198}
199
200/// Emit an (double-)indirect dwarf register operation.
Eric Christopher29e874d2014-03-07 22:40:37 +0000201static void emitDwarfRegOpIndirect(ByteStreamer &Streamer, int Reg, int Offset,
Eric Christopher5c303202014-03-07 21:27:42 +0000202 bool Deref) {
Eric Christopher698a8ab2014-03-07 01:44:14 +0000203 assert(Reg >= 0);
204 if (Reg < 32) {
Eric Christopher29e874d2014-03-07 22:40:37 +0000205 Streamer.EmitInt8(dwarf::DW_OP_breg0 + Reg,
206 dwarf::OperationEncodingString(dwarf::DW_OP_breg0 + Reg));
Eric Christopher698a8ab2014-03-07 01:44:14 +0000207 } else {
Eric Christopher29e874d2014-03-07 22:40:37 +0000208 Streamer.EmitInt8(dwarf::DW_OP_bregx, "DW_OP_bregx");
209 Streamer.EmitULEB128(Reg, Twine(Reg));
Eric Christopher698a8ab2014-03-07 01:44:14 +0000210 }
Eric Christopher29e874d2014-03-07 22:40:37 +0000211 Streamer.EmitSLEB128(Offset);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000212 if (Deref)
Eric Christopher29e874d2014-03-07 22:40:37 +0000213 Streamer.EmitInt8(dwarf::DW_OP_deref, "DW_OP_deref");
Eric Christopher698a8ab2014-03-07 01:44:14 +0000214}
215
216/// Emit a dwarf register operation for describing
217/// - a small value occupying only part of a register or
218/// - a small register representing only part of a value.
Eric Christopher29e874d2014-03-07 22:40:37 +0000219static void emitDwarfOpPiece(ByteStreamer &Streamer, unsigned Size,
Eric Christopher5c303202014-03-07 21:27:42 +0000220 unsigned Offset) {
Eric Christopher698a8ab2014-03-07 01:44:14 +0000221 assert(Size > 0);
222 if (Offset > 0) {
Eric Christopher29e874d2014-03-07 22:40:37 +0000223 Streamer.EmitInt8(dwarf::DW_OP_bit_piece, "DW_OP_bit_piece");
224 Streamer.EmitULEB128(Size, Twine(Size));
225 Streamer.EmitULEB128(Offset, Twine(Offset));
Eric Christopher698a8ab2014-03-07 01:44:14 +0000226 } else {
Eric Christopher29e874d2014-03-07 22:40:37 +0000227 Streamer.EmitInt8(dwarf::DW_OP_piece, "DW_OP_piece");
Eric Christopher698a8ab2014-03-07 01:44:14 +0000228 unsigned ByteSize = Size / 8; // Assuming 8 bits per byte.
Eric Christopher29e874d2014-03-07 22:40:37 +0000229 Streamer.EmitULEB128(ByteSize, Twine(ByteSize));
Eric Christopher698a8ab2014-03-07 01:44:14 +0000230 }
231}
232
233/// Some targets do not provide a DWARF register number for every
234/// register. This function attempts to emit a dwarf register by
235/// emitting a piece of a super-register or by piecing together
236/// multiple subregisters that alias the register.
Eric Christopher29e874d2014-03-07 22:40:37 +0000237static void EmitDwarfRegOpPiece(ByteStreamer &Streamer, const AsmPrinter &AP,
Eric Christopher698a8ab2014-03-07 01:44:14 +0000238 const MachineLocation &MLoc) {
239 assert(!MLoc.isIndirect());
240 const TargetRegisterInfo *TRI = AP.TM.getRegisterInfo();
241 int Reg = TRI->getDwarfRegNum(MLoc.getReg(), false);
242
243 // Walk up the super-register chain until we find a valid number.
244 // For example, EAX on x86_64 is a 32-bit piece of RAX with offset 0.
245 for (MCSuperRegIterator SR(MLoc.getReg(), TRI); SR.isValid(); ++SR) {
246 Reg = TRI->getDwarfRegNum(*SR, false);
247 if (Reg >= 0) {
248 unsigned Idx = TRI->getSubRegIndex(*SR, MLoc.getReg());
249 unsigned Size = TRI->getSubRegIdxSize(Idx);
250 unsigned Offset = TRI->getSubRegIdxOffset(Idx);
251 AP.OutStreamer.AddComment("super-register");
Eric Christopher29e874d2014-03-07 22:40:37 +0000252 emitDwarfRegOp(Streamer, Reg);
253 emitDwarfOpPiece(Streamer, Size, Offset);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000254 return;
255 }
256 }
257
258 // Otherwise, attempt to find a covering set of sub-register numbers.
259 // For example, Q0 on ARM is a composition of D0+D1.
260 //
261 // Keep track of the current position so we can emit the more
262 // efficient DW_OP_piece.
263 unsigned CurPos = 0;
264 // The size of the register in bits, assuming 8 bits per byte.
Eric Christopher5c303202014-03-07 21:27:42 +0000265 unsigned RegSize = TRI->getMinimalPhysRegClass(MLoc.getReg())->getSize() * 8;
Eric Christopher698a8ab2014-03-07 01:44:14 +0000266 // Keep track of the bits in the register we already emitted, so we
267 // can avoid emitting redundant aliasing subregs.
268 SmallBitVector Coverage(RegSize, false);
269 for (MCSubRegIterator SR(MLoc.getReg(), TRI); SR.isValid(); ++SR) {
270 unsigned Idx = TRI->getSubRegIndex(MLoc.getReg(), *SR);
271 unsigned Size = TRI->getSubRegIdxSize(Idx);
272 unsigned Offset = TRI->getSubRegIdxOffset(Idx);
273 Reg = TRI->getDwarfRegNum(*SR, false);
274
275 // Intersection between the bits we already emitted and the bits
276 // covered by this subregister.
277 SmallBitVector Intersection(RegSize, false);
Eric Christopher5c303202014-03-07 21:27:42 +0000278 Intersection.set(Offset, Offset + Size);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000279 Intersection ^= Coverage;
280
281 // If this sub-register has a DWARF number and we haven't covered
282 // its range, emit a DWARF piece for it.
283 if (Reg >= 0 && Intersection.any()) {
284 AP.OutStreamer.AddComment("sub-register");
Eric Christopher29e874d2014-03-07 22:40:37 +0000285 emitDwarfRegOp(Streamer, Reg);
286 emitDwarfOpPiece(Streamer, Size, Offset == CurPos ? 0 : Offset);
Eric Christopher5c303202014-03-07 21:27:42 +0000287 CurPos = Offset + Size;
Eric Christopher698a8ab2014-03-07 01:44:14 +0000288
289 // Mark it as emitted.
Eric Christopher5c303202014-03-07 21:27:42 +0000290 Coverage.set(Offset, Offset + Size);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000291 }
292 }
293
294 if (CurPos == 0) {
295 // FIXME: We have no reasonable way of handling errors in here.
Eric Christopher29e874d2014-03-07 22:40:37 +0000296 Streamer.EmitInt8(dwarf::DW_OP_nop,
297 "nop (could not find a dwarf register number)");
Eric Christopher698a8ab2014-03-07 01:44:14 +0000298 }
299}
300
301/// EmitDwarfRegOp - Emit dwarf register operation.
Eric Christopher29e874d2014-03-07 22:40:37 +0000302void AsmPrinter::EmitDwarfRegOp(ByteStreamer &Streamer,
303 const MachineLocation &MLoc,
Eric Christopher698a8ab2014-03-07 01:44:14 +0000304 bool Indirect) const {
305 const TargetRegisterInfo *TRI = TM.getRegisterInfo();
306 int Reg = TRI->getDwarfRegNum(MLoc.getReg(), false);
307 if (Reg < 0) {
308 // We assume that pointers are always in an addressable register.
309 if (Indirect || MLoc.isIndirect()) {
310 // FIXME: We have no reasonable way of handling errors in here. The
311 // caller might be in the middle of a dwarf expression. We should
312 // probably assert that Reg >= 0 once debug info generation is more
313 // mature.
Eric Christopher29e874d2014-03-07 22:40:37 +0000314 Streamer.EmitInt8(dwarf::DW_OP_nop,
315 "nop (invalid dwarf register number for indirect loc)");
Eric Christopher698a8ab2014-03-07 01:44:14 +0000316 return;
317 }
318
319 // Attempt to find a valid super- or sub-register.
320 if (!Indirect && !MLoc.isIndirect())
Eric Christopher29e874d2014-03-07 22:40:37 +0000321 return EmitDwarfRegOpPiece(Streamer, *this, MLoc);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000322 }
323
324 if (MLoc.isIndirect())
Eric Christopher29e874d2014-03-07 22:40:37 +0000325 emitDwarfRegOpIndirect(Streamer, Reg, MLoc.getOffset(), Indirect);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000326 else if (Indirect)
Eric Christopher29e874d2014-03-07 22:40:37 +0000327 emitDwarfRegOpIndirect(Streamer, Reg, 0, false);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000328 else
Eric Christopher29e874d2014-03-07 22:40:37 +0000329 emitDwarfRegOp(Streamer, Reg);
Eric Christopher698a8ab2014-03-07 01:44:14 +0000330}
331
Chris Lattneraabc6042010-04-04 23:41:46 +0000332//===----------------------------------------------------------------------===//
333// Dwarf Lowering Routines
334//===----------------------------------------------------------------------===//
Chris Lattner70a4fce2010-04-04 23:25:33 +0000335
Rafael Espindola227144c2013-05-13 01:16:13 +0000336void AsmPrinter::emitCFIInstruction(const MCCFIInstruction &Inst) const {
337 switch (Inst.getOperation()) {
338 default:
339 llvm_unreachable("Unexpected instruction");
340 case MCCFIInstruction::OpDefCfaOffset:
341 OutStreamer.EmitCFIDefCfaOffset(Inst.getOffset());
342 break;
343 case MCCFIInstruction::OpDefCfa:
344 OutStreamer.EmitCFIDefCfa(Inst.getRegister(), Inst.getOffset());
345 break;
346 case MCCFIInstruction::OpDefCfaRegister:
347 OutStreamer.EmitCFIDefCfaRegister(Inst.getRegister());
348 break;
349 case MCCFIInstruction::OpOffset:
350 OutStreamer.EmitCFIOffset(Inst.getRegister(), Inst.getOffset());
351 break;
Venkatraman Govindaraju4c0cdd72013-09-26 15:11:00 +0000352 case MCCFIInstruction::OpRegister:
353 OutStreamer.EmitCFIRegister(Inst.getRegister(), Inst.getRegister2());
354 break;
Venkatraman Govindaraju3816d432013-09-26 14:49:40 +0000355 case MCCFIInstruction::OpWindowSave:
356 OutStreamer.EmitCFIWindowSave();
357 break;
Oliver Stannardb14c6252014-04-02 16:10:33 +0000358 case MCCFIInstruction::OpSameValue:
359 OutStreamer.EmitCFISameValue(Inst.getRegister());
360 break;
Rafael Espindolabeb74c32011-04-15 20:32:03 +0000361 }
362}