LLVM  16.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 
256  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
257  if (!CurFrame)
258  return;
259  CurFrame->IsMTETaggedFrame = true;
260 }
261 
262 void MCStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line,
263  unsigned Column, unsigned Flags,
264  unsigned Isa, unsigned Discriminator,
265  StringRef FileName) {
266  getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa,
267  Discriminator);
268 }
269 
272  if (!Table.getLabel()) {
273  StringRef Prefix = Context.getAsmInfo()->getPrivateGlobalPrefix();
274  Table.setLabel(
275  Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
276  }
277  return Table.getLabel();
278 }
279 
281  return !DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End;
282 }
283 
284 MCDwarfFrameInfo *MCStreamer::getCurrentDwarfFrameInfo() {
287  "this directive must appear between "
288  ".cfi_startproc and .cfi_endproc directives");
289  return nullptr;
290  }
291  return &DwarfFrameInfos.back();
292 }
293 
294 bool MCStreamer::emitCVFileDirective(unsigned FileNo, StringRef Filename,
295  ArrayRef<uint8_t> Checksum,
296  unsigned ChecksumKind) {
297  return getContext().getCVContext().addFile(*this, FileNo, Filename, Checksum,
298  ChecksumKind);
299 }
300 
301 bool MCStreamer::emitCVFuncIdDirective(unsigned FunctionId) {
302  return getContext().getCVContext().recordFunctionId(FunctionId);
303 }
304 
306  unsigned IAFunc, unsigned IAFile,
307  unsigned IALine, unsigned IACol,
308  SMLoc Loc) {
309  if (getContext().getCVContext().getCVFunctionInfo(IAFunc) == nullptr) {
310  getContext().reportError(Loc, "parent function id not introduced by "
311  ".cv_func_id or .cv_inline_site_id");
312  return true;
313  }
314 
316  FunctionId, IAFunc, IAFile, IALine, IACol);
317 }
318 
319 void MCStreamer::emitCVLocDirective(unsigned FunctionId, unsigned FileNo,
320  unsigned Line, unsigned Column,
321  bool PrologueEnd, bool IsStmt,
322  StringRef FileName, SMLoc Loc) {}
323 
324 bool MCStreamer::checkCVLocSection(unsigned FuncId, unsigned FileNo,
325  SMLoc Loc) {
328  if (!FI) {
330  Loc, "function id not introduced by .cv_func_id or .cv_inline_site_id");
331  return false;
332  }
333 
334  // Track the section
335  if (FI->Section == nullptr)
337  else if (FI->Section != getCurrentSectionOnly()) {
339  Loc,
340  "all .cv_loc directives for a function must be in the same section");
341  return false;
342  }
343  return true;
344 }
345 
346 void MCStreamer::emitCVLinetableDirective(unsigned FunctionId,
347  const MCSymbol *Begin,
348  const MCSymbol *End) {}
349 
350 void MCStreamer::emitCVInlineLinetableDirective(unsigned PrimaryFunctionId,
351  unsigned SourceFileId,
352  unsigned SourceLineNum,
353  const MCSymbol *FnStartSym,
354  const MCSymbol *FnEndSym) {}
355 
356 /// Only call this on endian-specific types like ulittle16_t and little32_t, or
357 /// structs composed of them.
358 template <typename T>
359 static void copyBytesForDefRange(SmallString<20> &BytePrefix,
360  codeview::SymbolKind SymKind,
361  const T &DefRangeHeader) {
362  BytePrefix.resize(2 + sizeof(T));
363  codeview::ulittle16_t SymKindLE = codeview::ulittle16_t(SymKind);
364  memcpy(&BytePrefix[0], &SymKindLE, 2);
365  memcpy(&BytePrefix[2], &DefRangeHeader, sizeof(T));
366 }
367 
369  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
370  StringRef FixedSizePortion) {}
371 
373  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
375  SmallString<20> BytePrefix;
376  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER_REL, DRHdr);
377  emitCVDefRangeDirective(Ranges, BytePrefix);
378 }
379 
381  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
383  SmallString<20> BytePrefix;
384  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_SUBFIELD_REGISTER,
385  DRHdr);
386  emitCVDefRangeDirective(Ranges, BytePrefix);
387 }
388 
390  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
392  SmallString<20> BytePrefix;
393  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_REGISTER, DRHdr);
394  emitCVDefRangeDirective(Ranges, BytePrefix);
395 }
396 
398  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
400  SmallString<20> BytePrefix;
401  copyBytesForDefRange(BytePrefix, codeview::S_DEFRANGE_FRAMEPOINTER_REL,
402  DRHdr);
403  emitCVDefRangeDirective(Ranges, BytePrefix);
404 }
405 
407  MCSymbol *EHSymbol) {
408 }
409 
410 void MCStreamer::initSections(bool NoExecStack, const MCSubtargetInfo &STI) {
411  switchSection(getContext().getObjectFileInfo()->getTextSection());
412 }
413 
415  assert(Fragment);
416  Symbol->setFragment(Fragment);
417 
418  // As we emit symbols into a section, track the order so that they can
419  // be sorted upon later. Zero is reserved to mean 'unemitted'.
420  SymbolOrdering[Symbol] = 1 + SymbolOrdering.size();
421 }
422 
424  Symbol->redefineIfPossible();
425 
426  if (!Symbol->isUndefined() || Symbol->isVariable())
427  return getContext().reportError(Loc, "symbol '" + Twine(Symbol->getName()) +
428  "' is already defined");
429 
430  assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
431  assert(getCurrentSectionOnly() && "Cannot emit before setting section!");
432  assert(!Symbol->getFragment() && "Unexpected fragment on symbol data!");
433  assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
434 
435  Symbol->setFragment(&getCurrentSectionOnly()->getDummyFragment());
436 
438  if (TS)
439  TS->emitLabel(Symbol);
440 }
441 
443  const MCExpr *Value) {}
444 
445 void MCStreamer::emitCFISections(bool EH, bool Debug) {}
446 
447 void MCStreamer::emitCFIStartProc(bool IsSimple, SMLoc Loc) {
449  return getContext().reportError(
450  Loc, "starting new .cfi frame before finishing the previous one");
451 
452  MCDwarfFrameInfo Frame;
453  Frame.IsSimple = IsSimple;
454  emitCFIStartProcImpl(Frame);
455 
456  const MCAsmInfo* MAI = Context.getAsmInfo();
457  if (MAI) {
458  for (const MCCFIInstruction& Inst : MAI->getInitialFrameState()) {
459  if (Inst.getOperation() == MCCFIInstruction::OpDefCfa ||
460  Inst.getOperation() == MCCFIInstruction::OpDefCfaRegister ||
461  Inst.getOperation() == MCCFIInstruction::OpLLVMDefAspaceCfa) {
462  Frame.CurrentCfaRegister = Inst.getRegister();
463  }
464  }
465  }
466 
467  DwarfFrameInfos.push_back(Frame);
468 }
469 
471 }
472 
474  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
475  if (!CurFrame)
476  return;
477  emitCFIEndProcImpl(*CurFrame);
478 }
479 
481  // Put a dummy non-null value in Frame.End to mark that this frame has been
482  // closed.
483  Frame.End = (MCSymbol *)1;
484 }
485 
487  // Return a dummy non-null value so that label fields appear filled in when
488  // generating textual assembly.
489  return (MCSymbol *)1;
490 }
491 
492 void MCStreamer::emitCFIDefCfa(int64_t Register, int64_t Offset) {
493  MCSymbol *Label = emitCFILabel();
496  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
497  if (!CurFrame)
498  return;
499  CurFrame->Instructions.push_back(Instruction);
500  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
501 }
502 
504  MCSymbol *Label = emitCFILabel();
507  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
508  if (!CurFrame)
509  return;
510  CurFrame->Instructions.push_back(Instruction);
511 }
512 
513 void MCStreamer::emitCFIAdjustCfaOffset(int64_t Adjustment) {
514  MCSymbol *Label = emitCFILabel();
516  MCCFIInstruction::createAdjustCfaOffset(Label, Adjustment);
517  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
518  if (!CurFrame)
519  return;
520  CurFrame->Instructions.push_back(Instruction);
521 }
522 
524  MCSymbol *Label = emitCFILabel();
527  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
528  if (!CurFrame)
529  return;
530  CurFrame->Instructions.push_back(Instruction);
531  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
532 }
533 
535  int64_t AddressSpace) {
536  MCSymbol *Label = emitCFILabel();
538  Label, Register, Offset, AddressSpace);
539  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
540  if (!CurFrame)
541  return;
542  CurFrame->Instructions.push_back(Instruction);
543  CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
544 }
545 
546 void MCStreamer::emitCFIOffset(int64_t Register, int64_t Offset) {
547  MCSymbol *Label = emitCFILabel();
550  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
551  if (!CurFrame)
552  return;
553  CurFrame->Instructions.push_back(Instruction);
554 }
555 
557  MCSymbol *Label = emitCFILabel();
560  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
561  if (!CurFrame)
562  return;
563  CurFrame->Instructions.push_back(Instruction);
564 }
565 
567  unsigned Encoding) {
568  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
569  if (!CurFrame)
570  return;
571  CurFrame->Personality = Sym;
572  CurFrame->PersonalityEncoding = Encoding;
573 }
574 
575 void MCStreamer::emitCFILsda(const MCSymbol *Sym, unsigned Encoding) {
576  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
577  if (!CurFrame)
578  return;
579  CurFrame->Lsda = Sym;
580  CurFrame->LsdaEncoding = Encoding;
581 }
582 
584  MCSymbol *Label = emitCFILabel();
586  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
587  if (!CurFrame)
588  return;
589  CurFrame->Instructions.push_back(Instruction);
590 }
591 
593  // FIXME: Error if there is no matching cfi_remember_state.
594  MCSymbol *Label = emitCFILabel();
596  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
597  if (!CurFrame)
598  return;
599  CurFrame->Instructions.push_back(Instruction);
600 }
601 
603  MCSymbol *Label = emitCFILabel();
606  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
607  if (!CurFrame)
608  return;
609  CurFrame->Instructions.push_back(Instruction);
610 }
611 
613  MCSymbol *Label = emitCFILabel();
616  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
617  if (!CurFrame)
618  return;
619  CurFrame->Instructions.push_back(Instruction);
620 }
621 
623  MCSymbol *Label = emitCFILabel();
625  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
626  if (!CurFrame)
627  return;
628  CurFrame->Instructions.push_back(Instruction);
629 }
630 
632  MCSymbol *Label = emitCFILabel();
635  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
636  if (!CurFrame)
637  return;
638  CurFrame->Instructions.push_back(Instruction);
639 }
640 
642  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
643  if (!CurFrame)
644  return;
645  CurFrame->IsSignalFrame = true;
646 }
647 
649  MCSymbol *Label = emitCFILabel();
652  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
653  if (!CurFrame)
654  return;
655  CurFrame->Instructions.push_back(Instruction);
656 }
657 
658 void MCStreamer::emitCFIRegister(int64_t Register1, int64_t Register2) {
659  MCSymbol *Label = emitCFILabel();
661  MCCFIInstruction::createRegister(Label, Register1, Register2);
662  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
663  if (!CurFrame)
664  return;
665  CurFrame->Instructions.push_back(Instruction);
666 }
667 
669  MCSymbol *Label = emitCFILabel();
672  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
673  if (!CurFrame)
674  return;
675  CurFrame->Instructions.push_back(Instruction);
676 }
677 
679  MCSymbol *Label = emitCFILabel();
681  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
682  if (!CurFrame)
683  return;
684  CurFrame->Instructions.push_back(Instruction);
685 }
686 
688  MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
689  if (!CurFrame)
690  return;
691  CurFrame->RAReg = Register;
692 }
693 
695  const MCAsmInfo *MAI = Context.getAsmInfo();
696  if (!MAI->usesWindowsCFI()) {
698  Loc, ".seh_* directives are not supported on this target");
699  return nullptr;
700  }
701  if (!CurrentWinFrameInfo || CurrentWinFrameInfo->End) {
703  Loc, ".seh_ directive must appear within an active frame");
704  return nullptr;
705  }
706  return CurrentWinFrameInfo;
707 }
708 
710  const MCAsmInfo *MAI = Context.getAsmInfo();
711  if (!MAI->usesWindowsCFI())
712  return getContext().reportError(
713  Loc, ".seh_* directives are not supported on this target");
714  if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
716  Loc, "Starting a function before ending the previous one!");
717 
718  MCSymbol *StartProc = emitCFILabel();
719 
720  CurrentProcWinFrameInfoStartIndex = WinFrameInfos.size();
721  WinFrameInfos.emplace_back(
722  std::make_unique<WinEH::FrameInfo>(Symbol, StartProc));
723  CurrentWinFrameInfo = WinFrameInfos.back().get();
724  CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
725 }
726 
728  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
729  if (!CurFrame)
730  return;
731  if (CurFrame->ChainedParent)
732  getContext().reportError(Loc, "Not all chained regions terminated!");
733 
734  MCSymbol *Label = emitCFILabel();
735  CurFrame->End = Label;
736  if (!CurFrame->FuncletOrFuncEnd)
737  CurFrame->FuncletOrFuncEnd = CurFrame->End;
738 
739  for (size_t I = CurrentProcWinFrameInfoStartIndex, E = WinFrameInfos.size();
740  I != E; ++I)
741  emitWindowsUnwindTables(WinFrameInfos[I].get());
742  switchSection(CurFrame->TextSection);
743 }
744 
746  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
747  if (!CurFrame)
748  return;
749  if (CurFrame->ChainedParent)
750  getContext().reportError(Loc, "Not all chained regions terminated!");
751 
752  MCSymbol *Label = emitCFILabel();
753  CurFrame->FuncletOrFuncEnd = Label;
754 }
755 
757  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
758  if (!CurFrame)
759  return;
760 
761  MCSymbol *StartProc = emitCFILabel();
762 
763  WinFrameInfos.emplace_back(std::make_unique<WinEH::FrameInfo>(
764  CurFrame->Function, StartProc, CurFrame));
765  CurrentWinFrameInfo = WinFrameInfos.back().get();
766  CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
767 }
768 
770  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
771  if (!CurFrame)
772  return;
773  if (!CurFrame->ChainedParent)
774  return getContext().reportError(
775  Loc, "End of a chained region outside a chained region!");
776 
777  MCSymbol *Label = emitCFILabel();
778 
779  CurFrame->End = Label;
780  CurrentWinFrameInfo = const_cast<WinEH::FrameInfo *>(CurFrame->ChainedParent);
781 }
782 
783 void MCStreamer::emitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except,
784  SMLoc Loc) {
785  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
786  if (!CurFrame)
787  return;
788  if (CurFrame->ChainedParent)
789  return getContext().reportError(
790  Loc, "Chained unwind areas can't have handlers!");
791  CurFrame->ExceptionHandler = Sym;
792  if (!Except && !Unwind)
793  getContext().reportError(Loc, "Don't know what kind of handler this is!");
794  if (Unwind)
795  CurFrame->HandlesUnwind = true;
796  if (Except)
797  CurFrame->HandlesExceptions = true;
798 }
799 
801  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
802  if (!CurFrame)
803  return;
804  if (CurFrame->ChainedParent)
805  getContext().reportError(Loc, "Chained unwind areas can't have handlers!");
806 }
807 
809  const MCSymbolRefExpr *To, uint64_t Count) {
810 }
811 
812 static MCSection *getWinCFISection(MCContext &Context, unsigned *NextWinCFIID,
813  MCSection *MainCFISec,
814  const MCSection *TextSec) {
815  // If this is the main .text section, use the main unwind info section.
816  if (TextSec == Context.getObjectFileInfo()->getTextSection())
817  return MainCFISec;
818 
819  const auto *TextSecCOFF = cast<MCSectionCOFF>(TextSec);
820  auto *MainCFISecCOFF = cast<MCSectionCOFF>(MainCFISec);
821  unsigned UniqueID = TextSecCOFF->getOrAssignWinCFISectionID(NextWinCFIID);
822 
823  // If this section is COMDAT, this unwind section should be COMDAT associative
824  // with its group.
825  const MCSymbol *KeySym = nullptr;
826  if (TextSecCOFF->getCharacteristics() & COFF::IMAGE_SCN_LNK_COMDAT) {
827  KeySym = TextSecCOFF->getCOMDATSymbol();
828 
829  // In a GNU environment, we can't use associative comdats. Instead, do what
830  // GCC does, which is to make plain comdat selectany section named like
831  // ".[px]data$_Z3foov".
832  if (!Context.getAsmInfo()->hasCOFFAssociativeComdats()) {
833  std::string SectionName = (MainCFISecCOFF->getName() + "$" +
834  TextSecCOFF->getName().split('$').second)
835  .str();
836  return Context.getCOFFSection(
837  SectionName,
838  MainCFISecCOFF->getCharacteristics() | COFF::IMAGE_SCN_LNK_COMDAT,
839  MainCFISecCOFF->getKind(), "", COFF::IMAGE_COMDAT_SELECT_ANY);
840  }
841  }
842 
843  return Context.getAssociativeCOFFSection(MainCFISecCOFF, KeySym, UniqueID);
844 }
845 
847  return getWinCFISection(getContext(), &NextWinCFIID,
848  getContext().getObjectFileInfo()->getPDataSection(),
849  TextSec);
850 }
851 
853  return getWinCFISection(getContext(), &NextWinCFIID,
854  getContext().getObjectFileInfo()->getXDataSection(),
855  TextSec);
856 }
857 
859 
860 static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg) {
861  return Ctx.getRegisterInfo()->getSEHRegNum(Reg);
862 }
863 
865  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
866  if (!CurFrame)
867  return;
868 
869  MCSymbol *Label = emitCFILabel();
870 
872  Label, encodeSEHRegNum(Context, Register));
873  CurFrame->Instructions.push_back(Inst);
874 }
875 
877  SMLoc Loc) {
878  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
879  if (!CurFrame)
880  return;
881  if (CurFrame->LastFrameInst >= 0)
882  return getContext().reportError(
883  Loc, "frame register and offset can be set at most once");
884  if (Offset & 0x0F)
885  return getContext().reportError(Loc, "offset is not a multiple of 16");
886  if (Offset > 240)
887  return getContext().reportError(
888  Loc, "frame offset must be less than or equal to 240");
889 
890  MCSymbol *Label = emitCFILabel();
891 
894  CurFrame->LastFrameInst = CurFrame->Instructions.size();
895  CurFrame->Instructions.push_back(Inst);
896 }
897 
899  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
900  if (!CurFrame)
901  return;
902  if (Size == 0)
903  return getContext().reportError(Loc,
904  "stack allocation size must be non-zero");
905  if (Size & 7)
906  return getContext().reportError(
907  Loc, "stack allocation size is not a multiple of 8");
908 
909  MCSymbol *Label = emitCFILabel();
910 
912  CurFrame->Instructions.push_back(Inst);
913 }
914 
916  SMLoc Loc) {
917  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
918  if (!CurFrame)
919  return;
920 
921  if (Offset & 7)
922  return getContext().reportError(
923  Loc, "register save offset is not 8 byte aligned");
924 
925  MCSymbol *Label = emitCFILabel();
926 
929  CurFrame->Instructions.push_back(Inst);
930 }
931 
933  SMLoc Loc) {
934  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
935  if (!CurFrame)
936  return;
937  if (Offset & 0x0F)
938  return getContext().reportError(Loc, "offset is not a multiple of 16");
939 
940  MCSymbol *Label = emitCFILabel();
941 
944  CurFrame->Instructions.push_back(Inst);
945 }
946 
948  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
949  if (!CurFrame)
950  return;
951  if (!CurFrame->Instructions.empty())
952  return getContext().reportError(
953  Loc, "If present, PushMachFrame must be the first UOP");
954 
955  MCSymbol *Label = emitCFILabel();
956 
958  CurFrame->Instructions.push_back(Inst);
959 }
960 
962  WinEH::FrameInfo *CurFrame = EnsureValidWinFrameInfo(Loc);
963  if (!CurFrame)
964  return;
965 
966  MCSymbol *Label = emitCFILabel();
967 
968  CurFrame->PrologEnd = Label;
969 }
970 
972 
974 
976 
978 
980 
981 /// EmitRawText - If this file is backed by an assembly streamer, this dumps
982 /// the specified string in the output .s file. This capability is
983 /// indicated by the hasRawTextSupport() predicate.
985  // This is not llvm_unreachable for the sake of out of tree backend
986  // developers who may not have assembly streamers and should serve as a
987  // reminder to not accidentally call EmitRawText in the absence of such.
988  report_fatal_error("EmitRawText called on an MCStreamer that doesn't support "
989  "it (target backend is likely missing an AsmStreamer "
990  "implementation)");
991 }
992 
994  SmallString<128> Str;
995  emitRawTextImpl(T.toStringRef(Str));
996 }
997 
999 
1001 
1003  if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
1004  (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
1005  getContext().reportError(EndLoc, "Unfinished frame!");
1006  return;
1007  }
1008 
1010  if (TS)
1011  TS->finish();
1012 
1013  finishImpl();
1014 }
1015 
1017  if (Context.getDwarfFormat() != dwarf::DWARF64)
1018  return;
1019  AddComment("DWARF64 Mark");
1021 }
1022 
1023 void MCStreamer::emitDwarfUnitLength(uint64_t Length, const Twine &Comment) {
1024  assert(Context.getDwarfFormat() == dwarf::DWARF64 ||
1025  Length <= dwarf::DW_LENGTH_lo_reserved);
1027  AddComment(Comment);
1028  emitIntValue(Length, dwarf::getDwarfOffsetByteSize(Context.getDwarfFormat()));
1029 }
1030 
1032  const Twine &Comment) {
1034  AddComment(Comment);
1035  MCSymbol *Lo = Context.createTempSymbol(Prefix + "_start");
1036  MCSymbol *Hi = Context.createTempSymbol(Prefix + "_end");
1037 
1039  Hi, Lo, dwarf::getDwarfOffsetByteSize(Context.getDwarfFormat()));
1040  // emit the begin symbol after we generate the length field.
1041  emitLabel(Lo);
1042  // Return the Hi symbol to the caller.
1043  return Hi;
1044 }
1045 
1047  // Set the value of the symbol, as we are at the start of the line table.
1048  emitLabel(StartSym);
1049 }
1050 
1052  visitUsedExpr(*Value);
1053  Symbol->setVariableValue(Value);
1054 
1056  if (TS)
1057  TS->emitAssignment(Symbol, Value);
1058 }
1059 
1061  uint64_t Address, const MCInst &Inst,
1062  const MCSubtargetInfo &STI,
1063  raw_ostream &OS) {
1064  InstPrinter.printInst(&Inst, Address, "", STI, OS);
1065 }
1066 
1068 }
1069 
1071  switch (Expr.getKind()) {
1072  case MCExpr::Target:
1073  cast<MCTargetExpr>(Expr).visitUsedExpr(*this);
1074  break;
1075 
1076  case MCExpr::Constant:
1077  break;
1078 
1079  case MCExpr::Binary: {
1080  const MCBinaryExpr &BE = cast<MCBinaryExpr>(Expr);
1081  visitUsedExpr(*BE.getLHS());
1082  visitUsedExpr(*BE.getRHS());
1083  break;
1084  }
1085 
1086  case MCExpr::SymbolRef:
1087  visitUsedSymbol(cast<MCSymbolRefExpr>(Expr).getSymbol());
1088  break;
1089 
1090  case MCExpr::Unary:
1091  visitUsedExpr(*cast<MCUnaryExpr>(Expr).getSubExpr());
1092  break;
1093  }
1094 }
1095 
1097  // Scan for values.
1098  for (unsigned i = Inst.getNumOperands(); i--;)
1099  if (Inst.getOperand(i).isExpr())
1100  visitUsedExpr(*Inst.getOperand(i).getExpr());
1101 }
1102 
1104  uint64_t Attr,
1105  const MCPseudoProbeInlineStack &InlineStack) {
1106  auto &Context = getContext();
1107 
1108  // Create a symbol at in the current section for use in the probe.
1109  MCSymbol *ProbeSym = Context.createTempSymbol();
1110 
1111  // Set the value of the symbol to use for the MCPseudoProbe.
1112  emitLabel(ProbeSym);
1113 
1114  // Create a (local) probe entry with the symbol.
1115  MCPseudoProbe Probe(ProbeSym, Guid, Index, Type, Attr);
1116 
1117  // Add the probe entry to this section's entries.
1118  Context.getMCPseudoProbeTable().getProbeSections().addPseudoProbe(
1119  getCurrentSectionOnly(), Probe, InlineStack);
1120 }
1121 
1123  unsigned Size) {
1124  // Get the Hi-Lo expression.
1125  const MCExpr *Diff =
1128 
1129  const MCAsmInfo *MAI = Context.getAsmInfo();
1130  if (!MAI->doesSetDirectiveSuppressReloc()) {
1131  emitValue(Diff, Size);
1132  return;
1133  }
1134 
1135  // Otherwise, emit with .set (aka assignment).
1136  MCSymbol *SetLabel = Context.createTempSymbol("set");
1137  emitAssignment(SetLabel, Diff);
1138  emitSymbolValue(SetLabel, Size);
1139 }
1140 
1142  const MCSymbol *Lo) {
1143  // Get the Hi-Lo expression.
1144  const MCExpr *Diff =
1147 
1148  emitULEB128Value(Diff);
1149 }
1150 
1153 void MCStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
1155  llvm_unreachable("this directive only supported on COFF targets");
1156 }
1158  llvm_unreachable("this directive only supported on COFF targets");
1159 }
1161 void MCStreamer::emitFileDirective(StringRef Filename, StringRef CompilerVerion,
1162  StringRef TimeStamp, StringRef Description) {
1163 }
1165  llvm_unreachable("this directive only supported on COFF targets");
1166 }
1168  llvm_unreachable("this directive only supported on COFF targets");
1169 }
1171  MCSymbol *CsectSym,
1172  unsigned ByteAlign) {
1173  llvm_unreachable("this directive only supported on XCOFF targets");
1174 }
1175 
1178  MCSymbolAttr Visibility) {
1179  llvm_unreachable("emitXCOFFSymbolLinkageWithVisibility is only supported on "
1180  "XCOFF targets");
1181 }
1182 
1184  StringRef Rename) {
1185  llvm_unreachable("emitXCOFFRenameDirective is only supported on "
1186  "XCOFF targets");
1187 }
1188 
1190  llvm_unreachable("emitXCOFFRefDirective is only supported on XCOFF targets");
1191 }
1192 
1195  StringRef Name, bool KeepOriginalSym) {}
1197  unsigned ByteAlignment) {}
1199  uint64_t Size, unsigned ByteAlignment) {}
1204 void MCStreamer::emitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
1205  visitUsedExpr(*Value);
1206 }
1209 void MCStreamer::emitFill(const MCExpr &NumBytes, uint64_t Value, SMLoc Loc) {}
1210 void MCStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
1211  SMLoc Loc) {}
1213  unsigned ValueSize,
1214  unsigned MaxBytesToEmit) {}
1216  const MCSubtargetInfo *STI,
1217  unsigned MaxBytesToEmit) {}
1219  SMLoc Loc) {}
1220 void MCStreamer::emitBundleAlignMode(unsigned AlignPow2) {}
1221 void MCStreamer::emitBundleLock(bool AlignToEnd) {}
1224 
1226  assert(Section && "Cannot switch to a null section!");
1227  MCSectionSubPair curSection = SectionStack.back().first;
1228  SectionStack.back().second = curSection;
1229  if (MCSectionSubPair(Section, Subsection) != curSection) {
1230  changeSection(Section, Subsection);
1231  SectionStack.back().first = MCSectionSubPair(Section, Subsection);
1232  assert(!Section->hasEnded() && "Section already ended");
1233  MCSymbol *Sym = Section->getBeginSymbol();
1234  if (Sym && !Sym->isInSection())
1235  emitLabel(Sym);
1236  }
1237 }
1238 
1240  // TODO: keep track of the last subsection so that this symbol appears in the
1241  // correct place.
1242  MCSymbol *Sym = Section->getEndSymbol(Context);
1243  if (Sym->isInSection())
1244  return Sym;
1245 
1247  emitLabel(Sym);
1248  return Sym;
1249 }
1250 
1251 static VersionTuple
1253  VersionTuple TargetVersion) {
1254  VersionTuple Min = Target.getMinimumSupportedOSVersion();
1255  return !Min.empty() && Min > TargetVersion ? Min : TargetVersion;
1256 }
1257 
1258 static MCVersionMinType
1260  assert(Target.isOSDarwin() && "expected a darwin OS");
1261  switch (Target.getOS()) {
1262  case Triple::MacOSX:
1263  case Triple::Darwin:
1264  return MCVM_OSXVersionMin;
1265  case Triple::IOS:
1266  assert(!Target.isMacCatalystEnvironment() &&
1267  "mac Catalyst should use LC_BUILD_VERSION");
1268  return MCVM_IOSVersionMin;
1269  case Triple::TvOS:
1270  return MCVM_TvOSVersionMin;
1271  case Triple::WatchOS:
1272  return MCVM_WatchOSVersionMin;
1273  default:
1274  break;
1275  }
1276  llvm_unreachable("unexpected OS type");
1277 }
1278 
1280  assert(Target.isOSDarwin() && "expected a darwin OS");
1281  switch (Target.getOS()) {
1282  case Triple::MacOSX:
1283  case Triple::Darwin:
1284  return VersionTuple(10, 14);
1285  case Triple::IOS:
1286  // Mac Catalyst always uses the build version load command.
1287  if (Target.isMacCatalystEnvironment())
1288  return VersionTuple();
1289  [[fallthrough]];
1290  case Triple::TvOS:
1291  return VersionTuple(12);
1292  case Triple::WatchOS:
1293  return VersionTuple(5);
1294  case Triple::DriverKit:
1295  // DriverKit always uses the build version load command.
1296  return VersionTuple();
1297  default:
1298  break;
1299  }
1300  llvm_unreachable("unexpected OS type");
1301 }
1302 
1303 static MachO::PlatformType
1305  assert(Target.isOSDarwin() && "expected a darwin OS");
1306  switch (Target.getOS()) {
1307  case Triple::MacOSX:
1308  case Triple::Darwin:
1309  return MachO::PLATFORM_MACOS;
1310  case Triple::IOS:
1311  if (Target.isMacCatalystEnvironment())
1313  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_IOSSIMULATOR
1315  case Triple::TvOS:
1316  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_TVOSSIMULATOR
1318  case Triple::WatchOS:
1319  return Target.isSimulatorEnvironment() ? MachO::PLATFORM_WATCHOSSIMULATOR
1321  case Triple::DriverKit:
1323  default:
1324  break;
1325  }
1326  llvm_unreachable("unexpected OS type");
1327 }
1328 
1330  const Triple &Target, const VersionTuple &SDKVersion,
1331  const Triple *DarwinTargetVariantTriple,
1332  const VersionTuple &DarwinTargetVariantSDKVersion) {
1333  if (!Target.isOSBinFormatMachO() || !Target.isOSDarwin())
1334  return;
1335  // Do we even know the version?
1336  if (Target.getOSMajorVersion() == 0)
1337  return;
1338 
1340  switch (Target.getOS()) {
1341  case Triple::MacOSX:
1342  case Triple::Darwin:
1343  Target.getMacOSXVersion(Version);
1344  break;
1345  case Triple::IOS:
1346  case Triple::TvOS:
1347  Version = Target.getiOSVersion();
1348  break;
1349  case Triple::WatchOS:
1350  Version = Target.getWatchOSVersion();
1351  break;
1352  case Triple::DriverKit:
1353  Version = Target.getDriverKitVersion();
1354  break;
1355  default:
1356  llvm_unreachable("unexpected OS type");
1357  }
1358  assert(Version.getMajor() != 0 && "A non-zero major version is expected");
1359  auto LinkedTargetVersion =
1361  auto BuildVersionOSVersion = getMachoBuildVersionSupportedOS(Target);
1362  bool ShouldEmitBuildVersion = false;
1363  if (BuildVersionOSVersion.empty() ||
1364  LinkedTargetVersion >= BuildVersionOSVersion) {
1365  if (Target.isMacCatalystEnvironment() && DarwinTargetVariantTriple &&
1366  DarwinTargetVariantTriple->isMacOSX()) {
1367  emitVersionForTarget(*DarwinTargetVariantTriple,
1368  DarwinTargetVariantSDKVersion,
1369  /*DarwinTargetVariantTriple=*/nullptr,
1370  /*DarwinTargetVariantSDKVersion=*/VersionTuple());
1373  LinkedTargetVersion.getMajor(),
1374  LinkedTargetVersion.getMinor().value_or(0),
1375  LinkedTargetVersion.getSubminor().value_or(0), SDKVersion);
1376  return;
1377  }
1379  LinkedTargetVersion.getMajor(),
1380  LinkedTargetVersion.getMinor().value_or(0),
1381  LinkedTargetVersion.getSubminor().value_or(0), SDKVersion);
1382  ShouldEmitBuildVersion = true;
1383  }
1384 
1385  if (const Triple *TVT = DarwinTargetVariantTriple) {
1386  if (Target.isMacOSX() && TVT->isMacCatalystEnvironment()) {
1387  auto TVLinkedTargetVersion =
1388  targetVersionOrMinimumSupportedOSVersion(*TVT, TVT->getiOSVersion());
1391  TVLinkedTargetVersion.getMajor(),
1392  TVLinkedTargetVersion.getMinor().value_or(0),
1393  TVLinkedTargetVersion.getSubminor().value_or(0),
1394  DarwinTargetVariantSDKVersion);
1395  }
1396  }
1397 
1398  if (ShouldEmitBuildVersion)
1399  return;
1400 
1402  LinkedTargetVersion.getMajor(),
1403  LinkedTargetVersion.getMinor().value_or(0),
1404  LinkedTargetVersion.getSubminor().value_or(0), SDKVersion);
1405 }
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:350
i
i
Definition: README.txt:29
llvm::MCDwarfFrameInfo::End
MCSymbol * End
Definition: MCDwarf.h:685
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:301
llvm::MCVersionMinType
MCVersionMinType
Definition: MCDirectives.h:67
llvm::MCStreamer::emitCFIDefCfaOffset
virtual void emitCFIDefCfaOffset(int64_t Offset)
Definition: MCStreamer.cpp:503
llvm::MCStreamer::getAssociatedXDataSection
MCSection * getAssociatedXDataSection(const MCSection *TextSec)
Get the .xdata section used for the given section.
Definition: MCStreamer.cpp:852
llvm::MachO::PLATFORM_MACOS
@ PLATFORM_MACOS
Definition: MachO.h:499
llvm::MCStreamer::visitUsedExpr
void visitUsedExpr(const MCExpr &Expr)
Definition: MCStreamer.cpp:1070
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:18
llvm::MachO::PLATFORM_WATCHOSSIMULATOR
@ PLATFORM_WATCHOSSIMULATOR
Definition: MachO.h:507
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:534
llvm::MCStreamer::emitWinCFISetFrame
virtual void emitWinCFISetFrame(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:876
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:486
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:546
llvm::MCContext::getCVContext
CodeViewContext & getCVContext()
Definition: MCContext.cpp:969
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:1141
llvm::MCDwarfFrameInfo::Lsda
const MCSymbol * Lsda
Definition: MCDwarf.h:687
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:359
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:76
llvm::MCContext::getRegisterInfo
const MCRegisterInfo * getRegisterInfo() const
Definition: MCContext.h:449
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:1193
StringRef.h
llvm::Triple::Darwin
@ Darwin
Definition: Triple.h:187
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:445
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:145
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:898
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:1182
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:1164
llvm::MCStreamer::emitCFIStartProc
void emitCFIStartProc(bool IsSimple, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:447
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:502
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::emitCFIRegister
virtual void emitCFIRegister(int64_t Register1, int64_t Register2)
Definition: MCStreamer.cpp:658
llvm::Triple::IOS
@ IOS
Definition: Triple.h:191
llvm::MCStreamer::emitWinCFISaveReg
virtual void emitWinCFISaveReg(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:915
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
llvm::MachO::PLATFORM_IOS
@ PLATFORM_IOS
Definition: MachO.h:500
llvm::MCStreamer::emitCOFFSymbolType
virtual void emitCOFFSymbolType(int Type)
Emit the type of the symbol.
Definition: MCStreamer.cpp:1167
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:1176
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:346
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:812
MCObjectFileInfo.h
llvm::MachO::PLATFORM_MACCATALYST
@ PLATFORM_MACCATALYST
Definition: MachO.h:504
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:1204
getMachoBuildVersionSupportedOS
static VersionTuple getMachoBuildVersionSupportedOS(const Triple &Target)
Definition: MCStreamer.cpp:1279
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:578
llvm::MCStreamer::emitWinEHHandler
virtual void emitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:783
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:641
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:1183
llvm::MCStreamer::emitCFILabel
virtual MCSymbol * emitCFILabel()
When emitting an object file, create and emit a real label.
Definition: MCStreamer.cpp:486
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:1103
llvm::MCStreamer::emitInt32
void emitInt32(uint64_t Value)
Definition: MCStreamer.h:738
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:319
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:998
llvm::MCDwarfFrameInfo::RAReg
unsigned RAReg
Definition: MCDwarf.h:695
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:898
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:615
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:512
llvm::Triple::WatchOS
@ WatchOS
Definition: Triple.h:213
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:561
llvm::MCStreamer::emitDwarfUnitLength
virtual void emitDwarfUnitLength(uint64_t Length, const Twine &Comment)
Emit a unit length field.
Definition: MCStreamer.cpp:1023
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:939
llvm::MCStreamer::getCommentOS
virtual raw_ostream & getCommentOS()
Return a raw_ostream that comments can be written to.
Definition: MCStreamer.cpp:111
llvm::MCStreamer::emitCFIDefCfaRegister
virtual void emitCFIDefCfaRegister(int64_t Register)
Definition: MCStreamer.cpp:523
llvm::MCCFIInstruction::cfiDefCfaOffset
static MCCFIInstruction cfiDefCfaOffset(MCSymbol *L, int Offset)
.cfi_def_cfa_offset modifies a rule for computing CFA.
Definition: MCDwarf.h:546
llvm::MCStreamer::emitCFIAdjustCfaOffset
virtual void emitCFIAdjustCfaOffset(int64_t Adjustment)
Definition: MCStreamer.cpp:513
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:566
llvm::MCStreamer::changeSection
virtual void changeSection(MCSection *, const MCExpr *)
Update streamer for a new active section.
Definition: MCStreamer.cpp:1200
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:694
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:505
llvm::MCStreamer::emitBundleLock
virtual void emitBundleLock(bool AlignToEnd)
The following instructions are a bundle-locked group.
Definition: MCStreamer.cpp:1221
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:82
llvm::MCCFIInstruction::OpDefCfa
@ OpDefCfa
Definition: MCDwarf.h:488
llvm::MCStreamer::emitCFIEndProcImpl
virtual void emitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame)
Definition: MCStreamer.cpp:480
llvm::Triple::isMacOSX
bool isMacOSX() const
Is this a Mac OS X triple.
Definition: Triple.h:476
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:212
llvm::MCStreamer::emitULEB128Value
virtual void emitULEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:1207
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:648
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:42
llvm::MCDwarfFrameInfo::CurrentCfaRegister
unsigned CurrentCfaRegister
Definition: MCDwarf.h:689
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:556
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:602
SmallString.h
llvm::MCStreamer::emitVersionForTarget
void emitVersionForTarget(const Triple &Target, const VersionTuple &SDKVersion, const Triple *DarwinTargetVariantTriple, const VersionTuple &DarwinTargetVariantSDKVersion)
Definition: MCStreamer.cpp:1329
llvm::Triple::TvOS
@ TvOS
Definition: Triple.h:212
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:846
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:470
llvm::MCStreamer::emitWinCFISaveXMM
virtual void emitWinCFISaveXMM(MCRegister Register, unsigned Offset, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:932
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::MCDwarfFrameInfo::Personality
const MCSymbol * Personality
Definition: MCDwarf.h:686
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:423
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:1225
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:769
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:56
llvm::MCStreamer::emitWinEHHandlerData
virtual void emitWinEHHandlerData(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:800
llvm::dwarf::Index
Index
Definition: Dwarf.h:472
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:508
llvm::MCStreamer::emitAssemblerFlag
virtual void emitAssemblerFlag(MCAssemblerFlag Flag)
Note in the output the specified Flag.
Definition: MCStreamer.cpp:1151
llvm::isUIntN
bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
Definition: MathExtras.h:423
llvm::MCStreamer::hasUnfinishedDwarfFrameInfo
bool hasUnfinishedDwarfFrameInfo()
Definition: MCStreamer.cpp:280
llvm::MCDwarfLineTable
Definition: MCDwarf.h:346
llvm::MCStreamer::finishImpl
virtual void finishImpl()
Streamer specific finalization.
Definition: MCStreamer.cpp:1222
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:1051
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:625
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:145
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:294
getMachoBuildVersionPlatformType
static MachO::PlatformType getMachoBuildVersionPlatformType(const Triple &Target)
Definition: MCStreamer.cpp:1304
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
llvm::MachO::PlatformType
PlatformType
Definition: MachO.h:497
llvm::Triple::DriverKit
@ DriverKit
Definition: Triple.h:214
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:625
llvm::MCStreamer::maybeEmitDwarf64Mark
void maybeEmitDwarf64Mark()
Emit a special value of 0xffffffff if producing 64-bit debugging info.
Definition: MCStreamer.cpp:1016
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:31
llvm::IndexedInstrProf::Version
const uint64_t Version
Definition: InstrProf.h:1056
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:1189
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:1067
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:631
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:389
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:428
llvm::MCStreamer::emitCOFFSafeSEH
virtual void emitCOFFSafeSEH(MCSymbol const *Symbol)
Definition: MCStreamer.cpp:971
llvm::MCTargetStreamer::emitAssignment
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Definition: MCStreamer.cpp:92
llvm::MCDwarfLineTable::getLabel
MCSymbol * getLabel() const
Definition: MCDwarf.h:396
llvm::MCContext::getTargetTriple
const Triple & getTargetTriple() const
Definition: MCContext.h:435
llvm::MCVM_TvOSVersionMin
@ MCVM_TvOSVersionMin
.tvos_version_min
Definition: MCDirectives.h:70
MCInstPrinter.h
llvm::MCCFIInstruction
Definition: MCDwarf.h:478
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:305
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:539
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:1203
llvm::MCStreamer::emitCGProfileEntry
virtual void emitCGProfileEntry(const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count)
Definition: MCStreamer.cpp:808
llvm::MCStreamer::emitSymbolDesc
virtual void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue)
Set the DescValue for the Symbol.
Definition: MCStreamer.cpp:1153
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:1239
llvm::MCStreamer::emitCOFFSymbolIndex
virtual void emitCOFFSymbolIndex(MCSymbol const *Symbol)
Emits the symbol table index of a Symbol into the current section.
Definition: MCStreamer.cpp:973
llvm::codeview::DefRangeSubfieldRegisterHeader
Definition: SymbolRecord.h:501
llvm::XCOFF::StorageClass
StorageClass
Definition: XCOFF.h:155
llvm::Triple::MacOSX
@ MacOSX
Definition: Triple.h:195
llvm::MCStreamer::emitFileDirective
virtual void emitFileDirective(StringRef Filename)
Switch to a new logical file.
Definition: MCStreamer.cpp:1160
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:1218
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:442
llvm::MCStreamer::beginCOFFSymbolDef
virtual void beginCOFFSymbolDef(const MCSymbol *Symbol)
Start emitting COFF symbol definition.
Definition: MCStreamer.cpp:1154
llvm::MCStreamer::emitEHSymAttributes
virtual void emitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol)
Definition: MCStreamer.cpp:406
llvm::DenseMapBase::clear
void clear()
Definition: DenseMap.h:110
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:3013
llvm::MCContext::getMCDwarfLineTable
MCDwarfLineTable & getMCDwarfLineTable(unsigned CUID)
Definition: MCContext.h:728
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:447
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:637
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:993
llvm::MCStreamer::emitSyntaxDirective
virtual void emitSyntaxDirective()
Definition: MCStreamer.cpp:858
LEB128.h
llvm::MCDwarfLineTable::setLabel
void setLabel(MCSymbol *Label)
Definition: MCDwarf.h:400
llvm::MCCFIInstruction::createNegateRAState
static MCCFIInstruction createNegateRAState(MCSymbol *L)
.cfi_negate_ra_state AArch64 negate RA state.
Definition: MCDwarf.h:596
llvm::MCStreamer::emitInstruction
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Definition: MCStreamer.cpp:1096
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:769
MCRegisterInfo.h
llvm::codeview::DefRangeRegisterHeader
Definition: SymbolRecord.h:479
llvm::MCStreamer::endCOFFSymbolDef
virtual void endCOFFSymbolDef()
Marks the end of the symbol definition.
Definition: MCStreamer.cpp:1157
llvm::Value::print
void print(raw_ostream &O, bool IsForDebug=false) const
Implement operator<< on Value.
Definition: AsmWriter.cpp:4594
llvm::MCStreamer::getStartTokLoc
SMLoc getStartTokLoc() const
Definition: MCStreamer.h:285
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:622
getMachoVersionMinLoadCommandType
static MCVersionMinType getMachoVersionMinLoadCommandType(const Triple &Target)
Definition: MCStreamer.cpp:1259
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:612
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:294
llvm::MCContext::reportError
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:1024
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:1198
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:532
llvm::MCStreamer::emitCOFFSecRel32
virtual void emitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset)
Emits a COFF section relative relocation.
Definition: MCStreamer.cpp:977
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:98
llvm::MCStreamer::initSections
virtual void initSections(bool NoExecStack, const MCSubtargetInfo &STI)
Create the default sections and set the initial one.
Definition: MCStreamer.cpp:410
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:50
llvm::raw_svector_ostream::str
StringRef str() const
Return a StringRef for the vector contents.
Definition: raw_ostream.h:683
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:961
llvm::MCStreamer::emitWinCFIStartChained
virtual void emitWinCFIStartChained(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:756
llvm::MCCFIInstruction::OpLLVMDefAspaceCfa
@ OpLLVMDefAspaceCfa
Definition: MCDwarf.h:485
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:1220
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:752
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:553
llvm::MCStreamer::emitCFIGnuArgsSize
virtual void emitCFIGnuArgsSize(int64_t Size)
Definition: MCStreamer.cpp:631
llvm::MCStreamer::emitWeakReference
virtual void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol)
Emit an weak reference from Alias to Symbol.
Definition: MCStreamer.cpp:1201
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:745
llvm::MCStreamer::emitWinCFIPushFrame
virtual void emitWinCFIPushFrame(bool Code, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:947
llvm::MachO::PLATFORM_TVOS
@ PLATFORM_TVOS
Definition: MachO.h:501
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:492
llvm::MCDwarfFrameInfo::IsBKeyFrame
bool IsBKeyFrame
Definition: MCDwarf.h:696
llvm::MCDwarfFrameInfo::PersonalityEncoding
unsigned PersonalityEncoding
Definition: MCDwarf.h:690
llvm::MCStreamer::emitDwarfLineStartLabel
virtual void emitDwarfLineStartLabel(MCSymbol *StartSym)
Emit the debug line start label.
Definition: MCStreamer.cpp:1046
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:81
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:1194
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:506
get
Should compile to something r4 addze r3 instead we get
Definition: README.txt:24
llvm::WinEH::FrameInfo::HandlesExceptions
bool HandlesExceptions
Definition: MCWinEH.h:52
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:368
llvm::MCStreamer::emitCFIWindowSave
virtual void emitCFIWindowSave()
Definition: MCStreamer.cpp:668
llvm::MCStreamer::emitCFILsda
virtual void emitCFILsda(const MCSymbol *Sym, unsigned Encoding)
Definition: MCStreamer.cpp:575
llvm::MCStreamer::emitAbsoluteSymbolDiff
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
Definition: MCStreamer.cpp:1122
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:99
llvm::MCDwarfFrameInfo::IsSignalFrame
bool IsSignalFrame
Definition: MCDwarf.h:693
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
encodeSEHRegNum
static unsigned encodeSEHRegNum(MCContext &Ctx, MCRegister Reg)
Definition: MCStreamer.cpp:860
llvm::MCStreamer::emitSLEB128Value
virtual void emitSLEB128Value(const MCExpr *Value)
Definition: MCStreamer.cpp:1208
llvm::MCStreamer::emitBundleUnlock
virtual void emitBundleUnlock()
Ends a bundle-locked group.
Definition: MCStreamer.cpp:1223
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:386
llvm::SmallVectorImpl::clear
void clear()
Definition: SmallVector.h:597
llvm::MCStreamer::emitCFIRememberState
virtual void emitCFIRememberState()
Definition: MCStreamer.cpp:583
llvm::MCStreamer::emitWinCFIEndProc
virtual void emitWinCFIEndProc(SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:727
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:502
llvm::WinEH::FrameInfo::End
const MCSymbol * End
Definition: MCWinEH.h:41
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:324
llvm::WinEH::FrameInfo
Definition: MCWinEH.h:39
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:83
llvm::MCStreamer::emitCFIEndProc
void emitCFIEndProc()
Definition: MCStreamer.cpp:473
llvm::MCStreamer::~MCStreamer
virtual ~MCStreamer()
llvm::MCStreamer::finish
void finish(SMLoc EndLoc=SMLoc())
Finish emission of machine code.
Definition: MCStreamer.cpp:1002
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:293
llvm::MCDwarfFrameInfo::Instructions
std::vector< MCCFIInstruction > Instructions
Definition: MCDwarf.h:688
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:1215
llvm::WinEH::FrameInfo::HandlesUnwind
bool HandlesUnwind
Definition: MCWinEH.h:51
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:585
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:1170
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:691
llvm::MCStreamer::getTargetStreamer
MCTargetStreamer * getTargetStreamer()
Definition: MCStreamer.h:300
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:609
llvm::MCExpr::Unary
@ Unary
Unary expressions.
Definition: MCExpr.h:41
llvm::MCStreamer::assignFragment
void assignFragment(MCSymbol *Symbol, MCFragment *Fragment)
Sets the symbol's section.
Definition: MCStreamer.cpp:414
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:1252
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:508
llvm::MCStreamer::emitCFIReturnColumn
virtual void emitCFIReturnColumn(int64_t Register)
Definition: MCStreamer.cpp:687
llvm::MCSectionSubPair
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:66
llvm::MCDwarfFrameInfo::IsMTETaggedFrame
bool IsMTETaggedFrame
Definition: MCDwarf.h:697
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:262
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:975
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:658
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:1212
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:1202
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:694
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:570
llvm::MCTargetStreamer::prettyPrintAsm
virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, uint64_t Address, const MCInst &Inst, const MCSubtargetInfo &STI, raw_ostream &OS)
Definition: MCStreamer.cpp:1060
llvm::MCCFIInstruction::createRememberState
static MCCFIInstruction createRememberState(MCSymbol *L)
.cfi_remember_state Save all current rules for all registers.
Definition: MCDwarf.h:620
llvm::dwarf::DWARF64
@ DWARF64
Definition: Dwarf.h:93
llvm::WinEH::FrameInfo::Instructions
std::vector< Instruction > Instructions
Definition: MCWinEH.h:58
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:984
InlinePriorityMode::Size
@ Size
From
BlockVerifier::State From
Definition: BlockVerifier.cpp:55
llvm::WinEH::FrameInfo::ChainedParent
const FrameInfo * ChainedParent
Definition: MCWinEH.h:57
llvm::lltok::ChecksumKind
@ ChecksumKind
Definition: LLToken.h:433
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:270
llvm::MCAsmInfo::usesWindowsCFI
bool usesWindowsCFI() const
Definition: MCAsmInfo.h:793
llvm::MCStreamer::emitWinCFIPushReg
virtual void emitWinCFIPushReg(MCRegister Register, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:864
llvm::MCStreamer::emitCFIRestoreState
virtual void emitCFIRestoreState()
Definition: MCStreamer.cpp:592
llvm::MCDwarfFrameInfo
Definition: MCDwarf.h:681
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:1152
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:979
llvm::MCCFIInstruction::createWindowSave
static MCCFIInstruction createWindowSave(MCSymbol *L)
.cfi_window_save SPARC register window is saved.
Definition: MCDwarf.h:591
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:709
llvm::MCStreamer::AddComment
virtual void AddComment(const Twine &T, bool EOL=true)
Add a textual comment.
Definition: MCStreamer.h:355
llvm::COFF::IMAGE_COMDAT_SELECT_ANY
@ IMAGE_COMDAT_SELECT_ANY
Definition: COFF.h:408
llvm::MCStreamer::emitCFINegateRAState
virtual void emitCFINegateRAState()
Definition: MCStreamer.cpp:678
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:1196
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:603
llvm::MCStreamer::emitCFIMTETaggedFrame
virtual void emitCFIMTETaggedFrame()
Definition: MCStreamer.cpp:255