LLVM  15.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"
17 #include "llvm/MC/MCAsmBackend.h"
18 #include "llvm/MC/MCAsmInfo.h"
19 #include "llvm/MC/MCCodeView.h"
20 #include "llvm/MC/MCContext.h"
21 #include "llvm/MC/MCDwarf.h"
22 #include "llvm/MC/MCExpr.h"
23 #include "llvm/MC/MCInst.h"
24 #include "llvm/MC/MCInstPrinter.h"
26 #include "llvm/MC/MCPseudoProbe.h"
27 #include "llvm/MC/MCRegister.h"
28 #include "llvm/MC/MCRegisterInfo.h"
29 #include "llvm/MC/MCSection.h"
30 #include "llvm/MC/MCSectionCOFF.h"
31 #include "llvm/MC/MCSymbol.h"
32 #include "llvm/MC/MCWin64EH.h"
33 #include "llvm/MC/MCWinEH.h"
34 #include "llvm/Support/Casting.h"
36 #include "llvm/Support/LEB128.h"
39 #include <cassert>
40 #include <cstdint>
41 #include <cstdlib>
42 #include <utility>
43 
44 using namespace llvm;
45 
47  S.setTargetStreamer(this);
48 }
49 
50 // Pin the vtables to this file.
52 
54 
56 
58 
61  const MCExpr *Subsection,
62  raw_ostream &OS) {
63  Section->printSwitchToSection(*Streamer.getContext().getAsmInfo(),
65  Subsection);
66 }
67 
70 }
71 
73  SmallString<128> Str;
74  raw_svector_ostream OS(Str);
75 
77  Streamer.emitRawText(OS.str());
78 }
79 
81  const MCAsmInfo *MAI = Streamer.getContext().getAsmInfo();
82  const char *Directive = MAI->getData8bitsDirective();
83  for (const unsigned char C : Data.bytes()) {
84  SmallString<128> Str;
85  raw_svector_ostream OS(Str);
86 
87  OS << Directive << (unsigned)C;
88  Streamer.emitRawText(OS.str());
89  }
90 }
91 
93 
95  : Context(Ctx), CurrentWinFrameInfo(nullptr),
96  CurrentProcWinFrameInfoStartIndex(0), UseAssemblerInfoForParsing(false) {
97  SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
98 }
99 
100 MCStreamer::~MCStreamer() = default;
101 
103  DwarfFrameInfos.clear();
104  CurrentWinFrameInfo = nullptr;
105  WinFrameInfos.clear();
106  SymbolOrdering.clear();
107  SectionStack.clear();
108  SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
109 }
110 
112  // By default, discard comments.
113  return nulls();
114 }
115 
116 unsigned MCStreamer::getNumFrameInfos() { return DwarfFrameInfos.size(); }
118  return DwarfFrameInfos;
119 }
120 
121 void MCStreamer::emitRawComment(const Twine &T, bool TabPrefix) {}
122 
125 
127  for (auto &FI : DwarfFrameInfos)
128  FI.CompactUnwindEncoding =
129  (MAB ? MAB->generateCompactUnwindEncoding(FI.Instructions) : 0);
130 }
131 
132 /// EmitIntValue - Special case of EmitValue that avoids the client having to
133 /// pass in a MCExpr for constant integers.
135  assert(1 <= Size && Size <= 8 && "Invalid size");
136  assert((isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) &&
137  "Invalid size");
138  const bool IsLittleEndian = Context.getAsmInfo()->isLittleEndian();
140  Value, IsLittleEndian ? support::little : support::big);
141  unsigned Index = IsLittleEndian ? 0 : 8 - Size;
142  emitBytes(StringRef(reinterpret_cast<char *>(&Swapped) + Index, Size));
143 }
145  if (Value.getNumWords() == 1) {
146  emitIntValue(Value.getLimitedValue(), Value.getBitWidth() / 8);
147  return;
148  }
149 
150  const bool IsLittleEndianTarget = Context.getAsmInfo()->isLittleEndian();
151  const bool ShouldSwap = sys::IsLittleEndianHost != IsLittleEndianTarget;
152  const APInt Swapped = ShouldSwap ? Value.byteSwap() : Value;
153  const unsigned Size = Value.getBitWidth() / 8;
154  SmallString<10> Tmp;
155  Tmp.resize(Size);
156  StoreIntToMemory(Swapped, reinterpret_cast<uint8_t *>(Tmp.data()), Size);
157  emitBytes(Tmp.str());
158 }
159 
160 /// EmitULEB128IntValue - Special case of EmitULEB128Value that avoids the
161 /// client having to pass in a MCExpr for constant integers.
163  SmallString<128> Tmp;
164  raw_svector_ostream OSE(Tmp);
165  encodeULEB128(Value, OSE, PadTo);
166  emitBytes(OSE.str());
167 }
168 
169 /// EmitSLEB128IntValue - Special case of EmitSLEB128Value that avoids the
170 /// client having to pass in a MCExpr for constant integers.
172  SmallString<128> Tmp;
173  raw_svector_ostream OSE(Tmp);
174  encodeSLEB128(Value, OSE);
175  emitBytes(OSE.str());
176 }
177 
178 void MCStreamer::emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc) {
179  emitValueImpl(Value, Size, Loc);
180 }
181 
182 void MCStreamer::emitSymbolValue(const MCSymbol *Sym, unsigned Size,
183  bool IsSectionRelative) {
184  assert((!IsSectionRelative || Size == 4) &&
185  "SectionRelative value requires 4-bytes");
186 
187  if (!IsSectionRelative)
189  else
190  emitCOFFSecRel32(Sym, /*Offset=*/0);
191 }
192 
194  report_fatal_error("unsupported directive in streamer");
195 }
196 
198  report_fatal_error("unsupported directive in streamer");
199 }
200 
202  report_fatal_error("unsupported directive in streamer");
203 }
204 
206  report_fatal_error("unsupported directive in streamer");
207 }
208 
210  report_fatal_error("unsupported directive in streamer");
211 }
212 
214  report_fatal_error("unsupported directive in streamer");
215 }
216 
217 /// Emit NumBytes bytes worth of the value specified by FillValue.
218 /// This implements directives such as '.space'.
219 void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) {
220  emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue);
221 }
222 
223 void llvm::MCStreamer::emitNops(int64_t NumBytes, int64_t ControlledNopLen,
224  llvm::SMLoc, const MCSubtargetInfo& STI) {}
225 
226 /// The implementation in this class just redirects to emitFill.
227 void MCStreamer::emitZeros(uint64_t NumBytes) { emitFill(NumBytes, 0); }
228 
231  StringRef Filename,
232  Optional<MD5::MD5Result> Checksum,
234  unsigned CUID) {
235  return getContext().getDwarfFile(Directory, Filename, FileNo, Checksum,
236  Source, CUID);
237 }
238 
240  StringRef Filename,
241  Optional<MD5::MD5Result> Checksum,
243  unsigned CUID) {
244  getContext().setMCLineTableRootFile(CUID, Directory, Filename, Checksum,
245  Source);
246 }
247 
249  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
250  if (!CurFrame)
251  return;
252  CurFrame->IsBKeyFrame = true;
253 }
254 
255 void MCStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line,
256  unsigned Column, unsigned Flags,
257  unsigned Isa, unsigned Discriminator,
258  StringRef FileName) {
259  getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa,
260  Discriminator);
261 }
262 
265  if (!Table.getLabel()) {
266  StringRef Prefix = Context.getAsmInfo()->getPrivateGlobalPrefix();
267  Table.setLabel(
268  Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
269  }
270  return Table.getLabel();
271 }
272 
274  return !DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End;
275 }
276 
277 MCDwarfFrameInfo *MCStreamer::getCurrentDwarfFrameInfo() {
280  "this directive must appear between "
281  ".cfi_startproc and .cfi_endproc directives");
282  return nullptr;
283  }
284  return &DwarfFrameInfos.back();
285 }
286 
287 bool MCStreamer::emitCVFileDirective(unsigned FileNo, StringRef Filename,
288  ArrayRef<uint8_t> Checksum,
289  unsigned ChecksumKind) {
290  return getContext().getCVContext().addFile(*this, FileNo, Filename, Checksum,
291  ChecksumKind);
292 }
293 
294 bool MCStreamer::emitCVFuncIdDirective(unsigned FunctionId) {
295  return getContext().getCVContext().recordFunctionId(FunctionId);
296 }
297 
299  unsigned IAFunc, unsigned IAFile,
300  unsigned IALine, unsigned IACol,
301  SMLoc Loc) {
302  if (getContext().getCVContext().getCVFunctionInfo(IAFunc) == nullptr) {
303  getContext().reportError(Loc, "parent function id not introduced by "
304  ".cv_func_id or .cv_inline_site_id");
305  return true;
306  }
307 
309  FunctionId, IAFunc, IAFile, IALine, IACol);
310 }
311 
312 void MCStreamer::emitCVLocDirective(unsigned FunctionId, unsigned FileNo,
313  unsigned Line, unsigned Column,
314  bool PrologueEnd, bool IsStmt,
315  StringRef FileName, SMLoc Loc) {}
316 
317 bool MCStreamer::checkCVLocSection(unsigned FuncId, unsigned FileNo,
318  SMLoc Loc) {
321  if (!FI) {
323  Loc, "function id not introduced by .cv_func_id or .cv_inline_site_id");
324  return false;
325  }
326 
327  // Track the section
328  if (FI->Section == nullptr)
330  else if (FI->Section != getCurrentSectionOnly()) {
332  Loc,
333  "all .cv_loc directives for a function must be in the same section");
334  return false;
335  }
336  return true;
337 }
338 
339 void MCStreamer::emitCVLinetableDirective(unsigned FunctionId,
340  const MCSymbol *Begin,
341  const MCSymbol *End) {}
342 
343 void MCStreamer::emitCVInlineLinetableDirective(unsigned PrimaryFunctionId,
344  unsigned SourceFileId,
345  unsigned SourceLineNum,
346  const MCSymbol *FnStartSym,
347  const MCSymbol *FnEndSym) {}
348 
349 /// Only call this on endian-specific types like ulittle16_t and little32_t, or
350 /// structs composed of them.
351 template <typename T>
352 static void copyBytesForDefRange(SmallString<20> &BytePrefix,
353  codeview::SymbolKind SymKind,
354  const T &DefRangeHeader) {
355  BytePrefix.resize(2 + sizeof(T));
356  codeview::ulittle16_t SymKindLE = codeview::ulittle16_t(SymKind);
357  memcpy(&BytePrefix[0], &SymKindLE, 2);
358  memcpy(&BytePrefix[2], &DefRangeHeader, sizeof(T));
359 }
360 
362  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
363  StringRef FixedSizePortion) {}
364 
366  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
368  SmallString<20> BytePrefix;
369  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER_REL, DRHdr);
370  emitCVDefRangeDirective(Ranges, BytePrefix);
371 }
372 
374  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
376  SmallString<20> BytePrefix;
377  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_SUBFIELD_REGISTER,
378  DRHdr);
379  emitCVDefRangeDirective(Ranges, BytePrefix);
380 }
381 
383  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
385  SmallString<20> BytePrefix;
386  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER, DRHdr);
387  emitCVDefRangeDirective(Ranges, BytePrefix);
388 }
389 
391  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
393  SmallString<20> BytePrefix;
394  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_FRAMEPOINTER_REL,
395  DRHdr);
396  emitCVDefRangeDirective(Ranges, BytePrefix);
397 }
398 
400  MCSymbol *EHSymbol) {
401 }
402 
403 void MCStreamer::initSections(bool NoExecStack, const MCSubtargetInfo &STI) {
404  SwitchSection(getContext().getObjectFileInfo()->getTextSection());
405 }
406 
408  assert(Fragment);
409  Symbol->setFragment(Fragment);
410 
411  // As we emit symbols into a section, track the order so that they can
412  // be sorted upon later. Zero is reserved to mean 'unemitted'.
413  SymbolOrdering[Symbol] = 1 + SymbolOrdering.size();
414 }
415 
417  Symbol->redefineIfPossible();
418 
419  if (!Symbol->isUndefined() || Symbol->isVariable())
420  return getContext().reportError(Loc, "symbol '" + Twine(Symbol->getName()) +
421  "' is already defined");
422 
423  assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
424  assert(getCurrentSectionOnly() && "Cannot emit before setting section!");
425  assert(!Symbol->getFragment() && "Unexpected fragment on symbol data!");
426  assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
427 
428  Symbol->setFragment(&getCurrentSectionOnly()->getDummyFragment());
429 
431  if (TS)
432  TS->emitLabel(Symbol);
433 }
434 
436  const MCExpr *Value) {}
437 
438 void MCStreamer::emitCFISections(bool EH, bool Debug) {}
439 
440 void MCStreamer::emitCFIStartProc(bool IsSimple, SMLoc Loc) {
442  return getContext().reportError(
443  Loc, "starting new .cfi frame before finishing the previous one");
444 
445  MCDwarfFrameInfo Frame;
446  Frame.IsSimple = IsSimple;
447  emitCFIStartProcImpl(Frame);
448 
449  const MCAsmInfo* MAI = Context.getAsmInfo();
450  if (MAI) {
451  for (const MCCFIInstruction& Inst : MAI->getInitialFrameState()) {
452  if (Inst.getOperation() == MCCFIInstruction::OpDefCfa ||
453  Inst.getOperation() == MCCFIInstruction::OpDefCfaRegister ||
454  Inst.getOperation() == MCCFIInstruction::OpLLVMDefAspaceCfa) {
455  Frame.CurrentCfaRegister = Inst.getRegister();
456  }
457  }
458  }
459 
460  DwarfFrameInfos.push_back(Frame);
461 }
462 
464 }
465 
467  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
468  if (!CurFrame)
469  return;
470  emitCFIEndProcImpl(*CurFrame);
471 }
472 
474  // Put a dummy non-null value in Frame.End to mark that this frame has been
475  // closed.
476  Frame.End = (MCSymbol *)1;
477 }
478 
480  // Return a dummy non-null value so that label fields appear filled in when
481  // generating textual assembly.
482  return (MCSymbol *)1;
483 }
484 
485 void MCStreamer::emitCFIDefCfa(int64_t Register, int64_t Offset) {
486  MCSymbol *Label = emitCFILabel();
489  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
490  if (!CurFrame)
491  return;
492  CurFrame->Instructions.push_back(Instruction);
493  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
494 }
495 
497  MCSymbol *Label = emitCFILabel();
500  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
501  if (!CurFrame)
502  return;
503  CurFrame->Instructions.push_back(Instruction);
504 }
505 
506 void MCStreamer::emitCFIAdjustCfaOffset(int64_t Adjustment) {
507  MCSymbol *Label = emitCFILabel();
509  MCCFIInstruction::createAdjustCfaOffset(Label, Adjustment);
510  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
511  if (!CurFrame)
512  return;
513  CurFrame->Instructions.push_back(Instruction);
514 }
515 
517  MCSymbol *Label = emitCFILabel();
520  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
521  if (!CurFrame)
522  return;
523  CurFrame->Instructions.push_back(Instruction);
524  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
525 }
526 
528  int64_t AddressSpace) {
529  MCSymbol *Label = emitCFILabel();
531  Label, Register, Offset, AddressSpace);
532  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
533  if (!CurFrame)
534  return;
535  CurFrame->Instructions.push_back(Instruction);
536  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
537 }
538 
539 void MCStreamer::emitCFIOffset(int64_t Register, int64_t Offset) {
540  MCSymbol *Label = emitCFILabel();
543  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
544  if (!CurFrame)
545  return;
546  CurFrame->Instructions.push_back(Instruction);
547 }
548 
550  MCSymbol *Label = emitCFILabel();
553  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
554  if (!CurFrame)
555  return;
556  CurFrame->Instructions.push_back(Instruction);
557 }
558 
560  unsigned Encoding) {
561  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
562  if (!CurFrame)
563  return;
564  CurFrame->Personality = Sym;
565  CurFrame->PersonalityEncoding = Encoding;
566 }
567 
568 void MCStreamer::emitCFILsda(const MCSymbol *Sym, unsigned Encoding) {
569  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
570  if (!CurFrame)
571  return;
572  CurFrame->Lsda = Sym;
573  CurFrame->LsdaEncoding = Encoding;
574 }
575 
577  MCSymbol *Label = emitCFILabel();
579  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
580  if (!CurFrame)
581  return;
582  CurFrame->Instructions.push_back(Instruction);
583 }
584 
586  // FIXME: Error if there is no matching cfi_remember_state.
587  MCSymbol *Label = emitCFILabel();
589  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
590  if (!CurFrame)
591  return;
592  CurFrame->Instructions.push_back(Instruction);
593 }
594 
596  MCSymbol *Label = emitCFILabel();
599  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
600  if (!CurFrame)
601  return;
602  CurFrame->Instructions.push_back(Instruction);
603 }
604 
606  MCSymbol *Label = emitCFILabel();
609  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
610  if (!CurFrame)
611  return;
612  CurFrame->Instructions.push_back(Instruction);
613 }
614 
616  MCSymbol *Label = emitCFILabel();
618  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
619  if (!CurFrame)
620  return;
621  CurFrame->Instructions.push_back(Instruction);
622 }
623 
625  MCSymbol *Label = emitCFILabel();
628  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
629  if (!CurFrame)
630  return;
631  CurFrame->Instructions.push_back(Instruction);
632 }
633 
635  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
636  if (!CurFrame)
637  return;
638  CurFrame->IsSignalFrame = true;
639 }
640 
642  MCSymbol *Label = emitCFILabel();
645  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
646  if (!CurFrame)
647  return;
648  CurFrame->Instructions.push_back(Instruction);
649 }
650 
651 void MCStreamer::emitCFIRegister(int64_t Register1, int64_t Register2) {
652  MCSymbol *Label = emitCFILabel();
654  MCCFIInstruction::createRegister(Label, Register1, Register2);
655  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
656  if (!CurFrame)
657  return;
658  CurFrame->Instructions.push_back(Instruction);
659 }
660 
662  MCSymbol *Label = emitCFILabel();
665  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
666  if (!CurFrame)
667  return;
668  CurFrame->Instructions.push_back(Instruction);
669 }
670 
672  MCSymbol *Label = emitCFILabel();
674  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
675  if (!CurFrame)
676  return;
677  CurFrame->Instructions.push_back(Instruction);
678 }
679 
681  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
682  if (!CurFrame)
683  return;
684  CurFrame->RAReg = Register;
685 }
686 
688  const MCAsmInfo *MAI = Context.getAsmInfo();
689  if (!MAI->usesWindowsCFI()) {
691  Loc, ".seh_* directives are not supported on this target");
692  return nullptr;
693  }
694  if (!CurrentWinFrameInfo || CurrentWinFrameInfo->End) {
696  Loc, ".seh_ directive must appear within an active frame");
697  return nullptr;
698  }
699  return CurrentWinFrameInfo;
700 }
701 
703  const MCAsmInfo *MAI = Context.getAsmInfo();
704  if (!MAI->usesWindowsCFI())
705  return getContext().reportError(
706  Loc, ".seh_* directives are not supported on this target");
707  if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
709  Loc, "Starting a function before ending the previous one!");
710 
711  MCSymbol *StartProc = emitCFILabel();
712 
713  CurrentProcWinFrameInfoStartIndex = WinFrameInfos.size();
714  WinFrameInfos.emplace_back(
715  std::make_unique<WinEH::FrameInfo>(Symbol, StartProc));
716  CurrentWinFrameInfo = WinFrameInfos.back().get();
717  CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
718 }
719 
721  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
722  if (!CurFrame)
723  return;
724  if (CurFrame->ChainedParent)
725  getContext().reportError(Loc, "Not all chained regions terminated!");
726 
727  MCSymbol *Label = emitCFILabel();
728  CurFrame->End = Label;
729  if (!CurFrame->FuncletOrFuncEnd)
730  CurFrame->FuncletOrFuncEnd = CurFrame->End;
731 
732  for (size_t I = CurrentProcWinFrameInfoStartIndex, E = WinFrameInfos.size();
733  I != E; ++I)
734  emitWindowsUnwindTables(WinFrameInfos[I].get());
735  SwitchSection(CurFrame->TextSection);
736 }
737 
739  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
740  if (!CurFrame)
741  return;
742  if (CurFrame->ChainedParent)
743  getContext().reportError(Loc, "Not all chained regions terminated!");
744 
745  MCSymbol *Label = emitCFILabel();
746  CurFrame->FuncletOrFuncEnd = Label;
747 }
748 
750  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
751  if (!CurFrame)
752  return;
753 
754  MCSymbol *StartProc = emitCFILabel();
755 
756  WinFrameInfos.emplace_back(std::make_unique<WinEH::FrameInfo>(
757  CurFrame->Function, StartProc, CurFrame));
758  CurrentWinFrameInfo = WinFrameInfos.back().get();
759  CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
760 }
761 
763  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
764  if (!CurFrame)
765  return;
766  if (!CurFrame->ChainedParent)
767  return getContext().reportError(
768  Loc, "End of a chained region outside a chained region!");
769 
770  MCSymbol *Label = emitCFILabel();
771 
772  CurFrame->End = Label;
773  CurrentWinFrameInfo = const_cast<WinEH::FrameInfo *>(CurFrame->ChainedParent);
774 }
775 
776 void MCStreamer::emitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except,
777  SMLoc Loc) {
778  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
779  if (!CurFrame)
780  return;
781  if (CurFrame->ChainedParent)
782  return getContext().reportError(
783  Loc, "Chained unwind areas can't have handlers!");
784  CurFrame->ExceptionHandler = Sym;
785  if (!Except && !Unwind)
786  getContext().reportError(Loc, "Don't know what kind of handler this is!");
787  if (Unwind)
788  CurFrame->HandlesUnwind = true;
789  if (Except)
790  CurFrame->HandlesExceptions = true;
791 }
792 
794  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
795  if (!CurFrame)
796  return;
797  if (CurFrame->ChainedParent)
798  getContext().reportError(Loc, "Chained unwind areas can't have handlers!");
799 }
800 
802  const MCSymbolRefExpr *To, uint64_t Count) {
803 }
804 
805 static MCSection *getWinCFISection(MCContext &Context, unsigned *NextWinCFIID,
806  MCSection *MainCFISec,
807  const MCSection *TextSec) {
808  // If this is the main .text section, use the main unwind info section.
809  if (TextSec == Context.getObjectFileInfo()->getTextSection())
810  return MainCFISec;
811 
812  const auto *TextSecCOFF = cast<MCSectionCOFF>(TextSec);
813  auto *MainCFISecCOFF = cast<MCSectionCOFF>(MainCFISec);
814  unsigned UniqueID = TextSecCOFF->getOrAssignWinCFISectionID(NextWinCFIID);
815 
816  // If this section is COMDAT, this unwind section should be COMDAT associative
817  // with its group.
818  const MCSymbol *KeySym = nullptr;
819  if (TextSecCOFF->getCharacteristics() & COFF::IMAGE_SCN_LNK_COMDAT) {
820  KeySym = TextSecCOFF->getCOMDATSymbol();
821 
822  // In a GNU environment, we can't use associative comdats. Instead, do what
823  // GCC does, which is to make plain comdat selectany section named like
824  // ".[px]data$_Z3foov".
825  if (!Context.getAsmInfo()->hasCOFFAssociativeComdats()) {
826  std::string SectionName = (MainCFISecCOFF->getName() + "$" +
827  TextSecCOFF->getName().split('$').second)
828  .str();
829  return Context.getCOFFSection(
830  SectionName,
831  MainCFISecCOFF->getCharacteristics() | COFF::IMAGE_SCN_LNK_COMDAT,
832  MainCFISecCOFF->getKind(), "", COFF::IMAGE_COMDAT_SELECT_ANY);
833  }
834  }
835 
836  return Context.getAssociativeCOFFSection(MainCFISecCOFF, KeySym, UniqueID);
837 }
838 
840  return getWinCFISection(getContext(), &NextWinCFIID,
841  getContext().getObjectFileInfo()->getPDataSection(),
842  TextSec);
843 }
844 
846  return getWinCFISection(getContext(), &NextWinCFIID,
847  getContext().getObjectFileInfo()->getXDataSection(),
848  TextSec);
849 }
850 
852 
853 static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg) {
854  return Ctx.getRegisterInfo()->getSEHRegNum(Reg);
855 }
856 
858  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
859  if (!CurFrame)
860  return;
861 
862  MCSymbol *Label = emitCFILabel();
863 
865  Label, encodeSEHRegNum(Context, Register));
866  CurFrame->Instructions.push_back(Inst);
867 }
868 
870  SMLoc Loc) {
871  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
872  if (!CurFrame)
873  return;
874  if (CurFrame->LastFrameInst >= 0)
875  return getContext().reportError(
876  Loc, "frame register and offset can be set at most once");
877  if (Offset & 0x0F)
878  return getContext().reportError(Loc, "offset is not a multiple of 16");
879  if (Offset > 240)
880  return getContext().reportError(
881  Loc, "frame offset must be less than or equal to 240");
882 
883  MCSymbol *Label = emitCFILabel();
884 
887  CurFrame->LastFrameInst = CurFrame->Instructions.size();
888  CurFrame->Instructions.push_back(Inst);
889 }
890 
892  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
893  if (!CurFrame)
894  return;
895  if (Size == 0)
896  return getContext().reportError(Loc,
897  "stack allocation size must be non-zero");
898  if (Size & 7)
899  return getContext().reportError(
900  Loc, "stack allocation size is not a multiple of 8");
901 
902  MCSymbol *Label = emitCFILabel();
903 
905  CurFrame->Instructions.push_back(Inst);
906 }
907 
909  SMLoc Loc) {
910  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
911  if (!CurFrame)
912  return;
913 
914  if (Offset & 7)
915  return getContext().reportError(
916  Loc, "register save offset is not 8 byte aligned");
917 
918  MCSymbol *Label = emitCFILabel();
919 
922  CurFrame->Instructions.push_back(Inst);
923 }
924 
926  SMLoc Loc) {
927  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
928  if (!CurFrame)
929  return;
930  if (Offset & 0x0F)
931  return getContext().reportError(Loc, "offset is not a multiple of 16");
932 
933  MCSymbol *Label = emitCFILabel();
934 
937  CurFrame->Instructions.push_back(Inst);
938 }
939 
941  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
942  if (!CurFrame)
943  return;
944  if (!CurFrame->Instructions.empty())
945  return getContext().reportError(
946  Loc, "If present, PushMachFrame must be the first UOP");
947 
948  MCSymbol *Label = emitCFILabel();
949 
951  CurFrame->Instructions.push_back(Inst);
952 }
953 
955  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
956  if (!CurFrame)
957  return;
958 
959  MCSymbol *Label = emitCFILabel();
960 
961  CurFrame->PrologEnd = Label;
962 }
963 
965 
967 
969 
971 
973 
974 /// EmitRawText - If this file is backed by an assembly streamer, this dumps
975 /// the specified string in the output .s file. This capability is
976 /// indicated by the hasRawTextSupport() predicate.
978  // This is not llvm_unreachable for the sake of out of tree backend
979  // developers who may not have assembly streamers and should serve as a
980  // reminder to not accidentally call EmitRawText in the absence of such.
981  report_fatal_error("EmitRawText called on an MCStreamer that doesn't support "
982  "it (target backend is likely missing an AsmStreamer "
983  "implementation)");
984 }
985 
987  SmallString<128> Str;
988  emitRawTextImpl(T.toStringRef(Str));
989 }
990 
992 
994 
995 void MCStreamer::Finish(SMLoc EndLoc) {
996  if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
997  (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
998  getContext().reportError(EndLoc, "Unfinished frame!");
999  return;
1000  }
1001 
1003  if (TS)
1004  TS->finish();
1005 
1006  finishImpl();
1007 }
1008 
1010  if (Context.getDwarfFormat() != dwarf::DWARF64)
1011  return;
1012  AddComment("DWARF64 Mark");
1014 }
1015 
1016 void MCStreamer::emitDwarfUnitLength(uint64_t Length, const Twine &Comment) {
1017  assert(Context.getDwarfFormat() == dwarf::DWARF64 ||
1018  Length <= dwarf::DW_LENGTH_lo_reserved);
1020  AddComment(Comment);
1021  emitIntValue(Length, dwarf::getDwarfOffsetByteSize(Context.getDwarfFormat()));
1022 }
1023 
1025  const Twine &Comment) {
1027  AddComment(Comment);
1028  MCSymbol *Lo = Context.createTempSymbol(Prefix + "_start");
1029  MCSymbol *Hi = Context.createTempSymbol(Prefix + "_end");
1030 
1032  Hi, Lo, dwarf::getDwarfOffsetByteSize(Context.getDwarfFormat()));
1033  // emit the begin symbol after we generate the length field.
1034  emitLabel(Lo);
1035  // Return the Hi symbol to the caller.
1036  return Hi;
1037 }
1038 
1040  // Set the value of the symbol, as we are at the start of the line table.
1041  emitLabel(StartSym);
1042 }
1043 
1045  visitUsedExpr(*Value);
1046  Symbol->setVariableValue(Value);
1047 
1049  if (TS)
1050  TS->emitAssignment(Symbol, Value);
1051 }
1052 
1054  uint64_t Address, const MCInst &Inst,
1055  const MCSubtargetInfo &STI,
1056  raw_ostream &OS) {
1057  InstPrinter.printInst(&Inst, Address, "", STI, OS);
1058 }
1059 
1061 }
1062 
1064  switch (Expr.getKind()) {
1065  case MCExpr::Target:
1066  cast<MCTargetExpr>(Expr).visitUsedExpr(*this);
1067  break;
1068 
1069  case MCExpr::Constant:
1070  break;
1071 
1072  case MCExpr::Binary: {
1073  const MCBinaryExpr &BE = cast<MCBinaryExpr>(Expr);
1074  visitUsedExpr(*BE.getLHS());
1075  visitUsedExpr(*BE.getRHS());
1076  break;
1077  }
1078 
1079  case MCExpr::SymbolRef:
1080  visitUsedSymbol(cast<MCSymbolRefExpr>(Expr).getSymbol());
1081  break;
1082 
1083  case MCExpr::Unary:
1084  visitUsedExpr(*cast<MCUnaryExpr>(Expr).getSubExpr());
1085  break;
1086  }
1087 }
1088 
1090  // Scan for values.
1091  for (unsigned i = Inst.getNumOperands(); i--;)
1092  if (Inst.getOperand(i).isExpr())
1093  visitUsedExpr(*Inst.getOperand(i).getExpr());
1094 }
1095 
1097  uint64_t Attr,
1098  const MCPseudoProbeInlineStack &InlineStack) {
1099  auto &Context = getContext();
1100 
1101  // Create a symbol at in the current section for use in the probe.
1102  MCSymbol *ProbeSym = Context.createTempSymbol();
1103 
1104  // Set the value of the symbol to use for the MCPseudoProbe.
1105  emitLabel(ProbeSym);
1106 
1107  // Create a (local) probe entry with the symbol.
1108  MCPseudoProbe Probe(ProbeSym, Guid, Index, Type, Attr);
1109 
1110  // Add the probe entry to this section's entries.
1111  Context.getMCPseudoProbeTable().getProbeSections().addPseudoProbe(
1112  getCurrentSectionOnly(), Probe, InlineStack);
1113 }
1114 
1116  unsigned Size) {
1117  // Get the Hi-Lo expression.
1118  const MCExpr *Diff =
1121 
1122  const MCAsmInfo *MAI = Context.getAsmInfo();
1123  if (!MAI->doesSetDirectiveSuppressReloc()) {
1124  emitValue(Diff, Size);
1125  return;
1126  }
1127 
1128  // Otherwise, emit with .set (aka assignment).
1129  MCSymbol *SetLabel = Context.createTempSymbol("set");
1130  emitAssignment(SetLabel, Diff);
1131  emitSymbolValue(SetLabel, Size);
1132 }
1133 
1135  const MCSymbol *Lo) {
1136  // Get the Hi-Lo expression.
1137  const MCExpr *Diff =
1140 
1141  emitULEB128Value(Diff);
1142 }
1143 
1146 void MCStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
1148  llvm_unreachable("this directive only supported on COFF targets");
1149 }
1151  llvm_unreachable("this directive only supported on COFF targets");
1152 }
1154 void MCStreamer::emitFileDirective(StringRef Filename, StringRef CompilerVerion,
1155  StringRef TimeStamp, StringRef Description) {
1156 }
1158  llvm_unreachable("this directive only supported on COFF targets");
1159 }
1161  llvm_unreachable("this directive only supported on COFF targets");
1162 }
1164  MCSymbol *CsectSym,
1165  unsigned ByteAlign) {
1166  llvm_unreachable("this directive only supported on XCOFF targets");
1167 }
1168 
1171  MCSymbolAttr Visibility) {
1172  llvm_unreachable("emitXCOFFSymbolLinkageWithVisibility is only supported on "
1173  "XCOFF targets");
1174 }
1175 
1177  StringRef Rename) {
1178  llvm_unreachable("emitXCOFFRenameDirective is only supported on "
1179  "XCOFF targets");
1180 }
1181 
1183  llvm_unreachable("emitXCOFFRefDirective is only supported on XCOFF targets");
1184 }
1185 
1188  StringRef Name, bool KeepOriginalSym) {}
1190  unsigned ByteAlignment) {}
1192  uint64_t Size, unsigned ByteAlignment) {}
1197 void MCStreamer::emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
1198  visitUsedExpr(*Value);
1199 }
1202 void MCStreamer::emitFill(const MCExpr &NumBytes, uint64_t Value, SMLoc Loc) {}
1203 void MCStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
1204  SMLoc Loc) {}
1206  unsigned ValueSize,
1207  unsigned MaxBytesToEmit) {}
1209  const MCSubtargetInfo *STI,
1210  unsigned MaxBytesToEmit) {}
1212  SMLoc Loc) {}
1213 void MCStreamer::emitBundleAlignMode(unsigned AlignPow2) {}
1214 void MCStreamer::emitBundleLock(bool AlignToEnd) {}
1217 
1219  assert(Section && "Cannot switch to a null section!");
1220  MCSectionSubPair curSection = SectionStack.back().first;
1221  SectionStack.back().second = curSection;
1222  if (MCSectionSubPair(Section, Subsection) != curSection) {
1223  changeSection(Section, Subsection);
1224  SectionStack.back().first = MCSectionSubPair(Section, Subsection);
1225  assert(!Section->hasEnded() && "Section already ended");
1226  MCSymbol *Sym = Section->getBeginSymbol();
1227  if (Sym && !Sym->isInSection())
1228  emitLabel(Sym);
1229  }
1230 }
1231 
1233  // TODO: keep track of the last subsection so that this symbol appears in the
1234  // correct place.
1235  MCSymbol *Sym = Section->getEndSymbol(Context);
1236  if (Sym->isInSection())
1237  return Sym;
1238 
1240  emitLabel(Sym);
1241  return Sym;
1242 }
1243 
1244 static VersionTuple
1246  VersionTuple TargetVersion) {
1247  VersionTuple Min = Target.getMinimumSupportedOSVersion();
1248  return !Min.empty() && Min > TargetVersion ? Min : TargetVersion;
1249 }
1250 
1251 static MCVersionMinType
1253  assert(Target.isOSDarwin() && "expected a darwin OS");
1254  switch (Target.getOS()) {
1255  case Triple::MacOSX:
1256  case Triple::Darwin:
1257  return MCVM_OSXVersionMin;
1258  case Triple::IOS:
1259  assert(!Target.isMacCatalystEnvironment() &&
1260  "mac Catalyst should use LC_BUILD_VERSION");
1261  return MCVM_IOSVersionMin;
1262  case Triple::TvOS:
1263  return MCVM_TvOSVersionMin;
1264  case Triple::WatchOS:
1265  return MCVM_WatchOSVersionMin;
1266  default:
1267  break;
1268  }
1269  llvm_unreachable("unexpected OS type");
1270 }
1271 
1273  assert(Target.isOSDarwin() && "expected a darwin OS");
1274  switch (Target.getOS()) {
1275  case Triple::MacOSX:
1276  case Triple::Darwin:
1277  return VersionTuple(10, 14);
1278  case Triple::IOS:
1279  // Mac Catalyst always uses the build version load command.
1280  if (Target.isMacCatalystEnvironment())
1281  return VersionTuple();
1283  case Triple::TvOS:
1284  return VersionTuple(12);
1285  case Triple::WatchOS:
1286  return VersionTuple(5);
1287  case Triple::DriverKit:
1288  // DriverKit always uses the build version load command.
1289  return VersionTuple();
1290  default:
1291  break;
1292  }
1293  llvm_unreachable("unexpected OS type");
1294 }
1295 
1296 static MachO::PlatformType
1298  assert(Target.isOSDarwin() && "expected a darwin OS");
1299  switch (Target.getOS()) {
1300  case Triple::MacOSX:
1301  case Triple::Darwin:
1302  return MachO::PLATFORM_MACOS;
1303  case Triple::IOS:
1304  if (Target.isMacCatalystEnvironment())
1306  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_IOSSIMULATOR
1308  case Triple::TvOS:
1309  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_TVOSSIMULATOR
1311  case Triple::WatchOS:
1312  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_WATCHOSSIMULATOR
1314  case Triple::DriverKit:
1316  default:
1317  break;
1318  }
1319  llvm_unreachable("unexpected OS type");
1320 }
1321 
1323  const Triple &Target, const VersionTuple &SDKVersion,
1324  const Triple *DarwinTargetVariantTriple,
1325  const VersionTuple &DarwinTargetVariantSDKVersion) {
1326  if (!Target.isOSBinFormatMachO() || !Target.isOSDarwin())
1327  return;
1328  // Do we even know the version?
1329  if (Target.getOSMajorVersion() == 0)
1330  return;
1331 
1333  switch (Target.getOS()) {
1334  case Triple::MacOSX:
1335  case Triple::Darwin:
1336  Target.getMacOSXVersion(Version);
1337  break;
1338  case Triple::IOS:
1339  case Triple::TvOS:
1340  Version = Target.getiOSVersion();
1341  break;
1342  case Triple::WatchOS:
1343  Version = Target.getWatchOSVersion();
1344  break;
1345  case Triple::DriverKit:
1346  Version = Target.getDriverKitVersion();
1347  break;
1348  default:
1349  llvm_unreachable("unexpected OS type");
1350  }
1351  assert(Version.getMajor() != 0 && "A non-zero major version is expected");
1352  auto LinkedTargetVersion =
1354  auto BuildVersionOSVersion = getMachoBuildVersionSupportedOS(Target);
1355  bool ShouldEmitBuildVersion = false;
1356  if (BuildVersionOSVersion.empty() ||
1357  LinkedTargetVersion >= BuildVersionOSVersion) {
1358  if (Target.isMacCatalystEnvironment() && DarwinTargetVariantTriple &&
1359  DarwinTargetVariantTriple->isMacOSX()) {
1360  emitVersionForTarget(*DarwinTargetVariantTriple,
1361  DarwinTargetVariantSDKVersion,
1362  /*DarwinTargetVariantTriple=*/nullptr,
1363  /*DarwinTargetVariantSDKVersion=*/VersionTuple());
1366  LinkedTargetVersion.getMajor(),
1367  LinkedTargetVersion.getMinor().getValueOr(0),
1368  LinkedTargetVersion.getSubminor().getValueOr(0), SDKVersion);
1369  return;
1370  }
1372  LinkedTargetVersion.getMajor(),
1373  LinkedTargetVersion.getMinor().getValueOr(0),
1374  LinkedTargetVersion.getSubminor().getValueOr(0),
1375  SDKVersion);
1376  ShouldEmitBuildVersion = true;
1377  }
1378 
1379  if (const Triple *TVT = DarwinTargetVariantTriple) {
1380  if (Target.isMacOSX() && TVT->isMacCatalystEnvironment()) {
1381  auto TVLinkedTargetVersion =
1382  targetVersionOrMinimumSupportedOSVersion(*TVT, TVT->getiOSVersion());
1385  TVLinkedTargetVersion.getMajor(),
1386  TVLinkedTargetVersion.getMinor().getValueOr(0),
1387  TVLinkedTargetVersion.getSubminor().getValueOr(0),
1388  DarwinTargetVariantSDKVersion);
1389  }
1390  }
1391 
1392  if (ShouldEmitBuildVersion)
1393  return;
1394 
1396  LinkedTargetVersion.getMajor(),
1397  LinkedTargetVersion.getMinor().getValueOr(0),
1398  LinkedTargetVersion.getSubminor().getValueOr(0), SDKVersion);
1399 }
llvm::Check::Size
@ Size
Definition: FileCheck.h:77
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:343
i
i
Definition: README.txt:29
llvm::MCDwarfFrameInfo::End
MCSymbol * End
Definition: MCDwarf.h:679
llvm::Win64EH::Instruction::PushMachFrame
static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code)
Definition: MCWin64EH.h:33
llvm::MCStreamer::emitCVFuncIdDirective
virtual bool emitCVFuncIdDirective(unsigned FunctionId)
Introduces a function id for use with .cv_loc.
Definition: MCStreamer.cpp:294
llvm::MCVersionMinType
MCVersionMinType
Definition: MCDirectives.h:67
llvm::MCStreamer::emitCFIDefCfaOffset
virtual void emitCFIDefCfaOffset(int64_t Offset)
Definition: MCStreamer.cpp:496
llvm::MCStreamer::getAssociatedXDataSection
MCSection * getAssociatedXDataSection(const MCSection *TextSec)
Get the .xdata section used for the given section.
Definition: MCStreamer.cpp:845
llvm::MachO::PLATFORM_MACOS
@ PLATFORM_MACOS
Definition: MachO.h:494
llvm::MCStreamer::visitUsedExpr
void visitUsedExpr(const MCExpr &Expr)
Definition: MCStreamer.cpp:1063
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:59
MCDwarf.h
MathExtras.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MachO::PLATFORM_WATCHOSSIMULATOR
@ PLATFORM_WATCHOSSIMULATOR
Definition: MachO.h:502
llvm::WinEH::FrameInfo::FuncletOrFuncEnd
const MCSymbol * FuncletOrFuncEnd
Definition: MCWinEH.h:42
llvm::MCTargetStreamer::emitLabel
virtual void emitLabel(MCSymbol *Symbol)
Definition: MCStreamer.cpp:53
llvm::MCStreamer::emitCFILLVMDefAspaceCfa
virtual void emitCFILLVMDefAspaceCfa(int64_t Register, int64_t Offset, int64_t AddressSpace)
Definition: MCStreamer.cpp:527
llvm::MCStreamer::emitWinCFISetFrame
virtual void emitWinCFISetFrame(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:869
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:726
Optional.h
llvm::MCCFIInstruction::OpDefCfaRegister
@ OpDefCfaRegister
Definition: MCDwarf.h:480
llvm::MCStreamer::EndCOFFSymbolDef
virtual void EndCOFFSymbolDef()
Marks the end of the symbol definition.
Definition: MCStreamer.cpp:1150
llvm::MCVM_WatchOSVersionMin
@ MCVM_WatchOSVersionMin
.watchos_version_min
Definition: MCDirectives.h:71
llvm::MCStreamer::emitCFIOffset
virtual void emitCFIOffset(int64_t Register, int64_t Offset)
Definition: MCStreamer.cpp:539
llvm::MCContext::getCVContext
CodeViewContext & getCVContext()
Definition: MCContext.cpp:950
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:1134
llvm::MCDwarfFrameInfo::Lsda
const MCSymbol * Lsda
Definition: MCDwarf.h:681
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:160
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:352
llvm::MCTargetStreamer::emitRawBytes
virtual void emitRawBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:80
T
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:74
llvm::MCContext::getRegisterInfo
const MCRegisterInfo * getRegisterInfo() const
Definition: MCContext.h:441
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:205
llvm::MCStreamer::emitELFSize
virtual void emitELFSize(MCSymbol *Symbol, const MCExpr *Value)
Emit an ELF .size directive.
Definition: MCStreamer.cpp:1186
StringRef.h
llvm::Triple::Darwin
@ Darwin
Definition: Triple.h:186
llvm::codeview::SymbolKind
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
llvm::MCStreamer::emitCFISections
virtual void emitCFISections(bool EH, bool Debug)
Definition: MCStreamer.cpp:438
SymbolRecord.h
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:140
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::MCStreamer::emitWinCFIAllocStack
virtual void emitWinCFIAllocStack(unsigned Size, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:891
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:1185
llvm::tgtok::Code
@ Code
Definition: TGLexer.h:50
llvm::MCStreamer::emitCOFFSymbolStorageClass
virtual void emitCOFFSymbolStorageClass(int StorageClass)
Emit the storage class of the symbol.
Definition: MCStreamer.cpp:1157
llvm::MCStreamer::emitCFIStartProc
void emitCFIStartProc(bool IsSimple, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:440
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:47
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
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:491
llvm::WinEH::FrameInfo::TextSection
MCSection * TextSection
Definition: MCWinEH.h:47
llvm::MCTargetStreamer::finish
virtual void finish()
Definition: MCStreamer.cpp:55
llvm::MCVM_IOSVersionMin
@ MCVM_IOSVersionMin
.ios_version_min
Definition: MCDirectives.h:68
llvm::MCStreamer::Finish
void Finish(SMLoc EndLoc=SMLoc())
Finish emission of machine code.
Definition: MCStreamer.cpp:995
llvm::MCStreamer::emitCFIRegister
virtual void emitCFIRegister(int64_t Register1, int64_t Register2)
Definition: MCStreamer.cpp:651
llvm::Triple::IOS
@ IOS
Definition: Triple.h:190
llvm::MCStreamer::emitWinCFISaveReg
virtual void emitWinCFISaveReg(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:908
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::MachO::PLATFORM_IOS
@ PLATFORM_IOS
Definition: MachO.h:495
llvm::MCStreamer::emitCOFFSymbolType
virtual void emitCOFFSymbolType(int Type)
Emit the type of the symbol.
Definition: MCStreamer.cpp:1160
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:1169
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:339
llvm::MCStreamer::emitValue
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:178
llvm::MCPseudoProbe
Instances of this class represent a pseudo probe instance for a pseudo probe table entry,...
Definition: MCPseudoProbe.h:146
llvm::dwarf::DW_LENGTH_DWARF64
@ DW_LENGTH_DWARF64
Indicator of 64-bit DWARF format.
Definition: Dwarf.h:57
getWinCFISection
static MCSection * getWinCFISection(MCContext &Context, unsigned *NextWinCFIID, MCSection *MainCFISec, const MCSection *TextSec)
Definition: MCStreamer.cpp:805
MCObjectFileInfo.h
llvm::MachO::PLATFORM_MACCATALYST
@ PLATFORM_MACCATALYST
Definition: MachO.h:499
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:1197
getMachoBuildVersionSupportedOS
static VersionTuple getMachoBuildVersionSupportedOS(const Triple &Target)
Definition: MCStreamer.cpp:1272
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:572
llvm::MCStreamer::emitWinEHHandler
virtual void emitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:776
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:634
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:1176
llvm::MCStreamer::emitCFILabel
virtual MCSymbol * emitCFILabel()
When emitting an object file, create and emit a real label.
Definition: MCStreamer.cpp:479
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:1096
llvm::MCStreamer::emitInt32
void emitInt32(uint64_t Value)
Definition: MCStreamer.h:727
MCPseudoProbe.h
llvm::MCVM_OSXVersionMin
@ MCVM_OSXVersionMin
.macosx_version_min
Definition: MCDirectives.h:69
llvm::Optional
Definition: APInt.h:33
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:79
llvm::MCTargetStreamer::MCTargetStreamer
MCTargetStreamer(MCStreamer &S)
Definition: MCStreamer.cpp:46
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:312
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:197
llvm::MCStreamer::emitWindowsUnwindTables
virtual void emitWindowsUnwindTables()
Definition: MCStreamer.cpp:991
llvm::MCDwarfFrameInfo::RAReg
unsigned RAReg
Definition: MCDwarf.h:689
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::MCAssemblerFlag
MCAssemblerFlag
Definition: MCDirectives.h:51
llvm::MCBinaryExpr
Binary assembler expressions.
Definition: MCExpr.h:481
llvm::nulls
raw_ostream & nulls()
This returns a reference to a raw_ostream which simply discards output.
Definition: raw_ostream.cpp:900
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:609
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:55
llvm::MCStreamer::emitDarwinTargetVariantBuildVersion
virtual void emitDarwinTargetVariantBuildVersion(unsigned Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion)
Definition: MCStreamer.h:501
llvm::Triple::WatchOS
@ WatchOS
Definition: Triple.h:212
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:555
llvm::MCStreamer::emitDwarfUnitLength
virtual void emitDwarfUnitLength(uint64_t Length, const Twine &Comment)
Emit a unit length field.
Definition: MCStreamer.cpp:1016
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:920
llvm::MCStreamer::emitCFIDefCfaRegister
virtual void emitCFIDefCfaRegister(int64_t Register)
Definition: MCStreamer.cpp:516
llvm::MCCFIInstruction::cfiDefCfaOffset
static MCCFIInstruction cfiDefCfaOffset(MCSymbol *L, int Offset)
.cfi_def_cfa_offset modifies a rule for computing CFA.
Definition: MCDwarf.h:540
llvm::MCStreamer::emitCFIAdjustCfaOffset
virtual void emitCFIAdjustCfaOffset(int64_t Adjustment)
Definition: MCStreamer.cpp:506
llvm::MCSymbolAttr
MCSymbolAttr
Definition: MCDirectives.h:18
llvm::MCStreamer::MCStreamer
MCStreamer(MCContext &Ctx)
Definition: MCStreamer.cpp:94
llvm::MCStreamer::emitCFIPersonality
virtual void emitCFIPersonality(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:559
llvm::MCStreamer::changeSection
virtual void changeSection(MCSection *, const MCExpr *)
Update streamer for a new active section.
Definition: MCStreamer.cpp:1193
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:687
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:193
llvm::MachO::PLATFORM_IOSSIMULATOR
@ PLATFORM_IOSSIMULATOR
Definition: MachO.h:500
llvm::MCStreamer::emitBundleLock
virtual void emitBundleLock(bool AlignToEnd)
The following instructions are a bundle-locked group.
Definition: MCStreamer.cpp:1214
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:82
llvm::MCCFIInstruction::OpDefCfa
@ OpDefCfa
Definition: MCDwarf.h:482
llvm::MCStreamer::emitCFIEndProcImpl
virtual void emitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame)
Definition: MCStreamer.cpp:473
llvm::Triple::isMacOSX
bool isMacOSX() const
Is this a Mac OS X triple.
Definition: Triple.h:475
llvm::CodeViewContext::getCVFunctionInfo
MCCVFunctionInfo * getCVFunctionInfo(unsigned FuncId)
Retreive the function info if this is a valid function id, or nullptr.
Definition: MCCodeView.cpp:79
llvm::MCFragment
Definition: MCFragment.h:30
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:201
llvm::MCStreamer::emitULEB128Value
virtual void emitULEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:1200
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:209
llvm::MCStreamer::emitCFIUndefined
virtual void emitCFIUndefined(int64_t Register)
Definition: MCStreamer.cpp:641
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:42
llvm::MCDwarfFrameInfo::CurrentCfaRegister
unsigned CurrentCfaRegister
Definition: MCDwarf.h:683
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:549
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:595
SmallString.h
llvm::MCStreamer::emitVersionForTarget
void emitVersionForTarget(const Triple &Target, const VersionTuple &SDKVersion, const Triple *DarwinTargetVariantTriple, const VersionTuple &DarwinTargetVariantSDKVersion)
Definition: MCStreamer.cpp:1322
llvm::Triple::TvOS
@ TvOS
Definition: Triple.h:211
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:839
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::emitCFIStartProcImpl
virtual void emitCFIStartProcImpl(MCDwarfFrameInfo &Frame)
Definition: MCStreamer.cpp:463
llvm::MCStreamer::emitWinCFISaveXMM
virtual void emitWinCFISaveXMM(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:925
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::MCDwarfFrameInfo::Personality
const MCSymbol * Personality
Definition: MCDwarf.h:680
MCContext.h
llvm::CodeViewContext
Holds state from .cv_file and .cv_loc directives for later emission.
Definition: MCCodeView.h:144
llvm::MCStreamer::emitLabel
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Definition: MCStreamer.cpp:416
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:182
llvm::MCStreamer::emitWinCFIEndChained
virtual void emitWinCFIEndChained(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:762
MCInst.h
llvm::MCBinaryExpr::getRHS
const MCExpr * getRHS() const
Get the right-hand side expression of the binary operator.
Definition: MCExpr.h:631
false
Definition: StackSlotColoring.cpp:141
llvm::WinEH::FrameInfo::LastFrameInst
int LastFrameInst
Definition: MCWinEH.h:54
llvm::MCStreamer::emitWinEHHandlerData
virtual void emitWinEHHandlerData(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:793
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:497
llvm::MCStreamer::emitAssemblerFlag
virtual void emitAssemblerFlag(MCAssemblerFlag Flag)
Note in the output the specified Flag.
Definition: MCStreamer.cpp:1144
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:273
llvm::MCDwarfLineTable
Definition: MCDwarf.h:341
llvm::MCStreamer::finishImpl
virtual void finishImpl()
Streamer specific finalization.
Definition: MCStreamer.cpp:1215
llvm::MCTargetStreamer::emitConstantPools
virtual void emitConstantPools()
Definition: MCStreamer.cpp:57
llvm::Instruction
Definition: Instruction.h:42
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:147
llvm::MCStreamer::emitAssignment
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Definition: MCStreamer.cpp:1044
llvm::dwarf::DW_LENGTH_lo_reserved
@ DW_LENGTH_lo_reserved
Special values for an initial length field.
Definition: Dwarf.h:56
llvm::MCCFIInstruction::createRestoreState
static MCCFIInstruction createRestoreState(MCSymbol *L)
.cfi_restore_state Restore the previously saved state.
Definition: MCDwarf.h:619
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:143
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:121
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:287
getMachoBuildVersionPlatformType
static MachO::PlatformType getMachoBuildVersionPlatformType(const Triple &Target)
Definition: MCStreamer.cpp:1297
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::MachO::PlatformType
PlatformType
Definition: MachO.h:492
llvm::Triple::DriverKit
@ DriverKit
Definition: Triple.h:213
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:619
llvm::MCStreamer::maybeEmitDwarf64Mark
void maybeEmitDwarf64Mark()
Emit a special value of 0xffffffff if producing 64-bit debugging info.
Definition: MCStreamer.cpp:1009
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:31
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:93
llvm::MCStreamer::emitXCOFFRefDirective
virtual void emitXCOFFRefDirective(StringRef Sym)
Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more sy...
Definition: MCStreamer.cpp:1182
llvm::MCTargetStreamer::~MCTargetStreamer
virtual ~MCTargetStreamer()
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:213
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:201
llvm::MCStreamer::visitUsedSymbol
virtual void visitUsedSymbol(const MCSymbol &Sym)
Definition: MCStreamer.cpp:1060
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:625
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
Register
Promote Memory to Register
Definition: Mem2Reg.cpp:110
llvm::MCStreamer::getCurrentSectionOnly
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:378
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::MCStreamer::emitCOFFSafeSEH
virtual void emitCOFFSafeSEH(MCSymbol const *Symbol)
Definition: MCStreamer.cpp:964
llvm::MCTargetStreamer::emitAssignment
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Definition: MCStreamer.cpp:92
llvm::MCDwarfLineTable::getLabel
MCSymbol * getLabel() const
Definition: MCDwarf.h:390
llvm::MCContext::getTargetTriple
const Triple & getTargetTriple() const
Definition: MCContext.h:427
llvm::MCVM_TvOSVersionMin
@ MCVM_TvOSVersionMin
.tvos_version_min
Definition: MCDirectives.h:70
MCInstPrinter.h
llvm::MCCFIInstruction
Definition: MCDwarf.h:472
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:298
llvm::MCAsmInfo::getData8bitsDirective
const char * getData8bitsDirective() const
Definition: MCAsmInfo.h:566
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:533
llvm::SmallString< 128 >
llvm::WinEH::FrameInfo::Function
const MCSymbol * Function
Definition: MCWinEH.h:44
llvm::MCStreamer::emitNops
virtual void emitNops(int64_t NumBytes, int64_t ControlledNopLength, SMLoc Loc, const MCSubtargetInfo &STI)
Definition: MCStreamer.cpp:223
llvm::MCStreamer::emitBinaryData
virtual void emitBinaryData(StringRef Data)
Functionally identical to EmitBytes.
Definition: MCStreamer.cpp:1196
llvm::MCStreamer::emitCGProfileEntry
virtual void emitCGProfileEntry(const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count)
Definition: MCStreamer.cpp:801
llvm::MCStreamer::emitSymbolDesc
virtual void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue)
Set the DescValue for the Symbol.
Definition: MCStreamer.cpp:1146
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:239
llvm::MCStreamer::endSection
MCSymbol * endSection(MCSection *Section)
Definition: MCStreamer.cpp:1232
llvm::MCStreamer::emitCOFFSymbolIndex
virtual void emitCOFFSymbolIndex(MCSymbol const *Symbol)
Emits the symbol table index of a Symbol into the current section.
Definition: MCStreamer.cpp:966
llvm::codeview::DefRangeSubfieldRegisterHeader
Definition: SymbolRecord.h:501
llvm::XCOFF::StorageClass
StorageClass
Definition: XCOFF.h:154
llvm::Triple::MacOSX
@ MacOSX
Definition: Triple.h:194
llvm::MCStreamer::emitFileDirective
virtual void emitFileDirective(StringRef Filename)
Switch to a new logical file.
Definition: MCStreamer.cpp:1153
llvm::MCAsmBackend::generateCompactUnwindEncoding
virtual uint32_t generateCompactUnwindEncoding(ArrayRef< MCCFIInstruction >) const
Generate the compact unwind encoding for the CFI instructions.
Definition: MCAsmBackend.h:215
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:1211
llvm::MCStreamer::emitConditionalAssignment
virtual void emitConditionalAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol, but only if Value is also emitted.
Definition: MCStreamer.cpp:435
llvm::MCStreamer::emitEHSymAttributes
virtual void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol)
Definition: MCStreamer.cpp:399
llvm::DenseMapBase::clear
void clear()
Definition: DenseMap.h:112
Index
uint32_t Index
Definition: ELFObjHandler.cpp:82
llvm::MCStreamer::addExplicitComment
virtual void addExplicitComment(const Twine &T)
Add explicit comment T.
Definition: MCStreamer.cpp:123
uint64_t
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:3025
llvm::MCContext::getMCDwarfLineTable
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
Definition: MCContext.h:714
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:439
llvm::MCTargetStreamer::Streamer
MCStreamer & Streamer
Definition: MCStreamer.h:95
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:631
llvm::WinEH::FrameInfo::PrologEnd
const MCSymbol * PrologEnd
Definition: MCWinEH.h:45
llvm::MCStreamer::emitCFIBKeyFrame
virtual void emitCFIBKeyFrame()
Definition: MCStreamer.cpp:248
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:986
llvm::MCStreamer::emitSyntaxDirective
virtual void emitSyntaxDirective()
Definition: MCStreamer.cpp:851
LEB128.h
llvm::MCDwarfLineTable::setLabel
void setLabel(MCSymbol *Label)
Definition: MCDwarf.h:394
llvm::MCCFIInstruction::createNegateRAState
static MCCFIInstruction createNegateRAState(MCSymbol *L)
.cfi_negate_ra_state AArch64 negate RA state.
Definition: MCDwarf.h:590
llvm::MCStreamer::emitInstruction
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Definition: MCStreamer.cpp:1089
I
#define I(x, y, z)
Definition: MD5.cpp:58
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:755
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:4579
llvm::MCStreamer::getStartTokLoc
SMLoc getStartTokLoc() const
Definition: MCStreamer.h:274
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:98
llvm::MCStreamer::emitCFIEscape
virtual void emitCFIEscape(StringRef Values)
Definition: MCStreamer.cpp:615
getMachoVersionMinLoadCommandType
static MCVersionMinType getMachoVersionMinLoadCommandType(const Triple &Target)
Definition: MCStreamer.cpp:1252
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:134
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:605
llvm::MCBinaryExpr::createSub
static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
Definition: MCExpr.h:610
llvm::COFF::IMAGE_SCN_LNK_COMDAT
@ IMAGE_SCN_LNK_COMDAT
Definition: COFF.h:293
llvm::MCContext::reportError
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:1005
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:1191
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:526
llvm::MCStreamer::GetCommentOS
virtual raw_ostream & GetCommentOS()
Return a raw_ostream that comments can be written to.
Definition: MCStreamer.cpp:111
llvm::MCStreamer::emitCOFFSecRel32
virtual void emitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset)
Emits a COFF section relative relocation.
Definition: MCStreamer.cpp:970
llvm::MCSymbolRefExpr
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:192
llvm::MCStreamer::getNumFrameInfos
unsigned getNumFrameInfos()
Definition: MCStreamer.cpp:116
MCSection.h
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:75
llvm::codeview::DefRangeRegisterRelHeader
Definition: SymbolRecord.h:551
llvm::Sched::Source
@ Source
Definition: TargetLowering.h:99
llvm::MCStreamer::initSections
virtual void initSections(bool NoExecStack, const MCSubtargetInfo &STI)
Create the default sections and set the initial one.
Definition: MCStreamer.cpp:403
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
MCAsmInfo.h
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:687
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::Win64EH::Instruction::PushNonVol
static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg)
Definition: MCWin64EH.h:26
llvm::MCStreamer::emitWinCFIEndProlog
virtual void emitWinCFIEndProlog(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:954
llvm::MCStreamer::emitWinCFIStartChained
virtual void emitWinCFIStartChained(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:749
llvm::MCCFIInstruction::OpLLVMDefAspaceCfa
@ OpLLVMDefAspaceCfa
Definition: MCDwarf.h:479
llvm::MCStreamer::getDwarfFrameInfos
ArrayRef< MCDwarfFrameInfo > getDwarfFrameInfos() const
Definition: MCStreamer.cpp:117
llvm::MCStreamer::emitBundleAlignMode
virtual void emitBundleAlignMode(unsigned AlignPow2)
Set the bundle alignment mode from now on in the section.
Definition: MCStreamer.cpp:1213
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:738
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
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:547
llvm::MCStreamer::emitCFIGnuArgsSize
virtual void emitCFIGnuArgsSize(int64_t Size)
Definition: MCStreamer.cpp:624
llvm::MCStreamer::emitWeakReference
virtual void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol)
Emit an weak reference from Alias to Symbol.
Definition: MCStreamer.cpp:1194
llvm::MCAsmInfo::getInitialFrameState
const std::vector< MCCFIInstruction > & getInitialFrameState() const
Definition: MCAsmInfo.h:827
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:738
llvm::MCStreamer::emitWinCFIPushFrame
virtual void emitWinCFIPushFrame(bool Code, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:940
LLVM_FALLTHROUGH
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition: Compiler.h:280
llvm::MachO::PLATFORM_TVOS
@ PLATFORM_TVOS
Definition: MachO.h:496
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:485
llvm::MCDwarfFrameInfo::IsBKeyFrame
bool IsBKeyFrame
Definition: MCDwarf.h:690
llvm::MCDwarfFrameInfo::PersonalityEncoding
unsigned PersonalityEncoding
Definition: MCDwarf.h:684
llvm::MCStreamer::emitDwarfLineStartLabel
virtual void emitDwarfLineStartLabel(MCSymbol *StartSym)
Emit the debug line start label.
Definition: MCStreamer.cpp:1039
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:87
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
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:118
llvm::MCStreamer::emitELFSymverDirective
virtual void emitELFSymverDirective(const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym)
Emit an ELF .symver directive.
Definition: MCStreamer.cpp:1187
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:171
llvm::MachO::PLATFORM_TVOSSIMULATOR
@ PLATFORM_TVOSSIMULATOR
Definition: MachO.h:501
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:407
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:361
llvm::MCStreamer::emitCFIWindowSave
virtual void emitCFIWindowSave()
Definition: MCStreamer.cpp:661
llvm::MCStreamer::emitCFILsda
virtual void emitCFILsda(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:568
llvm::MCStreamer::emitAbsoluteSymbolDiff
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
Definition: MCStreamer.cpp:1115
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:124
llvm::DenseMapBase::size
unsigned size() const
Definition: DenseMap.h:101
llvm::MCDwarfFrameInfo::IsSignalFrame
bool IsSignalFrame
Definition: MCDwarf.h:687
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
encodeSEHRegNum
static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg)
Definition: MCStreamer.cpp:853
llvm::MCStreamer::emitSLEB128Value
virtual void emitSLEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:1201
llvm::MCStreamer::emitBundleUnlock
virtual void emitBundleUnlock()
Ends a bundle-locked group.
Definition: MCStreamer.cpp:1216
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
llvm::SmallVectorImpl::clear
void clear()
Definition: SmallVector.h:591
llvm::MCStreamer::emitCFIRememberState
virtual void emitCFIRememberState()
Definition: MCStreamer.cpp:576
llvm::MCStreamer::emitWinCFIEndProc
virtual void emitWinCFIEndProc(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:720
llvm::SmallString::str
StringRef str() const
Explicit conversion to StringRef.
Definition: SmallString.h:260
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:497
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:1147
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:317
llvm::WinEH::FrameInfo
Definition: MCWinEH.h:39
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
llvm::MCStreamer::emitCFIEndProc
void emitCFIEndProc()
Definition: MCStreamer.cpp:466
llvm::MCStreamer::~MCStreamer
virtual ~MCStreamer()
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:162
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition: MCStreamer.h:282
llvm::MCDwarfFrameInfo::Instructions
std::vector< MCCFIInstruction > Instructions
Definition: MCDwarf.h:682
llvm::MCStreamer::emitCodeAlignment
virtual void emitCodeAlignment(unsigned ByteAlignment, const MCSubtargetInfo *STI, unsigned MaxBytesToEmit=0)
Emit nops until the byte alignment ByteAlignment is reached.
Definition: MCStreamer.cpp:1208
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:579
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:1163
Version
uint64_t Version
Definition: RawMemProfReader.cpp:41
llvm::MCStreamer::emitFill
void emitFill(uint64_t NumBytes, uint8_t FillValue)
Emit NumBytes bytes worth of the value specified by FillValue.
Definition: MCStreamer.cpp:219
llvm::MCDwarfFrameInfo::LsdaEncoding
unsigned LsdaEncoding
Definition: MCDwarf.h:685
llvm::MCStreamer::getTargetStreamer
MCTargetStreamer * getTargetStreamer()
Definition: MCStreamer.h:289
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:603
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:100
targetVersionOrMinimumSupportedOSVersion
static VersionTuple targetVersionOrMinimumSupportedOSVersion(const Triple &Target, VersionTuple TargetVersion)
Definition: MCStreamer.cpp:1245
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::MachO::PLATFORM_DRIVERKIT
@ PLATFORM_DRIVERKIT
Definition: MachO.h:503
llvm::MCStreamer::emitCFIReturnColumn
virtual void emitCFIReturnColumn(int64_t Register)
Definition: MCStreamer.cpp:680
llvm::MCSectionSubPair
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:66
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:255
llvm::MCExpr::Constant
@ Constant
Constant expressions.
Definition: MCExpr.h:39
llvm::MCStreamer::emitCOFFSectionIndex
virtual void emitCOFFSectionIndex(MCSymbol const *Symbol)
Emits a COFF section index.
Definition: MCStreamer.cpp:968
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:662
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:1205
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:72
llvm::MCStreamer::emitBytes
virtual void emitBytes(StringRef Data)
Emit the bytes in Data into the output.
Definition: MCStreamer.cpp:1195
llvm::VersionTuple::empty
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero).
Definition: VersionTuple.h:67
llvm::MCDwarfFrameInfo::IsSimple
bool IsSimple
Definition: MCDwarf.h:688
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:564
llvm::MCTargetStreamer::prettyPrintAsm
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, uint64_t Address, const MCInst &Inst, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition: MCStreamer.cpp:1053
llvm::MCCFIInstruction::createRememberState
static MCCFIInstruction createRememberState(MCSymbol *L)
.cfi_remember_state Save all current rules for all registers.
Definition: MCDwarf.h:614
llvm::dwarf::DWARF64
@ DWARF64
Definition: Dwarf.h:93
llvm::WinEH::FrameInfo::Instructions
std::vector< Instruction > Instructions
Definition: MCWinEH.h:56
MachO.h
llvm::MCTargetStreamer::emitDwarfFileDirective
virtual void emitDwarfFileDirective(StringRef Directive)
Definition: MCStreamer.cpp:68
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:977
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:420
llvm::pdb::String
@ String
Definition: PDBTypes.h:408
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:640
llvm::MCStreamer::generateCompactUnwindEncodings
void generateCompactUnwindEncodings(MCAsmBackend *MAB)
Definition: MCStreamer.cpp:126
llvm::MCStreamer::getDwarfLineTableSymbol
virtual MCSymbol * getDwarfLineTableSymbol(unsigned CUID)
Definition: MCStreamer.cpp:263
llvm::MCAsmInfo::usesWindowsCFI
bool usesWindowsCFI() const
Definition: MCAsmInfo.h:793
llvm::MCStreamer::emitWinCFIPushReg
virtual void emitWinCFIPushReg(MCRegister Register, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:857
llvm::MCStreamer::emitCFIRestoreState
virtual void emitCFIRestoreState()
Definition: MCStreamer.cpp:585
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:1218
llvm::MCDwarfFrameInfo
Definition: MCDwarf.h:675
MCExpr.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76
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:1145
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
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::emitCOFFImgRel32
virtual void emitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset)
Emits a COFF image relative relocation.
Definition: MCStreamer.cpp:972
llvm::MCCFIInstruction::createWindowSave
static MCCFIInstruction createWindowSave(MCSymbol *L)
.cfi_window_save SPARC register window is saved.
Definition: MCDwarf.h:585
llvm::MCStreamer::reset
virtual void reset()
State management.
Definition: MCStreamer.cpp:102
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:230
llvm::MCStreamer::emitWinCFIStartProc
virtual void emitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:702
llvm::MCStreamer::AddComment
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
Definition: MCStreamer.h:344
llvm::COFF::IMAGE_COMDAT_SELECT_ANY
@ IMAGE_COMDAT_SELECT_ANY
Definition: COFF.h:407
llvm::MCStreamer::emitCFINegateRAState
virtual void emitCFINegateRAState()
Definition: MCStreamer.cpp:671
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:1189
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:24
MCWin64EH.h
llvm::MCBinaryExpr::getLHS
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
Definition: MCExpr.h:628
llvm::MCStreamer::emitZeros
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
Definition: MCStreamer.cpp:227
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:597