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