LLVM  14.0.0git
MCStreamer.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCStreamer.cpp - Streaming Machine Code Output --------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "llvm/MC/MCStreamer.h"
10 #include "llvm/ADT/Optional.h"
11 #include "llvm/ADT/SmallString.h"
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/ADT/Twine.h"
14 #include "llvm/BinaryFormat/COFF.h"
16 #include "llvm/MC/MCAsmBackend.h"
17 #include "llvm/MC/MCAsmInfo.h"
18 #include "llvm/MC/MCCodeView.h"
19 #include "llvm/MC/MCContext.h"
20 #include "llvm/MC/MCDwarf.h"
21 #include "llvm/MC/MCExpr.h"
22 #include "llvm/MC/MCInst.h"
23 #include "llvm/MC/MCInstPrinter.h"
25 #include "llvm/MC/MCPseudoProbe.h"
26 #include "llvm/MC/MCRegister.h"
27 #include "llvm/MC/MCRegisterInfo.h"
28 #include "llvm/MC/MCSection.h"
29 #include "llvm/MC/MCSectionCOFF.h"
30 #include "llvm/MC/MCSymbol.h"
31 #include "llvm/MC/MCWin64EH.h"
32 #include "llvm/MC/MCWinEH.h"
33 #include "llvm/Support/Casting.h"
35 #include "llvm/Support/LEB128.h"
38 #include <cassert>
39 #include <cstdint>
40 #include <cstdlib>
41 #include <utility>
42 
43 using namespace llvm;
44 
46  S.setTargetStreamer(this);
47 }
48 
49 // Pin the vtables to this file.
51 
53 
55 
58  const MCExpr *Subsection,
59  raw_ostream &OS) {
60  Section->PrintSwitchToSection(*Streamer.getContext().getAsmInfo(),
62  Subsection);
63 }
64 
67 }
68 
70  SmallString<128> Str;
71  raw_svector_ostream OS(Str);
72 
74  Streamer.emitRawText(OS.str());
75 }
76 
78  const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
79  const char *Directive = MAI->getData8bitsDirective();
80  for (const unsigned char C : Data.bytes()) {
81  SmallString<128> Str;
82  raw_svector_ostream OS(Str);
83 
84  OS << Directive << (unsigned)C;
85  Streamer.emitRawText(OS.str());
86  }
87 }
88 
90 
92  : Context(Ctx), CurrentWinFrameInfo(nullptr),
93  CurrentProcWinFrameInfoStartIndex(0), UseAssemblerInfoForParsing(false) {
94  SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
95 }
96 
98 
100  DwarfFrameInfos.clear();
101  CurrentWinFrameInfo = nullptr;
102  WinFrameInfos.clear();
103  SymbolOrdering.clear();
104  SectionStack.clear();
105  SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
106 }
107 
109  // By default, discard comments.
110  return nulls();
111 }
112 
113 unsigned MCStreamer::getNumFrameInfos() { return DwarfFrameInfos.size(); }
115  return DwarfFrameInfos;
116 }
117 
118 void MCStreamer::emitRawComment(const Twine &T, bool TabPrefix) {}
119 
122 
124  for (auto &FI : DwarfFrameInfos)
125  FI.CompactUnwindEncoding =
126  (MAB ? MAB->generateCompactUnwindEncoding(FI.Instructions) : 0);
127 }
128 
129 /// EmitIntValue - Special case of EmitValue that avoids the client having to
130 /// pass in a MCExpr for constant integers.
131 void MCStreamer::emitIntValue(uint64_t Value, unsigned Size) {
132  assert(1 <= Size && Size <= 8 && "Invalid size");
133  assert((isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) &&
134  "Invalid size");
135  const bool IsLittleEndian = Context.getAsmInfo()->isLittleEndian();
136  uint64_t Swapped = support::endian::byte_swap(
137  Value, IsLittleEndian ? support::little : support::big);
138  unsigned Index = IsLittleEndian ? 0 : 8 - Size;
139  emitBytes(StringRef(reinterpret_cast<char *>(&Swapped) + Index, Size));
140 }
142  if (Value.getNumWords() == 1) {
143  emitIntValue(Value.getLimitedValue(), Value.getBitWidth() / 8);
144  return;
145  }
146 
147  const bool IsLittleEndianTarget = Context.getAsmInfo()->isLittleEndian();
148  const bool ShouldSwap = sys::IsLittleEndianHost != IsLittleEndianTarget;
149  const APInt Swapped = ShouldSwap ? Value.byteSwap() : Value;
150  const unsigned Size = Value.getBitWidth() / 8;
151  SmallString<10> Tmp;
152  Tmp.resize(Size);
153  StoreIntToMemory(Swapped, reinterpret_cast<uint8_t *>(Tmp.data()), Size);
154  emitBytes(Tmp.str());
155 }
156 
157 /// EmitULEB128IntValue - Special case of EmitULEB128Value that avoids the
158 /// client having to pass in a MCExpr for constant integers.
159 void MCStreamer::emitULEB128IntValue(uint64_t Value, unsigned PadTo) {
160  SmallString<128> Tmp;
161  raw_svector_ostream OSE(Tmp);
162  encodeULEB128(Value, OSE, PadTo);
163  emitBytes(OSE.str());
164 }
165 
166 /// EmitSLEB128IntValue - Special case of EmitSLEB128Value that avoids the
167 /// client having to pass in a MCExpr for constant integers.
169  SmallString<128> Tmp;
170  raw_svector_ostream OSE(Tmp);
171  encodeSLEB128(Value, OSE);
172  emitBytes(OSE.str());
173 }
174 
175 void MCStreamer::emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc) {
176  emitValueImpl(Value, Size, Loc);
177 }
178 
179 void MCStreamer::emitSymbolValue(const MCSymbol *Sym, unsigned Size,
180  bool IsSectionRelative) {
181  assert((!IsSectionRelative || Size == 4) &&
182  "SectionRelative value requires 4-bytes");
183 
184  if (!IsSectionRelative)
186  else
187  EmitCOFFSecRel32(Sym, /*Offset=*/0);
188 }
189 
191  report_fatal_error("unsupported directive in streamer");
192 }
193 
195  report_fatal_error("unsupported directive in streamer");
196 }
197 
199  report_fatal_error("unsupported directive in streamer");
200 }
201 
203  report_fatal_error("unsupported directive in streamer");
204 }
205 
207  report_fatal_error("unsupported directive in streamer");
208 }
209 
211  report_fatal_error("unsupported directive in streamer");
212 }
213 
214 /// Emit NumBytes bytes worth of the value specified by FillValue.
215 /// This implements directives such as '.space'.
216 void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) {
217  emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue);
218 }
219 
220 void llvm::MCStreamer::emitNops(int64_t NumBytes, int64_t ControlledNopLen,
221  llvm::SMLoc) {}
222 
223 /// The implementation in this class just redirects to emitFill.
224 void MCStreamer::emitZeros(uint64_t NumBytes) { emitFill(NumBytes, 0); }
225 
228  StringRef Filename,
229  Optional<MD5::MD5Result> Checksum,
231  unsigned CUID) {
232  return getContext().getDwarfFile(Directory, Filename, FileNo, Checksum,
233  Source, CUID);
234 }
235 
237  StringRef Filename,
238  Optional<MD5::MD5Result> Checksum,
240  unsigned CUID) {
241  getContext().setMCLineTableRootFile(CUID, Directory, Filename, Checksum,
242  Source);
243 }
244 
246  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
247  if (!CurFrame)
248  return;
249  CurFrame->IsBKeyFrame = true;
250 }
251 
252 void MCStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line,
253  unsigned Column, unsigned Flags,
254  unsigned Isa, unsigned Discriminator,
255  StringRef FileName) {
256  getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa,
257  Discriminator);
258 }
259 
262  if (!Table.getLabel()) {
264  Table.setLabel(
265  Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
266  }
267  return Table.getLabel();
268 }
269 
271  return !DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End;
272 }
273 
274 MCDwarfFrameInfo *MCStreamer::getCurrentDwarfFrameInfo() {
277  "this directive must appear between "
278  ".cfi_startproc and .cfi_endproc directives");
279  return nullptr;
280  }
281  return &DwarfFrameInfos.back();
282 }
283 
284 bool MCStreamer::EmitCVFileDirective(unsigned FileNo, StringRef Filename,
285  ArrayRef<uint8_t> Checksum,
286  unsigned ChecksumKind) {
287  return getContext().getCVContext().addFile(*this, FileNo, Filename, Checksum,
288  ChecksumKind);
289 }
290 
291 bool MCStreamer::EmitCVFuncIdDirective(unsigned FunctionId) {
292  return getContext().getCVContext().recordFunctionId(FunctionId);
293 }
294 
296  unsigned IAFunc, unsigned IAFile,
297  unsigned IALine, unsigned IACol,
298  SMLoc Loc) {
299  if (getContext().getCVContext().getCVFunctionInfo(IAFunc) == nullptr) {
300  getContext().reportError(Loc, "parent function id not introduced by "
301  ".cv_func_id or .cv_inline_site_id");
302  return true;
303  }
304 
306  FunctionId, IAFunc, IAFile, IALine, IACol);
307 }
308 
309 void MCStreamer::emitCVLocDirective(unsigned FunctionId, unsigned FileNo,
310  unsigned Line, unsigned Column,
311  bool PrologueEnd, bool IsStmt,
312  StringRef FileName, SMLoc Loc) {}
313 
314 bool MCStreamer::checkCVLocSection(unsigned FuncId, unsigned FileNo,
315  SMLoc Loc) {
318  if (!FI) {
320  Loc, "function id not introduced by .cv_func_id or .cv_inline_site_id");
321  return false;
322  }
323 
324  // Track the section
325  if (FI->Section == nullptr)
327  else if (FI->Section != getCurrentSectionOnly()) {
329  Loc,
330  "all .cv_loc directives for a function must be in the same section");
331  return false;
332  }
333  return true;
334 }
335 
336 void MCStreamer::emitCVLinetableDirective(unsigned FunctionId,
337  const MCSymbol *Begin,
338  const MCSymbol *End) {}
339 
340 void MCStreamer::emitCVInlineLinetableDirective(unsigned PrimaryFunctionId,
341  unsigned SourceFileId,
342  unsigned SourceLineNum,
343  const MCSymbol *FnStartSym,
344  const MCSymbol *FnEndSym) {}
345 
346 /// Only call this on endian-specific types like ulittle16_t and little32_t, or
347 /// structs composed of them.
348 template <typename T>
349 static void copyBytesForDefRange(SmallString<20> &BytePrefix,
350  codeview::SymbolKind SymKind,
351  const T &DefRangeHeader) {
352  BytePrefix.resize(2 + sizeof(T));
353  codeview::ulittle16_t SymKindLE = codeview::ulittle16_t(SymKind);
354  memcpy(&BytePrefix[0], &SymKindLE, 2);
355  memcpy(&BytePrefix[2], &DefRangeHeader, sizeof(T));
356 }
357 
359  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
360  StringRef FixedSizePortion) {}
361 
363  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
365  SmallString<20> BytePrefix;
366  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER_REL, DRHdr);
367  emitCVDefRangeDirective(Ranges, BytePrefix);
368 }
369 
371  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
373  SmallString<20> BytePrefix;
374  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_SUBFIELD_REGISTER,
375  DRHdr);
376  emitCVDefRangeDirective(Ranges, BytePrefix);
377 }
378 
380  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
382  SmallString<20> BytePrefix;
383  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER, DRHdr);
384  emitCVDefRangeDirective(Ranges, BytePrefix);
385 }
386 
388  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
390  SmallString<20> BytePrefix;
391  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_FRAMEPOINTER_REL,
392  DRHdr);
393  emitCVDefRangeDirective(Ranges, BytePrefix);
394 }
395 
397  MCSymbol *EHSymbol) {
398 }
399 
400 void MCStreamer::InitSections(bool NoExecStack) {
401  SwitchSection(getContext().getObjectFileInfo()->getTextSection());
402 }
403 
405  assert(Fragment);
406  Symbol->setFragment(Fragment);
407 
408  // As we emit symbols into a section, track the order so that they can
409  // be sorted upon later. Zero is reserved to mean 'unemitted'.
410  SymbolOrdering[Symbol] = 1 + SymbolOrdering.size();
411 }
412 
414  Symbol->redefineIfPossible();
415 
416  if (!Symbol->isUndefined() || Symbol->isVariable())
417  return getContext().reportError(Loc, "symbol '" + Twine(Symbol->getName()) +
418  "' is already defined");
419 
420  assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
421  assert(getCurrentSectionOnly() && "Cannot emit before setting section!");
422  assert(!Symbol->getFragment() && "Unexpected fragment on symbol data!");
423  assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
424 
425  Symbol->setFragment(&getCurrentSectionOnly()->getDummyFragment());
426 
428  if (TS)
429  TS->emitLabel(Symbol);
430 }
431 
432 void MCStreamer::emitCFISections(bool EH, bool Debug) {}
433 
434 void MCStreamer::emitCFIStartProc(bool IsSimple, SMLoc Loc) {
436  return getContext().reportError(
437  Loc, "starting new .cfi frame before finishing the previous one");
438 
439  MCDwarfFrameInfo Frame;
440  Frame.IsSimple = IsSimple;
441  emitCFIStartProcImpl(Frame);
442 
443  const MCAsmInfo* MAI = Context.getAsmInfo();
444  if (MAI) {
445  for (const MCCFIInstruction& Inst : MAI->getInitialFrameState()) {
446  if (Inst.getOperation() == MCCFIInstruction::OpDefCfa ||
447  Inst.getOperation() == MCCFIInstruction::OpDefCfaRegister ||
448  Inst.getOperation() == MCCFIInstruction::OpLLVMDefAspaceCfa) {
449  Frame.CurrentCfaRegister = Inst.getRegister();
450  }
451  }
452  }
453 
454  DwarfFrameInfos.push_back(Frame);
455 }
456 
458 }
459 
461  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
462  if (!CurFrame)
463  return;
464  emitCFIEndProcImpl(*CurFrame);
465 }
466 
468  // Put a dummy non-null value in Frame.End to mark that this frame has been
469  // closed.
470  Frame.End = (MCSymbol *)1;
471 }
472 
474  // Return a dummy non-null value so that label fields appear filled in when
475  // generating textual assembly.
476  return (MCSymbol *)1;
477 }
478 
479 void MCStreamer::emitCFIDefCfa(int64_t Register, int64_t Offset) {
480  MCSymbol *Label = emitCFILabel();
483  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
484  if (!CurFrame)
485  return;
486  CurFrame->Instructions.push_back(Instruction);
487  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
488 }
489 
491  MCSymbol *Label = emitCFILabel();
494  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
495  if (!CurFrame)
496  return;
497  CurFrame->Instructions.push_back(Instruction);
498 }
499 
500 void MCStreamer::emitCFIAdjustCfaOffset(int64_t Adjustment) {
501  MCSymbol *Label = emitCFILabel();
503  MCCFIInstruction::createAdjustCfaOffset(Label, Adjustment);
504  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
505  if (!CurFrame)
506  return;
507  CurFrame->Instructions.push_back(Instruction);
508 }
509 
511  MCSymbol *Label = emitCFILabel();
514  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
515  if (!CurFrame)
516  return;
517  CurFrame->Instructions.push_back(Instruction);
518  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
519 }
520 
522  int64_t AddressSpace) {
523  MCSymbol *Label = emitCFILabel();
525  Label, Register, Offset, AddressSpace);
526  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
527  if (!CurFrame)
528  return;
529  CurFrame->Instructions.push_back(Instruction);
530  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
531 }
532 
533 void MCStreamer::emitCFIOffset(int64_t Register, int64_t Offset) {
534  MCSymbol *Label = emitCFILabel();
537  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
538  if (!CurFrame)
539  return;
540  CurFrame->Instructions.push_back(Instruction);
541 }
542 
544  MCSymbol *Label = emitCFILabel();
547  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
548  if (!CurFrame)
549  return;
550  CurFrame->Instructions.push_back(Instruction);
551 }
552 
554  unsigned Encoding) {
555  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
556  if (!CurFrame)
557  return;
558  CurFrame->Personality = Sym;
559  CurFrame->PersonalityEncoding = Encoding;
560 }
561 
562 void MCStreamer::emitCFILsda(const MCSymbol *Sym, unsigned Encoding) {
563  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
564  if (!CurFrame)
565  return;
566  CurFrame->Lsda = Sym;
567  CurFrame->LsdaEncoding = Encoding;
568 }
569 
571  MCSymbol *Label = emitCFILabel();
573  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
574  if (!CurFrame)
575  return;
576  CurFrame->Instructions.push_back(Instruction);
577 }
578 
580  // FIXME: Error if there is no matching cfi_remember_state.
581  MCSymbol *Label = emitCFILabel();
583  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
584  if (!CurFrame)
585  return;
586  CurFrame->Instructions.push_back(Instruction);
587 }
588 
590  MCSymbol *Label = emitCFILabel();
593  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
594  if (!CurFrame)
595  return;
596  CurFrame->Instructions.push_back(Instruction);
597 }
598 
600  MCSymbol *Label = emitCFILabel();
603  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
604  if (!CurFrame)
605  return;
606  CurFrame->Instructions.push_back(Instruction);
607 }
608 
610  MCSymbol *Label = emitCFILabel();
612  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
613  if (!CurFrame)
614  return;
615  CurFrame->Instructions.push_back(Instruction);
616 }
617 
619  MCSymbol *Label = emitCFILabel();
622  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
623  if (!CurFrame)
624  return;
625  CurFrame->Instructions.push_back(Instruction);
626 }
627 
629  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
630  if (!CurFrame)
631  return;
632  CurFrame->IsSignalFrame = true;
633 }
634 
636  MCSymbol *Label = emitCFILabel();
639  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
640  if (!CurFrame)
641  return;
642  CurFrame->Instructions.push_back(Instruction);
643 }
644 
645 void MCStreamer::emitCFIRegister(int64_t Register1, int64_t Register2) {
646  MCSymbol *Label = emitCFILabel();
648  MCCFIInstruction::createRegister(Label, Register1, Register2);
649  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
650  if (!CurFrame)
651  return;
652  CurFrame->Instructions.push_back(Instruction);
653 }
654 
656  MCSymbol *Label = emitCFILabel();
659  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
660  if (!CurFrame)
661  return;
662  CurFrame->Instructions.push_back(Instruction);
663 }
664 
666  MCSymbol *Label = emitCFILabel();
668  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
669  if (!CurFrame)
670  return;
671  CurFrame->Instructions.push_back(Instruction);
672 }
673 
675  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
676  if (!CurFrame)
677  return;
678  CurFrame->RAReg = Register;
679 }
680 
682  const MCAsmInfo *MAI = Context.getAsmInfo();
683  if (!MAI->usesWindowsCFI()) {
685  Loc, ".seh_* directives are not supported on this target");
686  return nullptr;
687  }
688  if (!CurrentWinFrameInfo || CurrentWinFrameInfo->End) {
690  Loc, ".seh_ directive must appear within an active frame");
691  return nullptr;
692  }
693  return CurrentWinFrameInfo;
694 }
695 
697  const MCAsmInfo *MAI = Context.getAsmInfo();
698  if (!MAI->usesWindowsCFI())
699  return getContext().reportError(
700  Loc, ".seh_* directives are not supported on this target");
701  if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
703  Loc, "Starting a function before ending the previous one!");
704 
705  MCSymbol *StartProc = emitCFILabel();
706 
707  CurrentProcWinFrameInfoStartIndex = WinFrameInfos.size();
708  WinFrameInfos.emplace_back(
709  std::make_unique<WinEH::FrameInfo>(Symbol, StartProc));
710  CurrentWinFrameInfo = WinFrameInfos.back().get();
711  CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
712 }
713 
715  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
716  if (!CurFrame)
717  return;
718  if (CurFrame->ChainedParent)
719  getContext().reportError(Loc, "Not all chained regions terminated!");
720 
721  MCSymbol *Label = emitCFILabel();
722  CurFrame->End = Label;
723  if (!CurFrame->FuncletOrFuncEnd)
724  CurFrame->FuncletOrFuncEnd = CurFrame->End;
725 
726  for (size_t I = CurrentProcWinFrameInfoStartIndex, E = WinFrameInfos.size();
727  I != E; ++I)
728  EmitWindowsUnwindTables(WinFrameInfos[I].get());
729  SwitchSection(CurFrame->TextSection);
730 }
731 
733  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
734  if (!CurFrame)
735  return;
736  if (CurFrame->ChainedParent)
737  getContext().reportError(Loc, "Not all chained regions terminated!");
738 
739  MCSymbol *Label = emitCFILabel();
740  CurFrame->FuncletOrFuncEnd = Label;
741 }
742 
744  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
745  if (!CurFrame)
746  return;
747 
748  MCSymbol *StartProc = emitCFILabel();
749 
750  WinFrameInfos.emplace_back(std::make_unique<WinEH::FrameInfo>(
751  CurFrame->Function, StartProc, CurFrame));
752  CurrentWinFrameInfo = WinFrameInfos.back().get();
753  CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
754 }
755 
757  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
758  if (!CurFrame)
759  return;
760  if (!CurFrame->ChainedParent)
761  return getContext().reportError(
762  Loc, "End of a chained region outside a chained region!");
763 
764  MCSymbol *Label = emitCFILabel();
765 
766  CurFrame->End = Label;
767  CurrentWinFrameInfo = const_cast<WinEH::FrameInfo *>(CurFrame->ChainedParent);
768 }
769 
770 void MCStreamer::EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except,
771  SMLoc Loc) {
772  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
773  if (!CurFrame)
774  return;
775  if (CurFrame->ChainedParent)
776  return getContext().reportError(
777  Loc, "Chained unwind areas can't have handlers!");
778  CurFrame->ExceptionHandler = Sym;
779  if (!Except && !Unwind)
780  getContext().reportError(Loc, "Don't know what kind of handler this is!");
781  if (Unwind)
782  CurFrame->HandlesUnwind = true;
783  if (Except)
784  CurFrame->HandlesExceptions = true;
785 }
786 
788  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
789  if (!CurFrame)
790  return;
791  if (CurFrame->ChainedParent)
792  getContext().reportError(Loc, "Chained unwind areas can't have handlers!");
793 }
794 
796  const MCSymbolRefExpr *To, uint64_t Count) {
797 }
798 
799 static MCSection *getWinCFISection(MCContext &Context, unsigned *NextWinCFIID,
800  MCSection *MainCFISec,
801  const MCSection *TextSec) {
802  // If this is the main .text section, use the main unwind info section.
803  if (TextSec == Context.getObjectFileInfo()->getTextSection())
804  return MainCFISec;
805 
806  const auto *TextSecCOFF = cast<MCSectionCOFF>(TextSec);
807  auto *MainCFISecCOFF = cast<MCSectionCOFF>(MainCFISec);
808  unsigned UniqueID = TextSecCOFF->getOrAssignWinCFISectionID(NextWinCFIID);
809 
810  // If this section is COMDAT, this unwind section should be COMDAT associative
811  // with its group.
812  const MCSymbol *KeySym = nullptr;
813  if (TextSecCOFF->getCharacteristics() & COFF::IMAGE_SCN_LNK_COMDAT) {
814  KeySym = TextSecCOFF->getCOMDATSymbol();
815 
816  // In a GNU environment, we can't use associative comdats. Instead, do what
817  // GCC does, which is to make plain comdat selectany section named like
818  // ".[px]data$_Z3foov".
819  if (!Context.getAsmInfo()->hasCOFFAssociativeComdats()) {
820  std::string SectionName = (MainCFISecCOFF->getName() + "$" +
821  TextSecCOFF->getName().split('$').second)
822  .str();
823  return Context.getCOFFSection(
824  SectionName,
825  MainCFISecCOFF->getCharacteristics() | COFF::IMAGE_SCN_LNK_COMDAT,
826  MainCFISecCOFF->getKind(), "", COFF::IMAGE_COMDAT_SELECT_ANY);
827  }
828  }
829 
830  return Context.getAssociativeCOFFSection(MainCFISecCOFF, KeySym, UniqueID);
831 }
832 
834  return getWinCFISection(getContext(), &NextWinCFIID,
835  getContext().getObjectFileInfo()->getPDataSection(),
836  TextSec);
837 }
838 
840  return getWinCFISection(getContext(), &NextWinCFIID,
841  getContext().getObjectFileInfo()->getXDataSection(),
842  TextSec);
843 }
844 
846 
847 static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg) {
848  return Ctx.getRegisterInfo()->getSEHRegNum(Reg);
849 }
850 
852  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
853  if (!CurFrame)
854  return;
855 
856  MCSymbol *Label = emitCFILabel();
857 
859  Label, encodeSEHRegNum(Context, Register));
860  CurFrame->Instructions.push_back(Inst);
861 }
862 
864  SMLoc Loc) {
865  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
866  if (!CurFrame)
867  return;
868  if (CurFrame->LastFrameInst >= 0)
869  return getContext().reportError(
870  Loc, "frame register and offset can be set at most once");
871  if (Offset & 0x0F)
872  return getContext().reportError(Loc, "offset is not a multiple of 16");
873  if (Offset > 240)
874  return getContext().reportError(
875  Loc, "frame offset must be less than or equal to 240");
876 
877  MCSymbol *Label = emitCFILabel();
878 
881  CurFrame->LastFrameInst = CurFrame->Instructions.size();
882  CurFrame->Instructions.push_back(Inst);
883 }
884 
886  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
887  if (!CurFrame)
888  return;
889  if (Size == 0)
890  return getContext().reportError(Loc,
891  "stack allocation size must be non-zero");
892  if (Size & 7)
893  return getContext().reportError(
894  Loc, "stack allocation size is not a multiple of 8");
895 
896  MCSymbol *Label = emitCFILabel();
897 
899  CurFrame->Instructions.push_back(Inst);
900 }
901 
903  SMLoc Loc) {
904  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
905  if (!CurFrame)
906  return;
907 
908  if (Offset & 7)
909  return getContext().reportError(
910  Loc, "register save offset is not 8 byte aligned");
911 
912  MCSymbol *Label = emitCFILabel();
913 
915  Label, encodeSEHRegNum(Context, Register), Offset);
916  CurFrame->Instructions.push_back(Inst);
917 }
918 
920  SMLoc Loc) {
921  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
922  if (!CurFrame)
923  return;
924  if (Offset & 0x0F)
925  return getContext().reportError(Loc, "offset is not a multiple of 16");
926 
927  MCSymbol *Label = emitCFILabel();
928 
930  Label, encodeSEHRegNum(Context, Register), Offset);
931  CurFrame->Instructions.push_back(Inst);
932 }
933 
935  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
936  if (!CurFrame)
937  return;
938  if (!CurFrame->Instructions.empty())
939  return getContext().reportError(
940  Loc, "If present, PushMachFrame must be the first UOP");
941 
942  MCSymbol *Label = emitCFILabel();
943 
945  CurFrame->Instructions.push_back(Inst);
946 }
947 
949  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
950  if (!CurFrame)
951  return;
952 
953  MCSymbol *Label = emitCFILabel();
954 
955  CurFrame->PrologEnd = Label;
956 }
957 
959 
961 
963 
965 
967 
968 /// EmitRawText - If this file is backed by an assembly streamer, this dumps
969 /// the specified string in the output .s file. This capability is
970 /// indicated by the hasRawTextSupport() predicate.
972  // This is not llvm_unreachable for the sake of out of tree backend
973  // developers who may not have assembly streamers and should serve as a
974  // reminder to not accidentally call EmitRawText in the absence of such.
975  report_fatal_error("EmitRawText called on an MCStreamer that doesn't support "
976  "it (target backend is likely missing an AsmStreamer "
977  "implementation)");
978 }
979 
981  SmallString<128> Str;
982  emitRawTextImpl(T.toStringRef(Str));
983 }
984 
986 }
987 
989 }
990 
991 void MCStreamer::Finish(SMLoc EndLoc) {
992  if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
993  (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
994  getContext().reportError(EndLoc, "Unfinished frame!");
995  return;
996  }
997 
999  if (TS)
1000  TS->finish();
1001 
1002  finishImpl();
1003 }
1004 
1006  if (Context.getDwarfFormat() != dwarf::DWARF64)
1007  return;
1008  AddComment("DWARF64 Mark");
1010 }
1011 
1012 void MCStreamer::emitDwarfUnitLength(uint64_t Length, const Twine &Comment) {
1013  assert(Context.getDwarfFormat() == dwarf::DWARF64 ||
1014  Length <= dwarf::DW_LENGTH_lo_reserved);
1016  AddComment(Comment);
1018 }
1019 
1021  const Twine &Comment) {
1023  AddComment(Comment);
1024  MCSymbol *Lo = Context.createTempSymbol(Prefix + "_start");
1025  MCSymbol *Hi = Context.createTempSymbol(Prefix + "_end");
1026 
1029  // emit the begin symbol after we generate the length field.
1030  emitLabel(Lo);
1031  // Return the Hi symbol to the caller.
1032  return Hi;
1033 }
1034 
1036  // Set the value of the symbol, as we are at the start of the line table.
1037  emitLabel(StartSym);
1038 }
1039 
1041  visitUsedExpr(*Value);
1042  Symbol->setVariableValue(Value);
1043 
1045  if (TS)
1046  TS->emitAssignment(Symbol, Value);
1047 }
1048 
1050  uint64_t Address, const MCInst &Inst,
1051  const MCSubtargetInfo &STI,
1052  raw_ostream &OS) {
1053  InstPrinter.printInst(&Inst, Address, "", STI, OS);
1054 }
1055 
1057 }
1058 
1060  switch (Expr.getKind()) {
1061  case MCExpr::Target:
1062  cast<MCTargetExpr>(Expr).visitUsedExpr(*this);
1063  break;
1064 
1065  case MCExpr::Constant:
1066  break;
1067 
1068  case MCExpr::Binary: {
1069  const MCBinaryExpr &BE = cast<MCBinaryExpr>(Expr);
1070  visitUsedExpr(*BE.getLHS());
1071  visitUsedExpr(*BE.getRHS());
1072  break;
1073  }
1074 
1075  case MCExpr::SymbolRef:
1076  visitUsedSymbol(cast<MCSymbolRefExpr>(Expr).getSymbol());
1077  break;
1078 
1079  case MCExpr::Unary:
1080  visitUsedExpr(*cast<MCUnaryExpr>(Expr).getSubExpr());
1081  break;
1082  }
1083 }
1084 
1086  // Scan for values.
1087  for (unsigned i = Inst.getNumOperands(); i--;)
1088  if (Inst.getOperand(i).isExpr())
1089  visitUsedExpr(*Inst.getOperand(i).getExpr());
1090 }
1091 
1092 void MCStreamer::emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t Type,
1093  uint64_t Attr,
1094  const MCPseudoProbeInlineStack &InlineStack) {
1095  auto &Context = getContext();
1096 
1097  // Create a symbol at in the current section for use in the probe.
1098  MCSymbol *ProbeSym = Context.createTempSymbol();
1099 
1100  // Set the value of the symbol to use for the MCPseudoProbe.
1101  emitLabel(ProbeSym);
1102 
1103  // Create a (local) probe entry with the symbol.
1104  MCPseudoProbe Probe(ProbeSym, Guid, Index, Type, Attr);
1105 
1106  // Add the probe entry to this section's entries.
1108  getCurrentSectionOnly(), Probe, InlineStack);
1109 }
1110 
1112  unsigned Size) {
1113  // Get the Hi-Lo expression.
1114  const MCExpr *Diff =
1116  MCSymbolRefExpr::create(Lo, Context), Context);
1117 
1118  const MCAsmInfo *MAI = Context.getAsmInfo();
1119  if (!MAI->doesSetDirectiveSuppressReloc()) {
1120  emitValue(Diff, Size);
1121  return;
1122  }
1123 
1124  // Otherwise, emit with .set (aka assignment).
1125  MCSymbol *SetLabel = Context.createTempSymbol("set");
1126  emitAssignment(SetLabel, Diff);
1127  emitSymbolValue(SetLabel, Size);
1128 }
1129 
1131  const MCSymbol *Lo) {
1132  // Get the Hi-Lo expression.
1133  const MCExpr *Diff =
1135  MCSymbolRefExpr::create(Lo, Context), Context);
1136 
1137  emitULEB128Value(Diff);
1138 }
1139 
1142 void MCStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
1144  llvm_unreachable("this directive only supported on COFF targets");
1145 }
1147  llvm_unreachable("this directive only supported on COFF targets");
1148 }
1150 void MCStreamer::emitFileDirective(StringRef Filename, StringRef CompilerVerion,
1151  StringRef TimeStamp, StringRef Description) {
1152 }
1154  llvm_unreachable("this directive only supported on COFF targets");
1155 }
1157  llvm_unreachable("this directive only supported on COFF targets");
1158 }
1160  MCSymbol *CsectSym,
1161  unsigned ByteAlign) {
1162  llvm_unreachable("this directive only supported on XCOFF targets");
1163 }
1164 
1167  MCSymbolAttr Visibility) {
1168  llvm_unreachable("emitXCOFFSymbolLinkageWithVisibility is only supported on "
1169  "XCOFF targets");
1170 }
1171 
1173  StringRef Rename) {
1174  llvm_unreachable("emitXCOFFRenameDirective is only supported on "
1175  "XCOFF targets");
1176 }
1177 
1180  StringRef Name, bool KeepOriginalSym) {}
1182  unsigned ByteAlignment) {}
1184  uint64_t Size, unsigned ByteAlignment) {}
1189 void MCStreamer::emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
1190  visitUsedExpr(*Value);
1191 }
1194 void MCStreamer::emitFill(const MCExpr &NumBytes, uint64_t Value, SMLoc Loc) {}
1195 void MCStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
1196  SMLoc Loc) {}
1198  unsigned ValueSize,
1199  unsigned MaxBytesToEmit) {}
1201  unsigned MaxBytesToEmit) {}
1203  SMLoc Loc) {}
1204 void MCStreamer::emitBundleAlignMode(unsigned AlignPow2) {}
1205 void MCStreamer::emitBundleLock(bool AlignToEnd) {}
1208 
1210  assert(Section && "Cannot switch to a null section!");
1211  MCSectionSubPair curSection = SectionStack.back().first;
1212  SectionStack.back().second = curSection;
1213  if (MCSectionSubPair(Section, Subsection) != curSection) {
1214  changeSection(Section, Subsection);
1215  SectionStack.back().first = MCSectionSubPair(Section, Subsection);
1216  assert(!Section->hasEnded() && "Section already ended");
1217  MCSymbol *Sym = Section->getBeginSymbol();
1218  if (Sym && !Sym->isInSection())
1219  emitLabel(Sym);
1220  }
1221 }
1222 
1224  // TODO: keep track of the last subsection so that this symbol appears in the
1225  // correct place.
1226  MCSymbol *Sym = Section->getEndSymbol(Context);
1227  if (Sym->isInSection())
1228  return Sym;
1229 
1231  emitLabel(Sym);
1232  return Sym;
1233 }
1234 
1235 static VersionTuple
1237  VersionTuple TargetVersion) {
1238  VersionTuple Min = Target.getMinimumSupportedOSVersion();
1239  return !Min.empty() && Min > TargetVersion ? Min : TargetVersion;
1240 }
1241 
1242 static MCVersionMinType
1244  assert(Target.isOSDarwin() && "expected a darwin OS");
1245  switch (Target.getOS()) {
1246  case Triple::MacOSX:
1247  case Triple::Darwin:
1248  return MCVM_OSXVersionMin;
1249  case Triple::IOS:
1250  assert(!Target.isMacCatalystEnvironment() &&
1251  "mac Catalyst should use LC_BUILD_VERSION");
1252  return MCVM_IOSVersionMin;
1253  case Triple::TvOS:
1254  return MCVM_TvOSVersionMin;
1255  case Triple::WatchOS:
1256  return MCVM_WatchOSVersionMin;
1257  default:
1258  break;
1259  }
1260  llvm_unreachable("unexpected OS type");
1261 }
1262 
1264  assert(Target.isOSDarwin() && "expected a darwin OS");
1265  switch (Target.getOS()) {
1266  case Triple::MacOSX:
1267  case Triple::Darwin:
1268  return VersionTuple(10, 14);
1269  case Triple::IOS:
1270  // Mac Catalyst always uses the build version load command.
1271  if (Target.isMacCatalystEnvironment())
1272  return VersionTuple();
1274  case Triple::TvOS:
1275  return VersionTuple(12);
1276  case Triple::WatchOS:
1277  return VersionTuple(5);
1278  default:
1279  break;
1280  }
1281  llvm_unreachable("unexpected OS type");
1282 }
1283 
1284 static MachO::PlatformType
1286  assert(Target.isOSDarwin() && "expected a darwin OS");
1287  switch (Target.getOS()) {
1288  case Triple::MacOSX:
1289  case Triple::Darwin:
1290  return MachO::PLATFORM_MACOS;
1291  case Triple::IOS:
1292  if (Target.isMacCatalystEnvironment())
1294  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_IOSSIMULATOR
1296  case Triple::TvOS:
1297  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_TVOSSIMULATOR
1299  case Triple::WatchOS:
1300  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_WATCHOSSIMULATOR
1302  default:
1303  break;
1304  }
1305  llvm_unreachable("unexpected OS type");
1306 }
1307 
1309  const VersionTuple &SDKVersion) {
1310  if (!Target.isOSBinFormatMachO() || !Target.isOSDarwin())
1311  return;
1312  // Do we even know the version?
1313  if (Target.getOSMajorVersion() == 0)
1314  return;
1315 
1316  unsigned Major = 0;
1317  unsigned Minor = 0;
1318  unsigned Update = 0;
1319  switch (Target.getOS()) {
1320  case Triple::MacOSX:
1321  case Triple::Darwin:
1322  Target.getMacOSXVersion(Major, Minor, Update);
1323  break;
1324  case Triple::IOS:
1325  case Triple::TvOS:
1326  Target.getiOSVersion(Major, Minor, Update);
1327  break;
1328  case Triple::WatchOS:
1329  Target.getWatchOSVersion(Major, Minor, Update);
1330  break;
1331  default:
1332  llvm_unreachable("unexpected OS type");
1333  }
1334  assert(Major != 0 && "A non-zero major version is expected");
1335  auto LinkedTargetVersion = targetVersionOrMinimumSupportedOSVersion(
1336  Target, VersionTuple(Major, Minor, Update));
1337  auto BuildVersionOSVersion = getMachoBuildVersionSupportedOS(Target);
1338  if (BuildVersionOSVersion.empty() ||
1339  LinkedTargetVersion >= BuildVersionOSVersion)
1341  LinkedTargetVersion.getMajor(),
1342  *LinkedTargetVersion.getMinor(),
1343  *LinkedTargetVersion.getSubminor(), SDKVersion);
1344 
1346  LinkedTargetVersion.getMajor(),
1347  *LinkedTargetVersion.getMinor(),
1348  *LinkedTargetVersion.getSubminor(), SDKVersion);
1349 }
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::MCStreamer::emitCVInlineLinetableDirective
virtual void emitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
This implements the CodeView '.cv_inline_linetable' assembler directive.
Definition: MCStreamer.cpp:340
i
i
Definition: README.txt:29
llvm::MCDwarfFrameInfo::End
MCSymbol * End
Definition: MCDwarf.h:641
llvm::Win64EH::Instruction::PushMachFrame
static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code)
Definition: MCWin64EH.h:33
llvm::MCStreamer::EmitCOFFSymbolIndex
virtual void EmitCOFFSymbolIndex(MCSymbol const *Symbol)
Emits the symbol table index of a Symbol into the current section.
Definition: MCStreamer.cpp:960
llvm::MCVersionMinType
MCVersionMinType
Definition: MCDirectives.h:66
llvm::MCStreamer::emitCFIDefCfaOffset
virtual void emitCFIDefCfaOffset(int64_t Offset)
Definition: MCStreamer.cpp:490
llvm::MCStreamer::getAssociatedXDataSection
MCSection * getAssociatedXDataSection(const MCSection *TextSec)
Get the .xdata section used for the given section.
Definition: MCStreamer.cpp:839
llvm::MachO::PLATFORM_MACOS
@ PLATFORM_MACOS
Definition: MachO.h:492
llvm::MCStreamer::visitUsedExpr
void visitUsedExpr(const MCExpr &Expr)
Definition: MCStreamer.cpp:1059
llvm::MCTargetStreamer::changeSection
virtual void changeSection(const MCSection *CurSection, MCSection *Section, const MCExpr *SubSection, raw_ostream &OS)
Update streamer for a new active section.
Definition: MCStreamer.cpp:56
MCDwarf.h
MathExtras.h
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::MCStreamer::EmitCOFFSymbolStorageClass
virtual void EmitCOFFSymbolStorageClass(int StorageClass)
Emit the storage class of the symbol.
Definition: MCStreamer.cpp:1153
llvm::MachO::PLATFORM_WATCHOSSIMULATOR
@ PLATFORM_WATCHOSSIMULATOR
Definition: MachO.h:500
llvm::WinEH::FrameInfo::FuncletOrFuncEnd
const MCSymbol * FuncletOrFuncEnd
Definition: MCWinEH.h:42
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::MCTargetStreamer::emitLabel
virtual void emitLabel(MCSymbol *Symbol)
Definition: MCStreamer.cpp:52
llvm::MCStreamer::emitCFILLVMDefAspaceCfa
virtual void emitCFILLVMDefAspaceCfa(int64_t Register, int64_t Offset, int64_t AddressSpace)
Definition: MCStreamer.cpp:521
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MCAsmInfo::doesSetDirectiveSuppressReloc
bool doesSetDirectiveSuppressReloc() const
Definition: MCAsmInfo.h:713
Optional.h
llvm::MCCFIInstruction::OpDefCfaRegister
@ OpDefCfaRegister
Definition: MCDwarf.h:442
llvm::MCStreamer::EndCOFFSymbolDef
virtual void EndCOFFSymbolDef()
Marks the end of the symbol definition.
Definition: MCStreamer.cpp:1146
llvm::MCVM_WatchOSVersionMin
@ MCVM_WatchOSVersionMin
.watchos_version_min
Definition: MCDirectives.h:70
llvm::MCStreamer::emitCFIOffset
virtual void emitCFIOffset(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:533
llvm::MCContext::getDwarfFormat
dwarf::DwarfFormat getDwarfFormat() const
Definition: MCContext.h:790
llvm::MCStreamer::EmitWinEHHandlerData
virtual void EmitWinEHHandlerData(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:787
llvm::MCContext::getCVContext
CodeViewContext & getCVContext()
Definition: MCContext.cpp:908
llvm::MCStreamer::EmitCVFileDirective
virtual bool EmitCVFileDirective(unsigned FileNo, StringRef Filename, ArrayRef< uint8_t > Checksum, unsigned ChecksumKind)
Associate a filename with a specified logical file number, and also specify that file's checksum info...
Definition: MCStreamer.cpp:284
llvm::MCStreamer::emitAbsoluteSymbolDiffAsULEB128
virtual void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo)
Emit the absolute difference between two symbols encoded with ULEB128.
Definition: MCStreamer.cpp:1130
llvm::MCDwarfFrameInfo::Lsda
const MCSymbol * Lsda
Definition: MCDwarf.h:643
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:164
copyBytesForDefRange
static void copyBytesForDefRange(SmallString< 20 > &BytePrefix, codeview::SymbolKind SymKind, const T &DefRangeHeader)
Only call this on endian-specific types like ulittle16_t and little32_t, or structs composed of them.
Definition: MCStreamer.cpp:349
llvm::MCTargetStreamer::emitRawBytes
virtual void emitRawBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:77
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:72
llvm::MCContext::getRegisterInfo
const MCRegisterInfo * getRegisterInfo() const
Definition: MCContext.h:425
llvm::MCStreamer::emitTPRel32Value
virtual void emitTPRel32Value(const MCExpr *Value)
Emit the expression Value into the output as a tprel (32-bit TP relative) value.
Definition: MCStreamer.cpp:202
llvm::MCStreamer::emitELFSize
virtual void emitELFSize(MCSymbol *Symbol, const MCExpr *Value)
Emit an ELF .size directive.
Definition: MCStreamer.cpp:1178
StringRef.h
llvm::MCStreamer::EmitWinCFISaveReg
virtual void EmitWinCFISaveReg(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:902
llvm::Triple::Darwin
@ Darwin
Definition: Triple.h:169
llvm::codeview::SymbolKind
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
llvm::MCStreamer::EmitWinCFISaveXMM
virtual void EmitWinCFISaveXMM(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:919
llvm::MCStreamer::emitCFISections
virtual void emitCFISections(bool EH, bool Debug)
Definition: MCStreamer.cpp:432
SymbolRecord.h
llvm::MCAsmInfo::getPrivateGlobalPrefix
StringRef getPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:654
llvm::MCConstantExpr::create
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition: MCExpr.cpp:194
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:137
llvm::MCAsmInfo
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
llvm::codeview::DefRangeFramePointerRelHeader
Definition: SymbolRecord.h:525
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::MCStreamer::emitCFIStartProc
void emitCFIStartProc(bool IsSimple, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:434
llvm::MipsISD::Lo
@ Lo
Definition: MipsISelLowering.h:79
ErrorHandling.h
llvm::CodeViewContext::addFile
bool addFile(MCStreamer &OS, unsigned FileNumber, StringRef Filename, ArrayRef< uint8_t > ChecksumBytes, uint8_t ChecksumKind)
Definition: MCCodeView.cpp:46
MCSectionCOFF.h
llvm::MCStreamer::emitVersionMin
virtual void emitVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion)
Specify the Mach-O minimum deployment target version.
Definition: MCStreamer.h:487
llvm::MCStreamer::EmitCOFFSecRel32
virtual void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset)
Emits a COFF section relative relocation.
Definition: MCStreamer.cpp:964
llvm::WinEH::FrameInfo::TextSection
MCSection * TextSection
Definition: MCWinEH.h:47
llvm::MCTargetStreamer::finish
virtual void finish()
Definition: MCStreamer.cpp:54
llvm::MCVM_IOSVersionMin
@ MCVM_IOSVersionMin
.ios_version_min
Definition: MCDirectives.h:67
llvm::MCStreamer::Finish
void Finish(SMLoc EndLoc=SMLoc())
Finish emission of machine code.
Definition: MCStreamer.cpp:991
llvm::MCStreamer::emitCFIRegister
virtual void emitCFIRegister(int64_t Register1, int64_t Register2)
Definition: MCStreamer.cpp:645
llvm::Triple::IOS
@ IOS
Definition: Triple.h:173
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::MachO::PLATFORM_IOS
@ PLATFORM_IOS
Definition: MachO.h:493
llvm::MCStreamer::emitXCOFFSymbolLinkageWithVisibility
virtual void emitXCOFFSymbolLinkageWithVisibility(MCSymbol *Symbol, MCSymbolAttr Linkage, MCSymbolAttr Visibility)
Emit a symbol's linkage and visibility with a linkage directive for XCOFF.
Definition: MCStreamer.cpp:1165
COFF.h
llvm::MCStreamer::emitCVLinetableDirective
virtual void emitCVLinetableDirective(unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd)
This implements the CodeView '.cv_linetable' assembler directive.
Definition: MCStreamer.cpp:336
llvm::MCStreamer::emitValue
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:175
llvm::MCPseudoProbe
Instances of this class represent a pseudo probe instance for a pseudo probe table entry,...
Definition: MCPseudoProbe.h:69
llvm::dwarf::DW_LENGTH_DWARF64
@ DW_LENGTH_DWARF64
Indicator of 64-bit DWARF format.
Definition: Dwarf.h:56
getWinCFISection
static MCSection * getWinCFISection(MCContext &Context, unsigned *NextWinCFIID, MCSection *MainCFISec, const MCSection *TextSec)
Definition: MCStreamer.cpp:799
MCObjectFileInfo.h
llvm::MachO::PLATFORM_MACCATALYST
@ PLATFORM_MACCATALYST
Definition: MachO.h:497
llvm::MCStreamer::emitValueImpl
virtual void emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
Definition: MCStreamer.cpp:1189
getMachoBuildVersionSupportedOS
static VersionTuple getMachoBuildVersionSupportedOS(const Triple &Target)
Definition: MCStreamer.cpp:1263
llvm::MCCFIInstruction::createRelOffset
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:534
llvm::MCStreamer::EmitWinCFIEndProc
virtual void EmitWinCFIEndProc(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:714
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::MCStreamer::emitCFISignalFrame
virtual void emitCFISignalFrame()
Definition: MCStreamer.cpp:628
llvm::MCStreamer::emitXCOFFRenameDirective
virtual void emitXCOFFRenameDirective(const MCSymbol *Name, StringRef Rename)
Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name.
Definition: MCStreamer.cpp:1172
llvm::MCStreamer::emitCFILabel
virtual MCSymbol * emitCFILabel()
When emitting an object file, create and emit a real label.
Definition: MCStreamer.cpp:473
llvm::MCStreamer::EmitCVInlineSiteIdDirective
virtual bool EmitCVInlineSiteIdDirective(unsigned FunctionId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol, SMLoc Loc)
Introduces an inline call site id for use with .cv_loc.
Definition: MCStreamer.cpp:295
llvm::MCStreamer::emitPseudoProbe
virtual void emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t Type, uint64_t Attr, const MCPseudoProbeInlineStack &InlineStack)
Emit the a pseudo probe into the current section.
Definition: MCStreamer.cpp:1092
llvm::MCStreamer::emitInt32
void emitInt32(uint64_t Value)
Definition: MCStreamer.h:705
MCPseudoProbe.h
llvm::MCVM_OSXVersionMin
@ MCVM_OSXVersionMin
.macosx_version_min
Definition: MCDirectives.h:68
llvm::Optional
Definition: APInt.h:33
T
#define T
Definition: Mips16ISelLowering.cpp:341
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::MCTargetStreamer::MCTargetStreamer
MCTargetStreamer(MCStreamer &S)
Definition: MCStreamer.cpp:45
llvm::MCStreamer::emitCVLocDirective
virtual void emitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc)
This implements the CodeView '.cv_loc' assembler directive.
Definition: MCStreamer.cpp:309
llvm::MCStreamer::emitDTPRel32Value
virtual void emitDTPRel32Value(const MCExpr *Value)
Emit the expression Value into the output as a dtprel (32-bit DTP relative) value.
Definition: MCStreamer.cpp:194
llvm::MCDwarfFrameInfo::RAReg
unsigned RAReg
Definition: MCDwarf.h:651
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::MCAssemblerFlag
MCAssemblerFlag
Definition: MCDirectives.h:50
llvm::MCBinaryExpr
Binary assembler expressions.
Definition: MCExpr.h:479
llvm::nulls
raw_ostream & nulls()
This returns a reference to a raw_ostream which simply discards output.
Definition: raw_ostream.cpp:899
llvm::MCCFIInstruction::createSameValue
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:571
llvm::WinEH::FrameInfo::ExceptionHandler
const MCSymbol * ExceptionHandler
Definition: MCWinEH.h:43
llvm::MCInst::getNumOperands
unsigned getNumOperands() const
Definition: MCInst.h:208
llvm::Data
@ Data
Definition: SIMachineScheduler.h:56
llvm::Triple::WatchOS
@ WatchOS
Definition: Triple.h:194
llvm::MCInstPrinter::printInst
virtual void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS)=0
Print the specified MCInst to the specified raw_ostream.
llvm::MCCFIInstruction::createLLVMDefAspaceCfa
static MCCFIInstruction createLLVMDefAspaceCfa(MCSymbol *L, unsigned Register, int Offset, unsigned AddressSpace)
.cfi_llvm_def_aspace_cfa defines the rule for computing the CFA to be the result of evaluating the DW...
Definition: MCDwarf.h:517
llvm::MCStreamer::emitDwarfUnitLength
virtual void emitDwarfUnitLength(uint64_t Length, const Twine &Comment)
Emit a unit length field.
Definition: MCStreamer.cpp:1012
llvm::MCContext::getDwarfFile
Expected< unsigned > getDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, Optional< MD5::MD5Result > Checksum, Optional< StringRef > Source, unsigned CUID)
Creates an entry in the dwarf file and directory tables.
Definition: MCContext.cpp:878
llvm::MCStreamer::emitCFIDefCfaRegister
virtual void emitCFIDefCfaRegister(int64_t Register)
Definition: MCStreamer.cpp:510
llvm::MCCFIInstruction::cfiDefCfaOffset
static MCCFIInstruction cfiDefCfaOffset(MCSymbol *L, int Offset)
.cfi_def_cfa_offset modifies a rule for computing CFA.
Definition: MCDwarf.h:502
llvm::MCStreamer::emitCFIAdjustCfaOffset
virtual void emitCFIAdjustCfaOffset(int64_t Adjustment)
Definition: MCStreamer.cpp:500
llvm::MCSymbolAttr
MCSymbolAttr
Definition: MCDirectives.h:18
llvm::MCStreamer::MCStreamer
MCStreamer(MCContext &Ctx)
Definition: MCStreamer.cpp:91
llvm::MCStreamer::emitCFIPersonality
virtual void emitCFIPersonality(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:553
llvm::MCStreamer::changeSection
virtual void changeSection(MCSection *, const MCExpr *)
Update streamer for a new active section.
Definition: MCStreamer.cpp:1185
llvm::MCStreamer::EnsureValidWinFrameInfo
WinEH::FrameInfo * EnsureValidWinFrameInfo(SMLoc Loc)
Retrieve the current frame info if one is available and it is not yet closed.
Definition: MCStreamer.cpp:681
llvm::MipsISD::Hi
@ Hi
Definition: MipsISelLowering.h:75
llvm::MCStreamer::emitDTPRel64Value
virtual void emitDTPRel64Value(const MCExpr *Value)
Emit the expression Value into the output as a dtprel (64-bit DTP relative) value.
Definition: MCStreamer.cpp:190
llvm::MachO::PLATFORM_IOSSIMULATOR
@ PLATFORM_IOSSIMULATOR
Definition: MachO.h:498
llvm::MCStreamer::emitBundleLock
virtual void emitBundleLock(bool AlignToEnd)
The following instructions are a bundle-locked group.
Definition: MCStreamer.cpp:1205
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::MCCFIInstruction::OpDefCfa
@ OpDefCfa
Definition: MCDwarf.h:444
llvm::MCStreamer::emitCFIEndProcImpl
virtual void emitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame)
Definition: MCStreamer.cpp:467
llvm::CodeViewContext::getCVFunctionInfo
MCCVFunctionInfo * getCVFunctionInfo(unsigned FuncId)
Retreive the function info if this is a valid function id, or nullptr.
Definition: MCCodeView.cpp:78
llvm::MCFragment
Definition: MCFragment.h:31
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:197
llvm::MCPseudoProbeTable::getProbeSections
MCPseudoProbeSection & getProbeSections()
Definition: MCPseudoProbe.h:169
llvm::MCStreamer::emitULEB128Value
virtual void emitULEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:1192
llvm::MCStreamer::emitGPRel64Value
virtual void emitGPRel64Value(const MCExpr *Value)
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.
Definition: MCStreamer.cpp:206
llvm::MCContext::getOrCreateSymbol
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition: MCContext.cpp:191
llvm::MCStreamer::emitCFIUndefined
virtual void emitCFIUndefined(int64_t Register)
Definition: MCStreamer.cpp:635
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:36
llvm::MCDwarfFrameInfo::CurrentCfaRegister
unsigned CurrentCfaRegister
Definition: MCDwarf.h:645
MCAsmBackend.h
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
llvm::MCStreamer::emitCFIRelOffset
virtual void emitCFIRelOffset(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:543
llvm::MCRegisterInfo::getSEHRegNum
int getSEHRegNum(MCRegister RegNum) const
Map a target register to an equivalent SEH register number.
Definition: MCRegisterInfo.cpp:109
llvm::MCStreamer::emitCFISameValue
virtual void emitCFISameValue(int64_t Register)
Definition: MCStreamer.cpp:589
SmallString.h
llvm::Triple::TvOS
@ TvOS
Definition: Triple.h:193
llvm::encodeSLEB128
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
Definition: LEB128.h:23
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MCStreamer::getAssociatedPDataSection
MCSection * getAssociatedPDataSection(const MCSection *TextSec)
Get the .pdata section used for the given section.
Definition: MCStreamer.cpp:833
llvm::support::little
@ little
Definition: Endian.h:27
llvm::Win64EH::Instruction::Alloc
static WinEH::Instruction Alloc(MCSymbol *L, unsigned Size)
Definition: MCWin64EH.h:29
llvm::MCExpr::Target
@ Target
Target specific expression.
Definition: MCExpr.h:42
llvm::MCStreamer::EmitCOFFSectionIndex
virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol)
Emits a COFF section index.
Definition: MCStreamer.cpp:962
llvm::MCStreamer::emitCFIStartProcImpl
virtual void emitCFIStartProcImpl(MCDwarfFrameInfo &Frame)
Definition: MCStreamer.cpp:457
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::MCDwarfFrameInfo::Personality
const MCSymbol * Personality
Definition: MCDwarf.h:642
MCContext.h
llvm::MCContext::getMCPseudoProbeTable
MCPseudoProbeTable & getMCPseudoProbeTable()
Definition: MCContext.h:833
llvm::CodeViewContext
Holds state from .cv_file and .cv_loc directives for later emission.
Definition: MCCodeView.h:137
llvm::MCStreamer::emitLabel
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Definition: MCStreamer.cpp:413
MCSymbol.h
llvm::MCStreamer::emitSymbolValue
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:179
MCInst.h
llvm::MCBinaryExpr::getRHS
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
Definition: MCExpr.h:629
false
Definition: StackSlotColoring.cpp:142
llvm::WinEH::FrameInfo::LastFrameInst
int LastFrameInst
Definition: MCWinEH.h:54
llvm::MCStreamer::emitBuildVersion
virtual void emitBuildVersion(unsigned Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion)
Emit/Specify Mach-O build version command.
Definition: MCStreamer.h:493
llvm::MCStreamer::emitAssemblerFlag
virtual void emitAssemblerFlag(MCAssemblerFlag Flag)
Note in the output the specified Flag.
Definition: MCStreamer.cpp:1140
llvm::isUIntN
bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
Definition: MathExtras.h:455
llvm::MCStreamer::hasUnfinishedDwarfFrameInfo
bool hasUnfinishedDwarfFrameInfo()
Definition: MCStreamer.cpp:270
llvm::MCDwarfLineTable
Definition: MCDwarf.h:308
llvm::MCStreamer::finishImpl
virtual void finishImpl()
Streamer specific finalization.
Definition: MCStreamer.cpp:1206
llvm::Instruction
Definition: Instruction.h:45
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:146
llvm::MCStreamer::emitAssignment
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Definition: MCStreamer.cpp:1040
llvm::dwarf::DW_LENGTH_lo_reserved
@ DW_LENGTH_lo_reserved
Special values for an initial length field.
Definition: Dwarf.h:55
llvm::MCCFIInstruction::createRestoreState
static MCCFIInstruction createRestoreState(MCSymbol *L)
.cfi_restore_state Restore the previously saved state.
Definition: MCDwarf.h:581
llvm::report_fatal_error
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:140
llvm::MCStreamer::emitRawComment
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:118
getMachoBuildVersionPlatformType
static MachO::PlatformType getMachoBuildVersionPlatformType(const Triple &Target)
Definition: MCStreamer.cpp:1285
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::MCStreamer::EmitWinCFIEndProlog
virtual void EmitWinCFIEndProlog(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:948
llvm::MachO::PlatformType
PlatformType
Definition: MachO.h:491
llvm::Win64EH::Instruction::SaveNonVol
static WinEH::Instruction SaveNonVol(MCSymbol *L, unsigned Reg, unsigned Offset)
Definition: MCWin64EH.h:36
llvm::SmallVectorImpl< char >::resize
void resize(size_type N)
Definition: SmallVector.h:606
llvm::MCStreamer::maybeEmitDwarf64Mark
void maybeEmitDwarf64Mark()
Emit a special value of 0xffffffff if producing 64-bit debugging info.
Definition: MCStreamer.cpp:1005
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:28
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:91
llvm::MCStreamer::EmitWinCFIPushReg
virtual void EmitWinCFIPushReg(MCRegister Register, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:851
llvm::MCTargetStreamer::~MCTargetStreamer
virtual ~MCTargetStreamer()
llvm::MCStreamer::EmitWinCFIStartProc
virtual void EmitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:696
llvm::MCStreamer::emitGPRel32Value
virtual void emitGPRel32Value(const MCExpr *Value)
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.
Definition: MCStreamer.cpp:210
llvm::MCStreamer::emitTPRel64Value
virtual void emitTPRel64Value(const MCExpr *Value)
Emit the expression Value into the output as a tprel (64-bit TP relative) value.
Definition: MCStreamer.cpp:198
llvm::MCStreamer::visitUsedSymbol
virtual void visitUsedSymbol(const MCSymbol &Sym)
Definition: MCStreamer.cpp:1056
llvm::MCCFIInstruction::createEscape
static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals, StringRef Comment="")
.cfi_escape Allows the user to add arbitrary bytes to the unwind info.
Definition: MCDwarf.h:587
llvm::MCExpr::getKind
ExprKind getKind() const
Definition: MCExpr.h:81
llvm::Win64EH::Instruction::SetFPReg
static WinEH::Instruction SetFPReg(MCSymbol *L, unsigned Reg, unsigned Off)
Definition: MCWin64EH.h:48
llvm::MCStreamer::getCurrentSectionOnly
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:374
llvm::AddressSpace
AddressSpace
Definition: NVPTXBaseInfo.h:21
llvm::isIntN
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
Definition: MathExtras.h:460
llvm::MCTargetStreamer::emitAssignment
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Definition: MCStreamer.cpp:89
llvm::MCDwarfLineTable::getLabel
MCSymbol * getLabel() const
Definition: MCDwarf.h:352
llvm::MCContext::getTargetTriple
const Triple & getTargetTriple() const
Definition: MCContext.h:409
llvm::MCVM_TvOSVersionMin
@ MCVM_TvOSVersionMin
.tvos_version_min
Definition: MCDirectives.h:69
MCInstPrinter.h
llvm::MCCFIInstruction
Definition: MCDwarf.h:434
llvm::MCAsmInfo::getData8bitsDirective
const char * getData8bitsDirective() const
Definition: MCAsmInfo.h:554
llvm::MCExpr::Binary
@ Binary
Binary expressions.
Definition: MCExpr.h:38
MCRegister.h
llvm::MCCFIInstruction::createDefCfaRegister
static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register)
.cfi_def_cfa_register modifies a rule for computing CFA.
Definition: MCDwarf.h:495
llvm::SmallString< 128 >
llvm::WinEH::FrameInfo::Function
const MCSymbol * Function
Definition: MCWinEH.h:44
llvm::MCStreamer::emitBinaryData
virtual void emitBinaryData(StringRef Data)
Functionally identical to EmitBytes.
Definition: MCStreamer.cpp:1188
llvm::MCStreamer::emitCGProfileEntry
virtual void emitCGProfileEntry(const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count)
Definition: MCStreamer.cpp:795
llvm::MCStreamer::emitSymbolDesc
virtual void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue)
Set the DescValue for the Symbol.
Definition: MCStreamer.cpp:1142
llvm::MCStreamer::emitDwarfFile0Directive
virtual void emitDwarfFile0Directive(StringRef Directory, StringRef Filename, Optional< MD5::MD5Result > Checksum, Optional< StringRef > Source, unsigned CUID=0)
Specify the "root" file of the compilation, using the ".file 0" extension.
Definition: MCStreamer.cpp:236
llvm::MCStreamer::endSection
MCSymbol * endSection(MCSection *Section)
Definition: MCStreamer.cpp:1223
llvm::codeview::DefRangeSubfieldRegisterHeader
Definition: SymbolRecord.h:501
llvm::XCOFF::StorageClass
StorageClass
Definition: XCOFF.h:113
llvm::Triple::MacOSX
@ MacOSX
Definition: Triple.h:177
llvm::MCStreamer::emitFileDirective
virtual void emitFileDirective(StringRef Filename)
Switch to a new logical file.
Definition: MCStreamer.cpp:1149
llvm::MCStreamer::EmitWinEHHandler
virtual void EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:770
llvm::MCAsmBackend::generateCompactUnwindEncoding
virtual uint32_t generateCompactUnwindEncoding(ArrayRef< MCCFIInstruction >) const
Generate the compact unwind encoding for the CFI instructions.
Definition: MCAsmBackend.h:205
llvm::support::ulittle16_t
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
Definition: Endian.h:270
llvm::MCStreamer::emitValueToOffset
virtual void emitValueToOffset(const MCExpr *Offset, unsigned char Value, SMLoc Loc)
Emit some number of copies of Value until the byte offset Offset is reached.
Definition: MCStreamer.cpp:1202
llvm::MCStreamer::emitEHSymAttributes
virtual void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol)
Definition: MCStreamer.cpp:396
llvm::DenseMapBase::clear
void clear()
Definition: DenseMap.h:111
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::MCStreamer::addExplicitComment
virtual void addExplicitComment(const Twine &T)
Add explicit comment T.
Definition: MCStreamer.cpp:120
llvm::StoreIntToMemory
void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes)
StoreIntToMemory - Fills the StoreBytes bytes of memory starting from Dst with the integer held in In...
Definition: APInt.cpp:3060
llvm::MCContext::getMCDwarfLineTable
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
Definition: MCContext.h:693
llvm::Win64EH::Instruction::SaveXMM
static WinEH::Instruction SaveXMM(MCSymbol *L, unsigned Reg, unsigned Offset)
Definition: MCWin64EH.h:42
llvm::MCContext::getAsmInfo
const MCAsmInfo * getAsmInfo() const
Definition: MCContext.h:423
llvm::MCTargetStreamer::Streamer
MCStreamer & Streamer
Definition: MCStreamer.h:93
llvm::MCInstPrinter
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:43
llvm::MCCFIInstruction::createGnuArgsSize
static MCCFIInstruction createGnuArgsSize(MCSymbol *L, int Size)
A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE.
Definition: MCDwarf.h:593
llvm::WinEH::FrameInfo::PrologEnd
const MCSymbol * PrologEnd
Definition: MCWinEH.h:45
llvm::MCStreamer::emitCFIBKeyFrame
virtual void emitCFIBKeyFrame()
Definition: MCStreamer.cpp:245
llvm::MCStreamer::emitRawText
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:980
llvm::MCStreamer::emitSyntaxDirective
virtual void emitSyntaxDirective()
Definition: MCStreamer.cpp:845
LEB128.h
llvm::MCDwarfLineTable::setLabel
void setLabel(MCSymbol *Label)
Definition: MCDwarf.h:356
llvm::MCCFIInstruction::createNegateRAState
static MCCFIInstruction createNegateRAState(MCSymbol *L)
.cfi_negate_ra_state AArch64 negate RA state.
Definition: MCDwarf.h:552
llvm::MCStreamer::emitInstruction
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Definition: MCStreamer.cpp:1085
I
#define I(x, y, z)
Definition: MD5.cpp:59
Debug
bool Debug
Definition: PassBuilderBindings.cpp:51
FuncId
Profile::FuncID FuncId
Definition: Profile.cpp:321
llvm::MCContext::setCurrentDwarfLoc
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:736
MCRegisterInfo.h
llvm::codeview::DefRangeRegisterHeader
Definition: SymbolRecord.h:479
llvm::Value::print
void print(raw_ostream &O, bool IsForDebug=false) const
Implement operator<< on Value.
Definition: AsmWriter.cpp:4593
llvm::MCStreamer::EmitWinCFIPushFrame
virtual void EmitWinCFIPushFrame(bool Code, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:934
llvm::HighlightColor::Address
@ Address
llvm::MCStreamer::getStartTokLoc
SMLoc getStartTokLoc() const
Definition: MCStreamer.h:270
llvm::MCStreamer::emitNops
virtual void emitNops(int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc)
Definition: MCStreamer.cpp:220
llvm::MCStreamer::EmitWindowsUnwindTables
virtual void EmitWindowsUnwindTables()
Definition: MCStreamer.cpp:985
llvm::MCStreamer::EmitWinCFIAllocStack
virtual void EmitWinCFIAllocStack(unsigned Size, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:885
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCCVFunctionInfo
Information describing a function or inlined call site introduced by .cv_func_id or ....
Definition: MCCodeView.h:91
llvm::MCStreamer::emitCFIEscape
virtual void emitCFIEscape(StringRef Values)
Definition: MCStreamer.cpp:609
getMachoVersionMinLoadCommandType
static MCVersionMinType getMachoVersionMinLoadCommandType(const Triple &Target)
Definition: MCStreamer.cpp:1243
llvm::MCStreamer::emitIntValue
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:131
memcpy
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
llvm::MCStreamer::emitCFIRestore
virtual void emitCFIRestore(int64_t Register)
Definition: MCStreamer.cpp:599
llvm::MCBinaryExpr::createSub
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:608
llvm::COFF::IMAGE_SCN_LNK_COMDAT
@ IMAGE_SCN_LNK_COMDAT
Definition: COFF.h:294
llvm::MCContext::reportError
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:963
llvm::MCStreamer::EmitCVFuncIdDirective
virtual bool EmitCVFuncIdDirective(unsigned FunctionId)
Introduces a function id for use with .cv_loc.
Definition: MCStreamer.cpp:291
llvm::MCStreamer::emitTBSSSymbol
virtual void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0)
Emit a thread local bss (.tbss) symbol.
Definition: MCStreamer.cpp:1183
llvm::MCCFIInstruction::cfiDefCfa
static MCCFIInstruction cfiDefCfa(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:488
llvm::MCStreamer::GetCommentOS
virtual raw_ostream & GetCommentOS()
Return a raw_ostream that comments can be written to.
Definition: MCStreamer.cpp:108
llvm::MCSymbolRefExpr
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:192
llvm::MCStreamer::getNumFrameInfos
unsigned getNumFrameInfos()
Definition: MCStreamer.cpp:113
MCSection.h
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:70
llvm::codeview::DefRangeRegisterRelHeader
Definition: SymbolRecord.h:551
llvm::MCStreamer::EmitWinCFIFuncletOrFuncEnd
virtual void EmitWinCFIFuncletOrFuncEnd(SMLoc Loc=SMLoc())
This is used on platforms, such as Windows on ARM64, that require function or funclet sizes to be emi...
Definition: MCStreamer.cpp:732
llvm::MCStreamer::EmitWinCFISetFrame
virtual void EmitWinCFISetFrame(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:863
llvm::Sched::Source
@ Source
Definition: TargetLowering.h:99
llvm::MCStreamer::EmitCOFFSymbolType
virtual void EmitCOFFSymbolType(int Type)
Emit the type of the symbol.
Definition: MCStreamer.cpp:1156
llvm::MCStreamer::emitCodeAlignment
virtual void emitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0)
Emit nops until the byte alignment ByteAlignment is reached.
Definition: MCStreamer.cpp:1200
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
MCAsmInfo.h
llvm::MCPseudoProbeSection::addPseudoProbe
void addPseudoProbe(MCSection *Sec, const MCPseudoProbe &Probe, const MCPseudoProbeInlineStack &InlineStack)
Definition: MCPseudoProbe.h:132
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::raw_svector_ostream::str
StringRef str() const
Return a StringRef for the vector contents.
Definition: raw_ostream.h:681
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::Win64EH::Instruction::PushNonVol
static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg)
Definition: MCWin64EH.h:26
llvm::MCCFIInstruction::OpLLVMDefAspaceCfa
@ OpLLVMDefAspaceCfa
Definition: MCDwarf.h:441
llvm::MCStreamer::getDwarfFrameInfos
ArrayRef< MCDwarfFrameInfo > getDwarfFrameInfos() const
Definition: MCStreamer.cpp:114
llvm::MCStreamer::emitBundleAlignMode
virtual void emitBundleAlignMode(unsigned AlignPow2)
Set the bundle alignment mode from now on in the section.
Definition: MCStreamer.cpp:1204
llvm::MCContext::setMCLineTableRootFile
void setMCLineTableRootFile(unsigned CUID, StringRef CompilationDir, StringRef Filename, Optional< MD5::MD5Result > Checksum, Optional< StringRef > Source)
Specifies the "root" file and directory of the compilation unit.
Definition: MCContext.h:719
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
llvm::MCStreamer::EmitCOFFImgRel32
virtual void EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset)
Emits a COFF image relative relocation.
Definition: MCStreamer.cpp:966
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCCFIInstruction::createAdjustCfaOffset
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:509
llvm::MCStreamer::emitCFIGnuArgsSize
virtual void emitCFIGnuArgsSize(int64_t Size)
Definition: MCStreamer.cpp:618
llvm::MCStreamer::emitWeakReference
virtual void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol)
Emit an weak reference from Alias to Symbol.
Definition: MCStreamer.cpp:1186
llvm::MCAsmInfo::getInitialFrameState
const std::vector< MCCFIInstruction > & getInitialFrameState() const
Definition: MCAsmInfo.h:805
LLVM_FALLTHROUGH
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:273
llvm::MCContext::createTempSymbol
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
Definition: MCContext.cpp:303
llvm::MachO::PLATFORM_TVOS
@ PLATFORM_TVOS
Definition: MachO.h:494
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::MCStreamer::emitCFIDefCfa
virtual void emitCFIDefCfa(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:479
llvm::MCDwarfFrameInfo::IsBKeyFrame
bool IsBKeyFrame
Definition: MCDwarf.h:652
llvm::MCStreamer::EmitWinCFIStartChained
virtual void EmitWinCFIStartChained(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:743
llvm::MCDwarfFrameInfo::PersonalityEncoding
unsigned PersonalityEncoding
Definition: MCDwarf.h:646
llvm::MCStreamer::emitDwarfLineStartLabel
virtual void emitDwarfLineStartLabel(MCSymbol *StartSym)
Emit the debug line start label.
Definition: MCStreamer.cpp:1035
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::CodeViewContext::recordFunctionId
bool recordFunctionId(unsigned FuncId)
Records the function id of a normal function.
Definition: MCCodeView.cpp:86
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
MCWinEH.h
MCCodeView.h
llvm::MCCVFunctionInfo::Section
MCSection * Section
The section of the first .cv_loc directive used for this function, or null if none has been seen yet.
Definition: MCCodeView.h:111
llvm::MCStreamer::emitELFSymverDirective
virtual void emitELFSymverDirective(const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym)
Emit an ELF .symver directive.
Definition: MCStreamer.cpp:1179
llvm::MCStreamer::emitSLEB128IntValue
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:168
llvm::MachO::PLATFORM_TVOSSIMULATOR
@ PLATFORM_TVOSSIMULATOR
Definition: MachO.h:499
get
Should compile to something r4 addze r3 instead we get
Definition: README.txt:24
llvm::WinEH::FrameInfo::HandlesExceptions
bool HandlesExceptions
Definition: MCWinEH.h:51
llvm::MCStreamer::AssignFragment
void AssignFragment(MCSymbol *Symbol, MCFragment *Fragment)
Sets the symbol's section.
Definition: MCStreamer.cpp:404
llvm::SectionName
Definition: DWARFSection.h:21
Casting.h
llvm::MCStreamer::emitCVDefRangeDirective
virtual void emitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion)
This implements the CodeView '.cv_def_range' assembler directive.
Definition: MCStreamer.cpp:358
llvm::MCStreamer::emitCFIWindowSave
virtual void emitCFIWindowSave()
Definition: MCStreamer.cpp:655
llvm::MCStreamer::emitCFILsda
virtual void emitCFILsda(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:562
llvm::MCStreamer::emitAbsoluteSymbolDiff
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
Definition: MCStreamer.cpp:1111
llvm::support::endian::byte_swap
value_type byte_swap(value_type value, endianness endian)
Definition: Endian.h:49
llvm::MCOperand::getExpr
const MCExpr * getExpr() const
Definition: MCInst.h:114
llvm::MCStreamer::emitExplicitComments
virtual void emitExplicitComments()
Emit added explicit comments.
Definition: MCStreamer.cpp:121
llvm::DenseMapBase::size
unsigned size() const
Definition: DenseMap.h:100
llvm::MCDwarfFrameInfo::IsSignalFrame
bool IsSignalFrame
Definition: MCDwarf.h:649
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
encodeSEHRegNum
static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg)
Definition: MCStreamer.cpp:847
llvm::MCStreamer::emitSLEB128Value
virtual void emitSLEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:1193
llvm::MCStreamer::emitBundleUnlock
virtual void emitBundleUnlock()
Ends a bundle-locked group.
Definition: MCStreamer.cpp:1207
llvm::MCAsmInfo::isLittleEndian
bool isLittleEndian() const
True if the target is little endian.
Definition: MCAsmInfo.h:545
llvm::MCStreamer::InitSections
virtual void InitSections(bool NoExecStack)
Create the default sections and set the initial one.
Definition: MCStreamer.cpp:400
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:384
llvm::SmallVectorImpl::clear
void clear()
Definition: SmallVector.h:585
llvm::MCStreamer::EmitCOFFSafeSEH
virtual void EmitCOFFSafeSEH(MCSymbol const *Symbol)
Definition: MCStreamer.cpp:958
llvm::MCStreamer::emitCFIRememberState
virtual void emitCFIRememberState()
Definition: MCStreamer.cpp:570
llvm::SmallString::str
StringRef str() const
Explicit conversion to StringRef.
Definition: SmallString.h:259
llvm::MCOperand::isExpr
bool isExpr() const
Definition: MCInst.h:65
llvm::LCOMM::ByteAlignment
@ ByteAlignment
Definition: MCAsmInfo.h:50
llvm::MachO::PLATFORM_WATCHOS
@ PLATFORM_WATCHOS
Definition: MachO.h:495
llvm::WinEH::FrameInfo::End
const MCSymbol * End
Definition: MCWinEH.h:41
llvm::MCStreamer::BeginCOFFSymbolDef
virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol)
Start emitting COFF symbol definition.
Definition: MCStreamer.cpp:1143
llvm::MCStreamer::checkCVLocSection
bool checkCVLocSection(unsigned FuncId, unsigned FileNo, SMLoc Loc)
Returns true if the the .cv_loc directive is in the right section.
Definition: MCStreamer.cpp:314
llvm::WinEH::FrameInfo
Definition: MCWinEH.h:39
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79
llvm::MCStreamer::emitCFIEndProc
void emitCFIEndProc()
Definition: MCStreamer.cpp:460
llvm::MCStreamer::~MCStreamer
virtual ~MCStreamer()
Definition: MCStreamer.cpp:97
llvm::MCStreamer::emitULEB128IntValue
void emitULEB128IntValue(uint64_t Value, unsigned PadTo=0)
Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integ...
Definition: MCStreamer.cpp:159
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition: MCStreamer.h:278
llvm::MCDwarfFrameInfo::Instructions
std::vector< MCCFIInstruction > Instructions
Definition: MCDwarf.h:644
llvm::WinEH::FrameInfo::HandlesUnwind
bool HandlesUnwind
Definition: MCWinEH.h:50
llvm::MCCFIInstruction::createRegister
static MCCFIInstruction createRegister(MCSymbol *L, unsigned Register1, unsigned Register2)
.cfi_register Previous value of Register1 is saved in register Register2.
Definition: MCDwarf.h:541
llvm::MCStreamer::emitXCOFFLocalCommonSymbol
virtual void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, MCSymbol *CsectSym, unsigned ByteAlignment)
Emits an lcomm directive with XCOFF csect information.
Definition: MCStreamer.cpp:1159
llvm::MCStreamer::emitFill
void emitFill(uint64_t NumBytes, uint8_t FillValue)
Emit NumBytes bytes worth of the value specified by FillValue.
Definition: MCStreamer.cpp:216
llvm::MCDwarfFrameInfo::LsdaEncoding
unsigned LsdaEncoding
Definition: MCDwarf.h:647
llvm::MCStreamer::getTargetStreamer
MCTargetStreamer * getTargetStreamer()
Definition: MCStreamer.h:285
llvm::MCExpr::SymbolRef
@ SymbolRef
References to labels and assigned expressions.
Definition: MCExpr.h:40
llvm::MCCFIInstruction::createUndefined
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:565
llvm::MCExpr::Unary
@ Unary
Unary expressions.
Definition: MCExpr.h:41
llvm::sys::IsLittleEndianHost
static const bool IsLittleEndianHost
Definition: SwapByteOrder.h:101
llvm::CodeViewContext::recordInlinedCallSiteId
bool recordInlinedCallSiteId(unsigned FuncId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol)
Records the function id of an inlined call site.
Definition: MCCodeView.cpp:99
targetVersionOrMinimumSupportedOSVersion
static VersionTuple targetVersionOrMinimumSupportedOSVersion(const Triple &Target, VersionTuple TargetVersion)
Definition: MCStreamer.cpp:1236
MCStreamer.h
llvm::MCInst::getOperand
const MCOperand & getOperand(unsigned i) const
Definition: MCInst.h:206
llvm::MCSymbol::isInSection
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
Definition: MCSymbol.h:247
llvm::MCStreamer::emitCFIReturnColumn
virtual void emitCFIReturnColumn(int64_t Register)
Definition: MCStreamer.cpp:674
llvm::MCSectionSubPair
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:64
llvm::MCStreamer::emitDwarfLocDirective
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:252
llvm::MCExpr::Constant
@ Constant
Constant expressions.
Definition: MCExpr.h:39
llvm::WinEH::Instruction
Definition: MCWinEH.h:21
llvm::raw_svector_ostream
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:656
llvm::MCStreamer::emitValueToAlignment
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:1197
llvm::encodeULEB128
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
Definition: LEB128.h:80
llvm::MCTargetStreamer::emitValue
virtual void emitValue(const MCExpr *Value)
Definition: MCStreamer.cpp:69
llvm::MCStreamer::emitBytes
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:1187
llvm::VersionTuple::empty
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero).
Definition: VersionTuple.h:64
llvm::MCDwarfFrameInfo::IsSimple
bool IsSimple
Definition: MCDwarf.h:650
llvm::MCCFIInstruction::createOffset
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:526
llvm::MCTargetStreamer::prettyPrintAsm
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, uint64_t Address, const MCInst &Inst, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition: MCStreamer.cpp:1049
llvm::MCCFIInstruction::createRememberState
static MCCFIInstruction createRememberState(MCSymbol *L)
.cfi_remember_state Save all current rules for all registers.
Definition: MCDwarf.h:576
llvm::dwarf::DWARF64
@ DWARF64
Definition: Dwarf.h:92
llvm::WinEH::FrameInfo::Instructions
std::vector< Instruction > Instructions
Definition: MCWinEH.h:56
llvm::MCTargetStreamer::emitDwarfFileDirective
virtual void emitDwarfFileDirective(StringRef Directive)
Definition: MCStreamer.cpp:65
llvm::MCStreamer::emitRawTextImpl
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:971
From
BlockVerifier::State From
Definition: BlockVerifier.cpp:55
llvm::WinEH::FrameInfo::ChainedParent
const FrameInfo * ChainedParent
Definition: MCWinEH.h:55
llvm::lltok::ChecksumKind
@ ChecksumKind
Definition: LLToken.h:486
raw_ostream.h
llvm::dwarf::getDwarfOffsetByteSize
uint8_t getDwarfOffsetByteSize(DwarfFormat Format)
The size of a reference determined by the DWARF 32/64-bit format.
Definition: Dwarf.h:635
llvm::MCStreamer::generateCompactUnwindEncodings
void generateCompactUnwindEncodings(MCAsmBackend *MAB)
Definition: MCStreamer.cpp:123
llvm::MCStreamer::getDwarfLineTableSymbol
virtual MCSymbol * getDwarfLineTableSymbol(unsigned CUID)
Definition: MCStreamer.cpp:260
llvm::MCAsmInfo::usesWindowsCFI
bool usesWindowsCFI() const
Definition: MCAsmInfo.h:778
llvm::MCStreamer::emitCFIRestoreState
virtual void emitCFIRestoreState()
Definition: MCStreamer.cpp:579
llvm::MCStreamer::SwitchSection
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
Definition: MCStreamer.cpp:1209
llvm::MCDwarfFrameInfo
Definition: MCDwarf.h:637
MCExpr.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75
llvm::MCStreamer::emitThumbFunc
virtual void emitThumbFunc(MCSymbol *Func)
Note in the output that the specified Func is a Thumb mode function (ARM target only).
Definition: MCStreamer.cpp:1141
llvm::MCStreamer::EmitWinCFIEndChained
virtual void EmitWinCFIEndChained(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:756
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::Directive
Definition: DirectiveEmitter.h:100
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::MCStreamer::emitVersionForTarget
void emitVersionForTarget(const Triple &Target, const VersionTuple &SDKVersion)
Definition: MCStreamer.cpp:1308
llvm::MCCFIInstruction::createWindowSave
static MCCFIInstruction createWindowSave(MCSymbol *L)
.cfi_window_save SPARC register window is saved.
Definition: MCDwarf.h:547
llvm::MCStreamer::reset
virtual void reset()
State management.
Definition: MCStreamer.cpp:99
llvm::MCStreamer::tryEmitDwarfFileDirective
virtual Expected< unsigned > tryEmitDwarfFileDirective(unsigned FileNo, StringRef Directory, StringRef Filename, Optional< MD5::MD5Result > Checksum=None, Optional< StringRef > Source=None, unsigned CUID=0)
Associate a filename with a specified logical file number.
Definition: MCStreamer.cpp:227
llvm::MCStreamer::AddComment
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
Definition: MCStreamer.h:340
llvm::COFF::IMAGE_COMDAT_SELECT_ANY
@ IMAGE_COMDAT_SELECT_ANY
Definition: COFF.h:408
llvm::MCStreamer::emitCFINegateRAState
virtual void emitCFINegateRAState()
Definition: MCStreamer.cpp:665
llvm::support::big
@ big
Definition: Endian.h:27
llvm::MCStreamer::emitLocalCommonSymbol
virtual void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)
Emit a local common (.lcomm) symbol.
Definition: MCStreamer.cpp:1181
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:23
MCWin64EH.h
llvm::MCBinaryExpr::getLHS
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
Definition: MCExpr.h:626
llvm::MCStreamer::emitZeros
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
Definition: MCStreamer.cpp:224
llvm::MCCFIInstruction::createRestore
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:559