LLVM  3.7.0
MCStreamer.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCStreamer.cpp - Streaming Machine Code Output --------------===//
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 #include "llvm/MC/MCStreamer.h"
11 #include "llvm/ADT/SmallString.h"
12 #include "llvm/ADT/Twine.h"
13 #include "llvm/MC/MCAsmBackend.h"
14 #include "llvm/MC/MCAsmInfo.h"
15 #include "llvm/MC/MCContext.h"
16 #include "llvm/MC/MCExpr.h"
17 #include "llvm/MC/MCInst.h"
18 #include "llvm/MC/MCInstPrinter.h"
20 #include "llvm/MC/MCObjectWriter.h"
21 #include "llvm/MC/MCSection.h"
22 #include "llvm/MC/MCSymbol.h"
23 #include "llvm/MC/MCWin64EH.h"
25 #include "llvm/Support/LEB128.h"
27 #include <cstdlib>
28 using namespace llvm;
29 
30 // Pin the vtables to this file.
32 
34  S.setTargetStreamer(this);
35 }
36 
38 
40 
42 
43 MCStreamer::MCStreamer(MCContext &Ctx)
44  : Context(Ctx), CurrentWinFrameInfo(nullptr) {
45  SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
46 }
47 
49  for (unsigned i = 0; i < getNumWinFrameInfos(); ++i)
50  delete WinFrameInfos[i];
51 }
52 
54  DwarfFrameInfos.clear();
55  for (unsigned i = 0; i < getNumWinFrameInfos(); ++i)
56  delete WinFrameInfos[i];
57  WinFrameInfos.clear();
58  CurrentWinFrameInfo = nullptr;
59  SymbolOrdering.clear();
60  SectionStack.clear();
61  SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
62 }
63 
65  // By default, discard comments.
66  return nulls();
67 }
68 
69 void MCStreamer::emitRawComment(const Twine &T, bool TabPrefix) {}
70 
72  for (auto &FI : DwarfFrameInfos)
73  FI.CompactUnwindEncoding =
74  (MAB ? MAB->generateCompactUnwindEncoding(FI.Instructions) : 0);
75 }
76 
77 /// EmitIntValue - Special case of EmitValue that avoids the client having to
78 /// pass in a MCExpr for constant integers.
79 void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size) {
80  assert(1 <= Size && Size <= 8 && "Invalid size");
81  assert((isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) &&
82  "Invalid size");
83  char buf[8];
84  const bool isLittleEndian = Context.getAsmInfo()->isLittleEndian();
85  for (unsigned i = 0; i != Size; ++i) {
86  unsigned index = isLittleEndian ? i : (Size - i - 1);
87  buf[i] = uint8_t(Value >> (index * 8));
88  }
89  EmitBytes(StringRef(buf, Size));
90 }
91 
92 /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
93 /// client having to pass in a MCExpr for constant integers.
94 void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned Padding) {
95  SmallString<128> Tmp;
96  raw_svector_ostream OSE(Tmp);
97  encodeULEB128(Value, OSE, Padding);
98  EmitBytes(OSE.str());
99 }
100 
101 /// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
102 /// client having to pass in a MCExpr for constant integers.
104  SmallString<128> Tmp;
105  raw_svector_ostream OSE(Tmp);
106  encodeSLEB128(Value, OSE);
107  EmitBytes(OSE.str());
108 }
109 
110 void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size,
111  const SMLoc &Loc) {
112  EmitValueImpl(Value, Size, Loc);
113 }
114 
115 void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
116  bool IsSectionRelative) {
117  assert((!IsSectionRelative || Size == 4) &&
118  "SectionRelative value requires 4-bytes");
119 
120  if (!IsSectionRelative)
122  else
123  EmitCOFFSecRel32(Sym);
124 }
125 
127  report_fatal_error("unsupported directive in streamer");
128 }
129 
131  report_fatal_error("unsupported directive in streamer");
132 }
133 
134 /// EmitFill - Emit NumBytes bytes worth of the value specified by
135 /// FillValue. This implements directives such as '.space'.
136 void MCStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue) {
137  const MCExpr *E = MCConstantExpr::create(FillValue, getContext());
138  for (uint64_t i = 0, e = NumBytes; i != e; ++i)
139  EmitValue(E, 1);
140 }
141 
142 /// The implementation in this class just redirects to EmitFill.
143 void MCStreamer::EmitZeros(uint64_t NumBytes) {
144  EmitFill(NumBytes, 0);
145 }
146 
147 unsigned MCStreamer::EmitDwarfFileDirective(unsigned FileNo,
148  StringRef Directory,
149  StringRef Filename, unsigned CUID) {
150  return getContext().getDwarfFile(Directory, Filename, FileNo, CUID);
151 }
152 
153 void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
154  unsigned Column, unsigned Flags,
155  unsigned Isa,
156  unsigned Discriminator,
157  StringRef FileName) {
158  getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa,
159  Discriminator);
160 }
161 
164  if (!Table.getLabel()) {
166  Table.setLabel(
167  Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
168  }
169  return Table.getLabel();
170 }
171 
172 MCDwarfFrameInfo *MCStreamer::getCurrentDwarfFrameInfo() {
173  if (DwarfFrameInfos.empty())
174  return nullptr;
175  return &DwarfFrameInfos.back();
176 }
177 
178 void MCStreamer::EnsureValidDwarfFrame() {
179  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
180  if (!CurFrame || CurFrame->End)
181  report_fatal_error("No open frame");
182 }
183 
185  MCSymbol *EHSymbol) {
186 }
187 
188 void MCStreamer::InitSections(bool NoExecStack) {
189  SwitchSection(getContext().getObjectFileInfo()->getTextSection());
190 }
191 
193  if (Section)
194  Symbol->setSection(*Section);
195  else
196  Symbol->setUndefined();
197 
198  // As we emit symbols into a section, track the order so that they can
199  // be sorted upon later. Zero is reserved to mean 'unemitted'.
200  SymbolOrdering[Symbol] = 1 + SymbolOrdering.size();
201 }
202 
204  assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
205  assert(getCurrentSection().first && "Cannot emit before setting section!");
206  AssignSection(Symbol, getCurrentSection().first);
207 
209  if (TS)
210  TS->emitLabel(Symbol);
211 }
212 
213 void MCStreamer::EmitCFISections(bool EH, bool Debug) {
214  assert(EH || Debug);
215 }
216 
217 void MCStreamer::EmitCFIStartProc(bool IsSimple) {
218  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
219  if (CurFrame && !CurFrame->End)
220  report_fatal_error("Starting a frame before finishing the previous one!");
221 
222  MCDwarfFrameInfo Frame;
223  Frame.IsSimple = IsSimple;
224  EmitCFIStartProcImpl(Frame);
225 
226  const MCAsmInfo* MAI = Context.getAsmInfo();
227  if (MAI) {
228  for (const MCCFIInstruction& Inst : MAI->getInitialFrameState()) {
229  if (Inst.getOperation() == MCCFIInstruction::OpDefCfa ||
230  Inst.getOperation() == MCCFIInstruction::OpDefCfaRegister) {
231  Frame.CurrentCfaRegister = Inst.getRegister();
232  }
233  }
234  }
235 
236  DwarfFrameInfos.push_back(Frame);
237 }
238 
240 }
241 
243  EnsureValidDwarfFrame();
244  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
245  EmitCFIEndProcImpl(*CurFrame);
246 }
247 
249  // Put a dummy non-null value in Frame.End to mark that this frame has been
250  // closed.
251  Frame.End = (MCSymbol *) 1;
252 }
253 
254 MCSymbol *MCStreamer::EmitCFICommon() {
255  EnsureValidDwarfFrame();
257  EmitLabel(Label);
258  return Label;
259 }
260 
261 void MCStreamer::EmitCFIDefCfa(int64_t Register, int64_t Offset) {
262  MCSymbol *Label = EmitCFICommon();
264  MCCFIInstruction::createDefCfa(Label, Register, Offset);
265  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
266  CurFrame->Instructions.push_back(Instruction);
267  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
268 }
269 
270 void MCStreamer::EmitCFIDefCfaOffset(int64_t Offset) {
271  MCSymbol *Label = EmitCFICommon();
274  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
275  CurFrame->Instructions.push_back(Instruction);
276 }
277 
278 void MCStreamer::EmitCFIAdjustCfaOffset(int64_t Adjustment) {
279  MCSymbol *Label = EmitCFICommon();
281  MCCFIInstruction::createAdjustCfaOffset(Label, Adjustment);
282  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
283  CurFrame->Instructions.push_back(Instruction);
284 }
285 
287  MCSymbol *Label = EmitCFICommon();
290  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
291  CurFrame->Instructions.push_back(Instruction);
292  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
293 }
294 
295 void MCStreamer::EmitCFIOffset(int64_t Register, int64_t Offset) {
296  MCSymbol *Label = EmitCFICommon();
298  MCCFIInstruction::createOffset(Label, Register, Offset);
299  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
300  CurFrame->Instructions.push_back(Instruction);
301 }
302 
303 void MCStreamer::EmitCFIRelOffset(int64_t Register, int64_t Offset) {
304  MCSymbol *Label = EmitCFICommon();
306  MCCFIInstruction::createRelOffset(Label, Register, Offset);
307  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
308  CurFrame->Instructions.push_back(Instruction);
309 }
310 
312  unsigned Encoding) {
313  EnsureValidDwarfFrame();
314  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
315  CurFrame->Personality = Sym;
316  CurFrame->PersonalityEncoding = Encoding;
317 }
318 
319 void MCStreamer::EmitCFILsda(const MCSymbol *Sym, unsigned Encoding) {
320  EnsureValidDwarfFrame();
321  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
322  CurFrame->Lsda = Sym;
323  CurFrame->LsdaEncoding = Encoding;
324 }
325 
327  MCSymbol *Label = EmitCFICommon();
329  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
330  CurFrame->Instructions.push_back(Instruction);
331 }
332 
334  // FIXME: Error if there is no matching cfi_remember_state.
335  MCSymbol *Label = EmitCFICommon();
337  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
338  CurFrame->Instructions.push_back(Instruction);
339 }
340 
342  MCSymbol *Label = EmitCFICommon();
344  MCCFIInstruction::createSameValue(Label, Register);
345  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
346  CurFrame->Instructions.push_back(Instruction);
347 }
348 
350  MCSymbol *Label = EmitCFICommon();
352  MCCFIInstruction::createRestore(Label, Register);
353  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
354  CurFrame->Instructions.push_back(Instruction);
355 }
356 
358  MCSymbol *Label = EmitCFICommon();
360  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
361  CurFrame->Instructions.push_back(Instruction);
362 }
363 
365  EnsureValidDwarfFrame();
366  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
367  CurFrame->IsSignalFrame = true;
368 }
369 
371  MCSymbol *Label = EmitCFICommon();
373  MCCFIInstruction::createUndefined(Label, Register);
374  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
375  CurFrame->Instructions.push_back(Instruction);
376 }
377 
378 void MCStreamer::EmitCFIRegister(int64_t Register1, int64_t Register2) {
379  MCSymbol *Label = EmitCFICommon();
381  MCCFIInstruction::createRegister(Label, Register1, Register2);
382  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
383  CurFrame->Instructions.push_back(Instruction);
384 }
385 
387  MCSymbol *Label = EmitCFICommon();
390  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
391  CurFrame->Instructions.push_back(Instruction);
392 }
393 
394 void MCStreamer::EnsureValidWinFrameInfo() {
395  const MCAsmInfo *MAI = Context.getAsmInfo();
396  if (!MAI->usesWindowsCFI())
397  report_fatal_error(".seh_* directives are not supported on this target");
398  if (!CurrentWinFrameInfo || CurrentWinFrameInfo->End)
399  report_fatal_error("No open Win64 EH frame function!");
400 }
401 
403  const MCAsmInfo *MAI = Context.getAsmInfo();
404  if (!MAI->usesWindowsCFI())
405  report_fatal_error(".seh_* directives are not supported on this target");
406  if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
407  report_fatal_error("Starting a function before ending the previous one!");
408 
409  MCSymbol *StartProc = getContext().createTempSymbol();
410  EmitLabel(StartProc);
411 
412  WinFrameInfos.push_back(new WinEH::FrameInfo(Symbol, StartProc));
413  CurrentWinFrameInfo = WinFrameInfos.back();
414 }
415 
417  EnsureValidWinFrameInfo();
418  if (CurrentWinFrameInfo->ChainedParent)
419  report_fatal_error("Not all chained regions terminated!");
420 
421  MCSymbol *Label = getContext().createTempSymbol();
422  EmitLabel(Label);
423  CurrentWinFrameInfo->End = Label;
424 }
425 
427  EnsureValidWinFrameInfo();
428 
429  MCSymbol *StartProc = getContext().createTempSymbol();
430  EmitLabel(StartProc);
431 
432  WinFrameInfos.push_back(new WinEH::FrameInfo(CurrentWinFrameInfo->Function,
433  StartProc, CurrentWinFrameInfo));
434  CurrentWinFrameInfo = WinFrameInfos.back();
435 }
436 
438  EnsureValidWinFrameInfo();
439  if (!CurrentWinFrameInfo->ChainedParent)
440  report_fatal_error("End of a chained region outside a chained region!");
441 
442  MCSymbol *Label = getContext().createTempSymbol();
443  EmitLabel(Label);
444 
445  CurrentWinFrameInfo->End = Label;
446  CurrentWinFrameInfo =
447  const_cast<WinEH::FrameInfo *>(CurrentWinFrameInfo->ChainedParent);
448 }
449 
450 void MCStreamer::EmitWinEHHandler(const MCSymbol *Sym, bool Unwind,
451  bool Except) {
452  EnsureValidWinFrameInfo();
453  if (CurrentWinFrameInfo->ChainedParent)
454  report_fatal_error("Chained unwind areas can't have handlers!");
455  CurrentWinFrameInfo->ExceptionHandler = Sym;
456  if (!Except && !Unwind)
457  report_fatal_error("Don't know what kind of handler this is!");
458  if (Unwind)
459  CurrentWinFrameInfo->HandlesUnwind = true;
460  if (Except)
461  CurrentWinFrameInfo->HandlesExceptions = true;
462 }
463 
465  EnsureValidWinFrameInfo();
466  if (CurrentWinFrameInfo->ChainedParent)
467  report_fatal_error("Chained unwind areas can't have handlers!");
468 }
469 
471  EnsureValidWinFrameInfo();
472 
473  MCSymbol *Label = getContext().createTempSymbol();
474  EmitLabel(Label);
475 
477  CurrentWinFrameInfo->Instructions.push_back(Inst);
478 }
479 
480 void MCStreamer::EmitWinCFISetFrame(unsigned Register, unsigned Offset) {
481  EnsureValidWinFrameInfo();
482  if (CurrentWinFrameInfo->LastFrameInst >= 0)
483  report_fatal_error("Frame register and offset already specified!");
484  if (Offset & 0x0F)
485  report_fatal_error("Misaligned frame pointer offset!");
486  if (Offset > 240)
487  report_fatal_error("Frame offset must be less than or equal to 240!");
488 
489  MCSymbol *Label = getContext().createTempSymbol();
490  EmitLabel(Label);
491 
492  WinEH::Instruction Inst =
493  Win64EH::Instruction::SetFPReg(Label, Register, Offset);
494  CurrentWinFrameInfo->LastFrameInst = CurrentWinFrameInfo->Instructions.size();
495  CurrentWinFrameInfo->Instructions.push_back(Inst);
496 }
497 
498 void MCStreamer::EmitWinCFIAllocStack(unsigned Size) {
499  EnsureValidWinFrameInfo();
500  if (Size == 0)
501  report_fatal_error("Allocation size must be non-zero!");
502  if (Size & 7)
503  report_fatal_error("Misaligned stack allocation!");
504 
505  MCSymbol *Label = getContext().createTempSymbol();
506  EmitLabel(Label);
507 
509  CurrentWinFrameInfo->Instructions.push_back(Inst);
510 }
511 
512 void MCStreamer::EmitWinCFISaveReg(unsigned Register, unsigned Offset) {
513  EnsureValidWinFrameInfo();
514  if (Offset & 7)
515  report_fatal_error("Misaligned saved register offset!");
516 
517  MCSymbol *Label = getContext().createTempSymbol();
518  EmitLabel(Label);
519 
520  WinEH::Instruction Inst =
521  Win64EH::Instruction::SaveNonVol(Label, Register, Offset);
522  CurrentWinFrameInfo->Instructions.push_back(Inst);
523 }
524 
525 void MCStreamer::EmitWinCFISaveXMM(unsigned Register, unsigned Offset) {
526  EnsureValidWinFrameInfo();
527  if (Offset & 0x0F)
528  report_fatal_error("Misaligned saved vector register offset!");
529 
530  MCSymbol *Label = getContext().createTempSymbol();
531  EmitLabel(Label);
532 
533  WinEH::Instruction Inst =
534  Win64EH::Instruction::SaveXMM(Label, Register, Offset);
535  CurrentWinFrameInfo->Instructions.push_back(Inst);
536 }
537 
539  EnsureValidWinFrameInfo();
540  if (CurrentWinFrameInfo->Instructions.size() > 0)
541  report_fatal_error("If present, PushMachFrame must be the first UOP");
542 
543  MCSymbol *Label = getContext().createTempSymbol();
544  EmitLabel(Label);
545 
547  CurrentWinFrameInfo->Instructions.push_back(Inst);
548 }
549 
551  EnsureValidWinFrameInfo();
552 
553  MCSymbol *Label = getContext().createTempSymbol();
554  EmitLabel(Label);
555 
556  CurrentWinFrameInfo->PrologEnd = Label;
557 }
558 
560 }
561 
563 }
564 
566 }
567 
568 /// EmitRawText - If this file is backed by an assembly streamer, this dumps
569 /// the specified string in the output .s file. This capability is
570 /// indicated by the hasRawTextSupport() predicate.
572  errs() << "EmitRawText called on an MCStreamer that doesn't support it, "
573  " something must not be fully mc'ized\n";
574  abort();
575 }
576 
578  SmallString<128> Str;
580 }
581 
583 }
584 
586  if (!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End)
587  report_fatal_error("Unfinished frame!");
588 
590  if (TS)
591  TS->finish();
592 
593  FinishImpl();
594 }
595 
597  visitUsedExpr(*Value);
598  Symbol->setVariableValue(Value);
599 
601  if (TS)
602  TS->emitAssignment(Symbol, Value);
603 }
604 
606  const MCInst &Inst, const MCSubtargetInfo &STI) {
607  InstPrinter.printInst(&Inst, OS, "", STI);
608 }
609 
611 }
612 
614  switch (Expr.getKind()) {
615  case MCExpr::Target:
616  cast<MCTargetExpr>(Expr).visitUsedExpr(*this);
617  break;
618 
619  case MCExpr::Constant:
620  break;
621 
622  case MCExpr::Binary: {
623  const MCBinaryExpr &BE = cast<MCBinaryExpr>(Expr);
624  visitUsedExpr(*BE.getLHS());
625  visitUsedExpr(*BE.getRHS());
626  break;
627  }
628 
629  case MCExpr::SymbolRef:
630  visitUsedSymbol(cast<MCSymbolRefExpr>(Expr).getSymbol());
631  break;
632 
633  case MCExpr::Unary:
634  visitUsedExpr(*cast<MCUnaryExpr>(Expr).getSubExpr());
635  break;
636  }
637 }
638 
640  const MCSubtargetInfo &STI) {
641  // Scan for values.
642  for (unsigned i = Inst.getNumOperands(); i--;)
643  if (Inst.getOperand(i).isExpr())
644  visitUsedExpr(*Inst.getOperand(i).getExpr());
645 }
646 
648  unsigned Size) {
649  // Get the Hi-Lo expression.
650  const MCExpr *Diff =
652  MCSymbolRefExpr::create(Lo, Context), Context);
653 
654  const MCAsmInfo *MAI = Context.getAsmInfo();
655  if (!MAI->doesSetDirectiveSuppressesReloc()) {
656  EmitValue(Diff, Size);
657  return;
658  }
659 
660  // Otherwise, emit with .set (aka assignment).
661  MCSymbol *SetLabel = Context.createTempSymbol("set", true);
662  EmitAssignment(SetLabel, Diff);
663  EmitSymbolValue(SetLabel, Size);
664 }
665 
668 void MCStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
676  unsigned ByteAlignment) {}
678  uint64_t Size, unsigned ByteAlignment) {}
682 void MCStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
683  const SMLoc &Loc) {
684  visitUsedExpr(*Value);
685 }
689  unsigned ValueSize,
690  unsigned MaxBytesToEmit) {}
692  unsigned MaxBytesToEmit) {}
693 bool MCStreamer::EmitValueToOffset(const MCExpr *Offset, unsigned char Value) {
694  return false;
695 }
696 void MCStreamer::EmitBundleAlignMode(unsigned AlignPow2) {}
697 void MCStreamer::EmitBundleLock(bool AlignToEnd) {}
700 
702  assert(Section && "Cannot switch to a null section!");
703  MCSectionSubPair curSection = SectionStack.back().first;
704  SectionStack.back().second = curSection;
705  if (MCSectionSubPair(Section, Subsection) != curSection) {
706  ChangeSection(Section, Subsection);
707  SectionStack.back().first = MCSectionSubPair(Section, Subsection);
708  assert(!Section->hasEnded() && "Section already ended");
709  MCSymbol *Sym = Section->getBeginSymbol();
710  if (Sym && !Sym->isInSection())
711  EmitLabel(Sym);
712  }
713 }
714 
716  // TODO: keep track of the last subsection so that this symbol appears in the
717  // correct place.
718  MCSymbol *Sym = Section->getEndSymbol(Context);
719  if (Sym->isInSection())
720  return Sym;
721 
722  SwitchSection(Section);
723  EmitLabel(Sym);
724  return Sym;
725 }
virtual void EmitBundleUnlock()
Ends a bundle-locked group.
Definition: MCStreamer.cpp:699
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag)
Note in the output the specified Flag.
Definition: MCStreamer.cpp:666
virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName)
This implements the DWARF2 '.loc fileno lineno ...' assembler directive.
Definition: MCStreamer.cpp:153
void AssignSection(MCSymbol *Symbol, MCSection *Section)
Sets the symbol's section.
Definition: MCStreamer.cpp:192
virtual void EmitBundleAlignMode(unsigned AlignPow2)
Set the bundle alignment mode from now on in the section.
Definition: MCStreamer.cpp:696
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
void push_back(const T &Elt)
Definition: SmallVector.h:222
virtual void EmitCFISameValue(int64_t Register)
Definition: MCStreamer.cpp:341
const MCAsmInfo * getAsmInfo() const
Definition: MCContext.h:225
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:311
virtual void EmitSLEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:687
void EmitRawText(const Twine &String)
If this file is backed by a assembly streamer, this dumps the specified string in the output ...
Definition: MCStreamer.cpp:577
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:315
virtual void EmitWinCFIEndProlog()
Definition: MCStreamer.cpp:550
void EmitSLEB128IntValue(int64_t Value)
Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Definition: MCStreamer.cpp:103
void EmitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative=false)
Special case of EmitValue that avoids the client having to pass in a MCExpr for MCSymbols.
Definition: MCStreamer.cpp:115
virtual void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot, const MCSubtargetInfo &STI)=0
Print the specified MCInst to the specified raw_ostream.
virtual void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0)
Emit a thread local bss (.tbss) symbol.
Definition: MCStreamer.cpp:677
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
bool hasEnded() const
Definition: MCSection.cpp:32
virtual void EndCOFFSymbolDef()
Marks the end of the symbol definition.
Definition: MCStreamer.cpp:670
virtual ~MCTargetStreamer()
Definition: MCStreamer.cpp:31
const MCSymbol * End
Definition: MCWinEH.h:35
virtual void EmitULEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:686
static MCCFIInstruction createRememberState(MCSymbol *L)
.cfi_remember_state Save all current rules for all registers.
Definition: MCDwarf.h:426
virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol)
Emit an weak reference from Alias to Symbol.
Definition: MCStreamer.cpp:680
static WinEH::Instruction SaveNonVol(MCSymbol *L, unsigned Reg, unsigned Offset)
Definition: MCWin64EH.h:38
virtual void EmitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:681
static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register, int Offset)
.cfi_offset Previous value of Register is saved at offset Offset from CFA.
Definition: MCDwarf.h:381
MCSymbol * getLabel() const
Definition: MCDwarf.h:226
Target specific streamer interface.
Definition: MCStreamer.h:73
const char * getPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:450
ExprKind getKind() const
Definition: MCExpr.h:69
virtual void reset()
State management.
Definition: MCStreamer.cpp:53
unsigned CurrentCfaRegister
Definition: MCDwarf.h:481
virtual void EmitWindowsUnwindTables()
Definition: MCStreamer.cpp:582
void EmitCFIStartProc(bool IsSimple)
Definition: MCStreamer.cpp:217
virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol)
Start emitting COFF symbol definition.
Definition: MCStreamer.cpp:669
virtual unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory, StringRef Filename, unsigned CUID=0)
Associate a filename with a specified logical file number.
Definition: MCStreamer.cpp:147
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:488
virtual void EmitCFIRegister(int64_t Register1, int64_t Register2)
Definition: MCStreamer.cpp:378
virtual void EmitValueImpl(const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
Definition: MCStreamer.cpp:682
virtual void EmitCFIDefCfaOffset(int64_t Offset)
Definition: MCStreamer.cpp:270
virtual MCSymbol * getDwarfLineTableSymbol(unsigned CUID)
Definition: MCStreamer.cpp:162
static MCCFIInstruction createDefCfaOffset(MCSymbol *L, int Offset)
.cfi_def_cfa_offset modifies a rule for computing CFA.
Definition: MCDwarf.h:368
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:294
virtual void EmitCOFFSymbolStorageClass(int StorageClass)
Emit the storage class of the symbol.
Definition: MCStreamer.cpp:672
std::vector< Instruction > Instructions
Definition: MCWinEH.h:46
unsigned LsdaEncoding
Definition: MCDwarf.h:483
static MCCFIInstruction createAdjustCfaOffset(MCSymbol *L, int Adjustment)
.cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but Offset is a relative value that is added/subt...
Definition: MCDwarf.h:375
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Definition: MCStreamer.cpp:639
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
virtual void emitELFSize(MCSymbolELF *Symbol, const MCExpr *Value)
Emit an ELF .size directive.
Definition: MCStreamer.cpp:674
virtual void EmitCFISections(bool EH, bool Debug)
Definition: MCStreamer.cpp:213
virtual void EmitGPRel32Value(const MCExpr *Value)
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.
Definition: MCStreamer.cpp:130
std::vector< MCCFIInstruction > Instructions
Definition: MCDwarf.h:480
static MCCFIInstruction createUndefined(MCSymbol *L, unsigned Register)
.cfi_undefined From now on the previous value of Register can't be restored anymore.
Definition: MCDwarf.h:415
virtual void EmitWinEHHandlerData()
Definition: MCStreamer.cpp:464
virtual void EmitCFIRememberState()
Definition: MCStreamer.cpp:326
virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:319
virtual void EmitGPRel64Value(const MCExpr *Value)
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.
Definition: MCStreamer.cpp:126
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79
virtual void EmitCFIEscape(StringRef Values)
Definition: MCStreamer.cpp:357
MCSectionSubPair getCurrentSection() const
Return the current section that the streamer is emitting code to.
Definition: MCStreamer.h:274
virtual void EmitCOFFSymbolType(int Type)
Emit the type of the symbol.
Definition: MCStreamer.cpp:673
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:33
const std::vector< MCCFIInstruction > & getInitialFrameState() const
Definition: MCAsmInfo.h:538
const MCSymbol * Lsda
Definition: MCDwarf.h:479
bool doesSetDirectiveSuppressesReloc() const
Definition: MCAsmInfo.h:477
virtual void emitLabel(MCSymbol *Symbol)
Definition: MCStreamer.cpp:37
virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame)
Definition: MCStreamer.cpp:239
unsigned getNumWinFrameInfos()
Definition: MCStreamer.h:221
virtual ~MCStreamer()
Definition: MCStreamer.cpp:48
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
Definition: MCContext.h:413
MCContext & getContext() const
Definition: MCStreamer.h:210
MCSymbol * getEndSymbol(MCContext &Ctx)
Definition: MCSection.cpp:26
bool isLittleEndian() const
True if the target is little endian.
Definition: MCAsmInfo.h:376
void setSection(MCSection &S)
Mark the symbol as defined in the section S.
Definition: MCSymbol.h:270
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Definition: MCStreamer.cpp:596
Context object for machine code objects.
Definition: MCContext.h:48
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute)...
Definition: MCSymbol.h:255
static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg)
Definition: MCWin64EH.h:28
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:514
virtual void finish()
Definition: MCStreamer.cpp:39
virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame)
Definition: MCStreamer.cpp:248
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:44
virtual bool EmitValueToOffset(const MCExpr *Offset, unsigned char Value=0)
Emit some number of copies of Value until the byte offset Offset is reached.
Definition: MCStreamer.cpp:693
virtual void emitRawComment(const Twine &T, bool TabPrefix=true)
Print T and prefix it with the comment string (normally #) and optionally a tab.
Definition: MCStreamer.cpp:69
virtual void EmitCFIRestoreState()
Definition: MCStreamer.cpp:333
virtual void EmitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers...
Definition: MCStreamer.cpp:79
Unary expressions.
Definition: MCExpr.h:39
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
virtual void EmitCFIRestore(int64_t Register)
Definition: MCStreamer.cpp:349
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:97
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:58
virtual void EmitBundleLock(bool AlignToEnd)
The following instructions are a bundle-locked group.
Definition: MCStreamer.cpp:697
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)
Emit a local common (.lcomm) symbol.
Definition: MCStreamer.cpp:675
const MCExpr * getExpr() const
Definition: MCInst.h:93
static MCCFIInstruction createSameValue(MCSymbol *L, unsigned Register)
.cfi_same_value Current value of Register is the same as in the previous frame.
Definition: MCDwarf.h:421
virtual raw_ostream & GetCommentOS()
Return a raw_ostream that comments can be written to.
Definition: MCStreamer.cpp:64
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
Definition: MCExpr.h:531
virtual void EmitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
Definition: MCStreamer.cpp:143
Streaming machine code generation interface.
Definition: MCStreamer.h:157
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
Definition: MCContext.cpp:222
const FrameInfo * ChainedParent
Definition: MCWinEH.h:45
MCTargetStreamer * getTargetStreamer()
Definition: MCStreamer.h:212
static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it...
Definition: MCDwarf.h:354
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register)
.cfi_def_cfa_register modifies a rule for computing CFA.
Definition: MCDwarf.h:361
virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue)
Emit NumBytes bytes worth of the value specified by FillValue.
Definition: MCStreamer.cpp:136
virtual void EmitWinCFIPushReg(unsigned Register)
Definition: MCStreamer.cpp:470
static MCCFIInstruction createWindowSave(MCSymbol *L)
.cfi_window_save SPARC register window is saved.
Definition: MCDwarf.h:402
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
Definition: MCStreamer.cpp:701
static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code)
Definition: MCWin64EH.h:35
virtual void EmitCFIDefCfaRegister(int64_t Register)
Definition: MCStreamer.cpp:286
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Definition: MCStreamer.cpp:688
bool isExpr() const
Definition: MCInst.h:59
virtual void EmitCOFFSecRel32(MCSymbol const *Symbol)
Emits a COFF section relative relocation.
Definition: MCStreamer.cpp:565
static MCCFIInstruction createRelOffset(MCSymbol *L, unsigned Register, int Offset)
.cfi_rel_offset Previous value of Register is saved at offset Offset from the current CFA register...
Definition: MCDwarf.h:389
static MCCFIInstruction createRestore(MCSymbol *L, unsigned Register)
.cfi_restore says that the rule for Register is now the same as it was at the beginning of the functi...
Definition: MCDwarf.h:409
virtual void EmitRawTextImpl(StringRef String)
EmitRawText - If this file is backed by an assembly streamer, this dumps the specified string in the ...
Definition: MCStreamer.cpp:571
virtual void EmitWinCFIEndChained()
Definition: MCStreamer.cpp:437
virtual void EmitWinCFIEndProc()
Definition: MCStreamer.cpp:416
virtual void EmitCFIUndefined(int64_t Register)
Definition: MCStreamer.cpp:370
unsigned PersonalityEncoding
Definition: MCDwarf.h:482
static WinEH::Instruction SetFPReg(MCSymbol *L, unsigned Reg, unsigned Off)
Definition: MCWin64EH.h:50
void Finish()
Finish emission of machine code.
Definition: MCStreamer.cpp:585
virtual void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol)
Definition: MCStreamer.cpp:184
bool isIntN(unsigned N, int64_t x)
isIntN - Checks if an signed integer fits into the given (dynamic) bit width.
Definition: MathExtras.h:321
static MCCFIInstruction createRestoreState(MCSymbol *L)
.cfi_restore_state Restore the previously saved state.
Definition: MCDwarf.h:431
virtual void EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except)
Definition: MCStreamer.cpp:450
Binary assembler expressions.
Definition: MCExpr.h:405
virtual void EmitCOFFSafeSEH(MCSymbol const *Symbol)
Definition: MCStreamer.cpp:559
void generateCompactUnwindEncodings(MCAsmBackend *MAB)
Definition: MCStreamer.cpp:71
static WinEH::Instruction SaveXMM(MCSymbol *L, unsigned Reg, unsigned Offset)
Definition: MCWin64EH.h:44
const MCSymbol * PrologEnd
Definition: MCWinEH.h:38
virtual void EmitWinCFIStartChained()
Definition: MCStreamer.cpp:426
virtual void InitSections(bool NoExecStack)
Create the default sections and set the initial one.
Definition: MCStreamer.cpp:188
virtual void EmitLabel(MCSymbol *Symbol)
Emit a label for Symbol into the current section.
Definition: MCStreamer.cpp:203
virtual void EmitWinCFISaveXMM(unsigned Register, unsigned Offset)
Definition: MCStreamer.cpp:525
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
Definition: MCStreamer.cpp:647
void setUndefined()
Mark the symbol as undefined.
Definition: MCSymbol.h:278
virtual void EmitCFIOffset(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:295
StringRef toStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single StringRef if it can be represented as such.
Definition: Twine.h:454
static WinEH::Instruction Alloc(MCSymbol *L, unsigned Size)
Definition: MCWin64EH.h:31
virtual void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0)
Emit nops until the byte alignment ByteAlignment is reached.
Definition: MCStreamer.cpp:691
Promote Memory to Register
Definition: Mem2Reg.cpp:58
MCSymbol * getBeginSymbol()
Definition: MCSection.h:113
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS, const MCInst &Inst, const MCSubtargetInfo &STI)
Definition: MCStreamer.cpp:605
virtual void EmitWinCFIAllocStack(unsigned Size)
Definition: MCStreamer.cpp:498
virtual void ChangeSection(MCSection *, const MCExpr *)
Update streamer for a new active section.
Definition: MCStreamer.cpp:679
void setVariableValue(const MCExpr *Value)
Definition: MCSymbol.cpp:40
void encodeSLEB128(int64_t Value, raw_ostream &OS)
Utility function to encode a SLEB128 value to an output stream.
Definition: LEB128.h:23
const MCSymbol * Function
Definition: MCWinEH.h:37
void visitUsedExpr(const MCExpr &Expr)
Definition: MCStreamer.cpp:613
MCTargetStreamer(MCStreamer &S)
Definition: MCStreamer.cpp:33
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
Definition: MCExpr.h:534
StringRef str()
Flushes the stream contents to the target vector and return a StringRef for the vector contents...
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:38
virtual void EmitThumbFunc(MCSymbol *Func)
Note in the output that the specified Func is a Thumb mode function (ARM target only).
Definition: MCStreamer.cpp:667
unsigned size() const
Definition: DenseMap.h:82
virtual void EmitCFISignalFrame()
Definition: MCStreamer.cpp:364
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition: MCContext.cpp:111
virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:303
const MCSymbol * Personality
Definition: MCDwarf.h:478
MCAssemblerFlag
Definition: MCDirectives.h:47
unsigned getNumOperands() const
Definition: MCInst.h:166
virtual void EmitFileDirective(StringRef Filename)
Switch to a new logical file.
Definition: MCStreamer.cpp:671
MCSubtargetInfo - Generic base class for all target subtargets.
virtual uint32_t generateCompactUnwindEncoding(ArrayRef< MCCFIInstruction >) const
Generate the compact unwind encoding for the CFI instructions.
Definition: MCAsmBackend.h:136
References to labels and assigned expressions.
Definition: MCExpr.h:38
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:261
void EmitValue(const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc())
Definition: MCStreamer.cpp:110
void EmitULEB128IntValue(uint64_t Value, unsigned Padding=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Definition: MCStreamer.cpp:94
MCSymbol * endSection(MCSection *Section)
Definition: MCStreamer.cpp:715
bool isVariable() const
isVariable - Check if this is a variable symbol.
Definition: MCSymbol.h:294
void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator)
Saves the information from the currently parsed dwarf .loc directive and sets DwarfLocSeen.
Definition: MCContext.h:448
virtual void FinishImpl()
Streamer specific finalization.
Definition: MCStreamer.cpp:698
LLVM Value Representation.
Definition: Value.h:69
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:34
unsigned getDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, unsigned CUID)
Creates an entry in the dwarf file and directory tables.
Definition: MCContext.cpp:451
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
Constant expressions.
Definition: MCExpr.h:37
Binary expressions.
Definition: MCExpr.h:36
virtual void EmitWinCFIStartProc(const MCSymbol *Symbol)
Definition: MCStreamer.cpp:402
raw_ostream & nulls()
This returns a reference to a raw_ostream which simply discards output.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
static TraceState * TS
void encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned Padding=0)
Utility function to encode a ULEB128 value to an output stream.
Definition: LEB128.h:38
virtual void EmitWinCFISaveReg(unsigned Register, unsigned Offset)
Definition: MCStreamer.cpp:512
virtual void EmitWinCFIPushFrame(bool Code)
Definition: MCStreamer.cpp:538
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
Target specific expression.
Definition: MCExpr.h:40
virtual void visitUsedSymbol(const MCSymbol &Sym)
Definition: MCStreamer.cpp:610
Represents a location in source code.
Definition: SMLoc.h:23
static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals)
.cfi_escape Allows the user to add arbitrary bytes to the unwind info.
Definition: MCDwarf.h:437
bool isUIntN(unsigned N, uint64_t x)
isUIntN - Checks if an unsigned integer fits into the given (dynamic) bit width.
Definition: MathExtras.h:315
const MCSymbol * ExceptionHandler
Definition: MCWinEH.h:36
void setTargetStreamer(MCTargetStreamer *TS)
Definition: MCStreamer.h:202
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Definition: MCStreamer.cpp:41
virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol)
Emits a COFF section index.
Definition: MCStreamer.cpp:562
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
Definition: MCExpr.cpp:150
virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment)
Definition: MCStreamer.cpp:278
void setLabel(MCSymbol *Label)
Definition: MCDwarf.h:230
const MCOperand & getOperand(unsigned i) const
Definition: MCInst.h:164
static MCCFIInstruction createRegister(MCSymbol *L, unsigned Register1, unsigned Register2)
.cfi_register Previous value of Register1 is saved in register Register2.
Definition: MCDwarf.h:396
virtual void EmitWinCFISetFrame(unsigned Register, unsigned Offset)
Definition: MCStreamer.cpp:480
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue)
Set the DescValue for the Symbol.
Definition: MCStreamer.cpp:668
virtual void EmitCFIWindowSave()
Definition: MCStreamer.cpp:386
bool usesWindowsCFI() const
Definition: MCAsmInfo.h:521