LLVM  10.0.0
MCObjectStreamer.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCObjectStreamer.cpp - Object File MCStreamer Interface -----===//
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 
10 #include "llvm/ADT/STLExtras.h"
11 #include "llvm/MC/MCAsmBackend.h"
12 #include "llvm/MC/MCAssembler.h"
13 #include "llvm/MC/MCCodeEmitter.h"
14 #include "llvm/MC/MCCodeView.h"
15 #include "llvm/MC/MCContext.h"
16 #include "llvm/MC/MCDwarf.h"
17 #include "llvm/MC/MCExpr.h"
18 #include "llvm/MC/MCObjectWriter.h"
19 #include "llvm/MC/MCSection.h"
20 #include "llvm/MC/MCSymbol.h"
22 #include "llvm/Support/SourceMgr.h"
23 using namespace llvm;
24 
26  std::unique_ptr<MCAsmBackend> TAB,
27  std::unique_ptr<MCObjectWriter> OW,
28  std::unique_ptr<MCCodeEmitter> Emitter)
29  : MCStreamer(Context),
30  Assembler(std::make_unique<MCAssembler>(
31  Context, std::move(TAB), std::move(Emitter), std::move(OW))),
32  EmitEHFrame(true), EmitDebugFrame(false) {
33  if (Assembler->getBackendPtr())
34  setAllowAutoPadding(Assembler->getBackend().allowAutoPadding());
35 }
36 
38 
39 // AssemblerPtr is used for evaluation of expressions and causes
40 // difference between asm and object outputs. Return nullptr to in
41 // inline asm mode to limit divergence to assembly inputs.
44  return Assembler.get();
45  return nullptr;
46 }
47 
49  MCSection *CurSection = getCurrentSectionOnly();
50  if (CurSection) {
51  // Register labels that have not yet been assigned to a Section.
52  if (!PendingLabels.empty()) {
53  for (MCSymbol* Sym : PendingLabels)
54  CurSection->addPendingLabel(Sym);
55  PendingLabels.clear();
56  }
57 
58  // Add this label to the current Section / Subsection.
59  CurSection->addPendingLabel(S, CurSubsectionIdx);
60 
61  // Add this Section to the list of PendingLabelSections.
62  auto SecIt = std::find(PendingLabelSections.begin(),
63  PendingLabelSections.end(), CurSection);
64  if (SecIt == PendingLabelSections.end())
65  PendingLabelSections.push_back(CurSection);
66  }
67  else
68  // There is no Section / Subsection for this label yet.
69  PendingLabels.push_back(S);
70 }
71 
73  MCSection *CurSection = getCurrentSectionOnly();
74  if (!CurSection) {
75  assert(PendingLabels.empty());
76  return;
77  }
78  // Register labels that have not yet been assigned to a Section.
79  if (!PendingLabels.empty()) {
80  for (MCSymbol* Sym : PendingLabels)
81  CurSection->addPendingLabel(Sym, CurSubsectionIdx);
82  PendingLabels.clear();
83  }
84 
85  // Associate a fragment with this label, either the supplied fragment
86  // or an empty data fragment.
87  if (F)
88  CurSection->flushPendingLabels(F, FOffset, CurSubsectionIdx);
89  else
90  CurSection->flushPendingLabels(nullptr, 0, CurSubsectionIdx);
91 }
92 
94  // Register labels that have not yet been assigned to a Section.
95  if (!PendingLabels.empty()) {
96  MCSection *CurSection = getCurrentSectionOnly();
97  assert(CurSection);
98  for (MCSymbol* Sym : PendingLabels)
99  CurSection->addPendingLabel(Sym, CurSubsectionIdx);
100  PendingLabels.clear();
101  }
102 
103  // Assign an empty data fragment to all remaining pending labels.
104  for (MCSection* Section : PendingLabelSections)
105  Section->flushPendingLabels();
106 }
107 
108 // When fixup's offset is a forward declared label, e.g.:
109 //
110 // .reloc 1f, R_MIPS_JALR, foo
111 // 1: nop
112 //
113 // postpone adding it to Fixups vector until the label is defined and its offset
114 // is known.
115 void MCObjectStreamer::resolvePendingFixups() {
116  for (PendingMCFixup &PendingFixup : PendingFixups) {
117  if (!PendingFixup.Sym || PendingFixup.Sym->isUndefined ()) {
118  getContext().reportError(PendingFixup.Fixup.getLoc(),
119  "unresolved relocation offset");
120  continue;
121  }
122  flushPendingLabels(PendingFixup.DF, PendingFixup.DF->getContents().size());
123  PendingFixup.Fixup.setOffset(PendingFixup.Sym->getOffset());
124  PendingFixup.DF->getFixups().push_back(PendingFixup.Fixup);
125  }
126  PendingFixups.clear();
127 }
128 
129 // As a compile-time optimization, avoid allocating and evaluating an MCExpr
130 // tree for (Hi - Lo) when Hi and Lo are offsets into the same fragment.
131 static Optional<uint64_t>
133  assert(Hi && Lo);
135  return None;
136 
137  if (!Hi->getFragment() || Hi->getFragment() != Lo->getFragment() ||
138  Hi->isVariable() || Lo->isVariable())
139  return None;
140 
141  return Hi->getOffset() - Lo->getOffset();
142 }
143 
145  const MCSymbol *Lo,
146  unsigned Size) {
147  if (Optional<uint64_t> Diff = absoluteSymbolDiff(getAssembler(), Hi, Lo)) {
148  EmitIntValue(*Diff, Size);
149  return;
150  }
152 }
153 
155  const MCSymbol *Lo) {
156  if (Optional<uint64_t> Diff = absoluteSymbolDiff(getAssembler(), Hi, Lo)) {
157  EmitULEB128IntValue(*Diff);
158  return;
159  }
161 }
162 
164  if (Assembler)
165  Assembler->reset();
166  CurInsertionPoint = MCSection::iterator();
167  EmitEHFrame = true;
168  EmitDebugFrame = false;
169  PendingLabels.clear();
170  PendingLabelSections.clear();
172 }
173 
175  if (!getNumFrameInfos())
176  return;
177 
178  if (EmitEHFrame)
179  MCDwarfFrameEmitter::Emit(*this, MAB, true);
180 
181  if (EmitDebugFrame)
182  MCDwarfFrameEmitter::Emit(*this, MAB, false);
183 }
184 
186  assert(getCurrentSectionOnly() && "No current section!");
187 
188  if (CurInsertionPoint != getCurrentSectionOnly()->getFragmentList().begin())
189  return &*std::prev(CurInsertionPoint);
190 
191  return nullptr;
192 }
193 
195  const MCAssembler &Assembler,
196  const MCSubtargetInfo *STI) {
197  if (!F.hasInstructions())
198  return true;
199  // When bundling is enabled, we don't want to add data to a fragment that
200  // already has instructions (see MCELFStreamer::EmitInstToData for details)
201  if (Assembler.isBundlingEnabled())
202  return Assembler.getRelaxAll();
203  // If the subtarget is changed mid fragment we start a new fragment to record
204  // the new STI.
205  return !STI || F.getSubtargetInfo() == STI;
206 }
207 
210  MCDataFragment *F = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
211  if (!F || !CanReuseDataFragment(*F, *Assembler, STI)) {
212  F = new MCDataFragment();
213  insert(F);
214  }
215  return F;
216 }
217 
219  Assembler->registerSymbol(Sym);
220 }
221 
223  MCStreamer::EmitCFISections(EH, Debug);
224  EmitEHFrame = EH;
225  EmitDebugFrame = Debug;
226 }
227 
229  SMLoc Loc) {
230  MCStreamer::EmitValueImpl(Value, Size, Loc);
232  flushPendingLabels(DF, DF->getContents().size());
233 
235 
236  // Avoid fixups when possible.
237  int64_t AbsValue;
238  if (Value->evaluateAsAbsolute(AbsValue, getAssemblerPtr())) {
239  if (!isUIntN(8 * Size, AbsValue) && !isIntN(8 * Size, AbsValue)) {
241  Loc, "value evaluated as " + Twine(AbsValue) + " is out of range.");
242  return;
243  }
244  EmitIntValue(AbsValue, Size);
245  return;
246  }
247  DF->getFixups().push_back(
249  MCFixup::getKindForSize(Size, false), Loc));
250  DF->getContents().resize(DF->getContents().size() + Size, 0);
251 }
252 
253 MCSymbol *MCObjectStreamer::EmitCFILabel() {
254  MCSymbol *Label = getContext().createTempSymbol("cfi", true);
255  EmitLabel(Label);
256  return Label;
257 }
258 
259 void MCObjectStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
260  // We need to create a local symbol to avoid relocations.
261  Frame.Begin = getContext().createTempSymbol();
262  EmitLabel(Frame.Begin);
263 }
264 
265 void MCObjectStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
266  Frame.End = getContext().createTempSymbol();
267  EmitLabel(Frame.End);
268 }
269 
271  MCStreamer::EmitLabel(Symbol, Loc);
272 
273  getAssembler().registerSymbol(*Symbol);
274 
275  // If there is a current fragment, mark the symbol as pointing into it.
276  // Otherwise queue the label and set its fragment pointer when we emit the
277  // next fragment.
278  auto *F = dyn_cast_or_null<MCDataFragment>(getCurrentFragment());
279  if (F && !(getAssembler().isBundlingEnabled() &&
280  getAssembler().getRelaxAll())) {
281  Symbol->setFragment(F);
282  Symbol->setOffset(F->getContents().size());
283  } else {
284  // Assign all pending labels to offset 0 within the dummy "pending"
285  // fragment. (They will all be reassigned to a real fragment in
286  // flushPendingLabels())
287  Symbol->setOffset(0);
288  addPendingLabel(Symbol);
289  }
290 }
291 
292 // Emit a label at a previously emitted fragment/offset position. This must be
293 // within the currently-active section.
295  MCFragment *F, uint64_t Offset) {
297 
298  MCStreamer::EmitLabel(Symbol, Loc);
299  getAssembler().registerSymbol(*Symbol);
300  auto *DF = dyn_cast_or_null<MCDataFragment>(F);
301  Symbol->setOffset(Offset);
302  if (DF) {
303  Symbol->setFragment(F);
304  } else {
305  assert(isa<MCDummyFragment>(F) &&
306  "F must either be an MCDataFragment or the pending MCDummyFragment");
307  assert(Offset == 0);
308  addPendingLabel(Symbol);
309  }
310 }
311 
313  int64_t IntValue;
314  if (Value->evaluateAsAbsolute(IntValue, getAssemblerPtr())) {
315  EmitULEB128IntValue(IntValue);
316  return;
317  }
318  insert(new MCLEBFragment(*Value, false));
319 }
320 
322  int64_t IntValue;
323  if (Value->evaluateAsAbsolute(IntValue, getAssemblerPtr())) {
324  EmitSLEB128IntValue(IntValue);
325  return;
326  }
327  insert(new MCLEBFragment(*Value, true));
328 }
329 
331  const MCSymbol *Symbol) {
332  report_fatal_error("This file format doesn't support weak aliases.");
333 }
334 
336  const MCExpr *Subsection) {
337  changeSectionImpl(Section, Subsection);
338 }
339 
341  const MCExpr *Subsection) {
342  assert(Section && "Cannot switch to a null section!");
344 
345  bool Created = getAssembler().registerSection(*Section);
346 
347  int64_t IntSubsection = 0;
348  if (Subsection &&
349  !Subsection->evaluateAsAbsolute(IntSubsection, getAssemblerPtr()))
350  report_fatal_error("Cannot evaluate subsection number");
351  if (IntSubsection < 0 || IntSubsection > 8192)
352  report_fatal_error("Subsection number out of range");
353  CurSubsectionIdx = unsigned(IntSubsection);
354  CurInsertionPoint =
355  Section->getSubsectionInsertionPoint(CurSubsectionIdx);
356  return Created;
357 }
358 
360  getAssembler().registerSymbol(*Symbol);
361  MCStreamer::EmitAssignment(Symbol, Value);
362 }
363 
365  return Sec.hasInstructions();
366 }
367 
369  const MCSubtargetInfo &STI) {
370  getAssembler().getBackend().alignBranchesBegin(*this, Inst);
371  EmitInstructionImpl(Inst, STI);
372  getAssembler().getBackend().alignBranchesEnd(*this, Inst);
373 }
374 
375 void MCObjectStreamer::EmitInstructionImpl(const MCInst &Inst,
376  const MCSubtargetInfo &STI) {
377  MCStreamer::EmitInstruction(Inst, STI);
378 
380  Sec->setHasInstructions(true);
381 
382  // Now that a machine instruction has been assembled into this section, make
383  // a line entry for any .loc directive that has been seen.
385 
386  // If this instruction doesn't need relaxation, just emit it as data.
387  MCAssembler &Assembler = getAssembler();
388  if (!Assembler.getBackend().mayNeedRelaxation(Inst, STI)) {
389  EmitInstToData(Inst, STI);
390  return;
391  }
392 
393  // Otherwise, relax and emit it as data if either:
394  // - The RelaxAll flag was passed
395  // - Bundling is enabled and this instruction is inside a bundle-locked
396  // group. We want to emit all such instructions into the same data
397  // fragment.
398  if (Assembler.getRelaxAll() ||
399  (Assembler.isBundlingEnabled() && Sec->isBundleLocked())) {
400  MCInst Relaxed;
401  getAssembler().getBackend().relaxInstruction(Inst, STI, Relaxed);
402  while (getAssembler().getBackend().mayNeedRelaxation(Relaxed, STI))
403  getAssembler().getBackend().relaxInstruction(Relaxed, STI, Relaxed);
404  EmitInstToData(Relaxed, STI);
405  return;
406  }
407 
408  // Otherwise emit to a separate fragment.
409  EmitInstToFragment(Inst, STI);
410 }
411 
413  const MCSubtargetInfo &STI) {
414  if (getAssembler().getRelaxAll() && getAssembler().isBundlingEnabled())
415  llvm_unreachable("All instructions should have already been relaxed");
416 
417  // Always create a new, separate fragment here, because its size can change
418  // during relaxation.
419  MCRelaxableFragment *IF = new MCRelaxableFragment(Inst, STI);
420  insert(IF);
421 
422  SmallString<128> Code;
423  raw_svector_ostream VecOS(Code);
424  getAssembler().getEmitter().encodeInstruction(Inst, VecOS, IF->getFixups(),
425  STI);
426  IF->getContents().append(Code.begin(), Code.end());
427 }
428 
429 #ifndef NDEBUG
430 static const char *const BundlingNotImplementedMsg =
431  "Aligned bundling is not implemented for this object format";
432 #endif
433 
434 void MCObjectStreamer::EmitBundleAlignMode(unsigned AlignPow2) {
435  llvm_unreachable(BundlingNotImplementedMsg);
436 }
437 
438 void MCObjectStreamer::EmitBundleLock(bool AlignToEnd) {
439  llvm_unreachable(BundlingNotImplementedMsg);
440 }
441 
443  llvm_unreachable(BundlingNotImplementedMsg);
444 }
445 
446 void MCObjectStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
447  unsigned Column, unsigned Flags,
448  unsigned Isa,
449  unsigned Discriminator,
450  StringRef FileName) {
451  // In case we see two .loc directives in a row, make sure the
452  // first one gets a line entry.
454 
455  this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags,
456  Isa, Discriminator, FileName);
457 }
458 
459 static const MCExpr *buildSymbolDiff(MCObjectStreamer &OS, const MCSymbol *A,
460  const MCSymbol *B) {
461  MCContext &Context = OS.getContext();
463  const MCExpr *ARef = MCSymbolRefExpr::create(A, Variant, Context);
464  const MCExpr *BRef = MCSymbolRefExpr::create(B, Variant, Context);
465  const MCExpr *AddrDelta =
466  MCBinaryExpr::create(MCBinaryExpr::Sub, ARef, BRef, Context);
467  return AddrDelta;
468 }
469 
471  MCDwarfLineTableParams Params,
472  int64_t LineDelta, const MCSymbol *Label,
473  int PointerSize) {
474  // emit the sequence to set the address
475  OS.EmitIntValue(dwarf::DW_LNS_extended_op, 1);
476  OS.EmitULEB128IntValue(PointerSize + 1);
477  OS.EmitIntValue(dwarf::DW_LNE_set_address, 1);
478  OS.EmitSymbolValue(Label, PointerSize);
479 
480  // emit the sequence for the LineDelta (from 1) and a zero address delta.
481  MCDwarfLineAddr::Emit(&OS, Params, LineDelta, 0);
482 }
483 
485  const MCSymbol *LastLabel,
486  const MCSymbol *Label,
487  unsigned PointerSize) {
488  if (!LastLabel) {
489  emitDwarfSetLineAddr(*this, Assembler->getDWARFLinetableParams(), LineDelta,
490  Label, PointerSize);
491  return;
492  }
493  const MCExpr *AddrDelta = buildSymbolDiff(*this, Label, LastLabel);
494  int64_t Res;
495  if (AddrDelta->evaluateAsAbsolute(Res, getAssemblerPtr())) {
496  MCDwarfLineAddr::Emit(this, Assembler->getDWARFLinetableParams(), LineDelta,
497  Res);
498  return;
499  }
500  insert(new MCDwarfLineAddrFragment(LineDelta, *AddrDelta));
501 }
502 
504  const MCSymbol *Label) {
505  const MCExpr *AddrDelta = buildSymbolDiff(*this, Label, LastLabel);
506  int64_t Res;
507  if (AddrDelta->evaluateAsAbsolute(Res, getAssemblerPtr())) {
509  return;
510  }
511  insert(new MCDwarfCallFrameFragment(*AddrDelta));
512 }
513 
514 void MCObjectStreamer::EmitCVLocDirective(unsigned FunctionId, unsigned FileNo,
515  unsigned Line, unsigned Column,
516  bool PrologueEnd, bool IsStmt,
517  StringRef FileName, SMLoc Loc) {
518  // Validate the directive.
519  if (!checkCVLocSection(FunctionId, FileNo, Loc))
520  return;
521 
522  // Emit a label at the current position and record it in the CodeViewContext.
523  MCSymbol *LineSym = getContext().createTempSymbol();
524  EmitLabel(LineSym);
525  getContext().getCVContext().recordCVLoc(getContext(), LineSym, FunctionId,
526  FileNo, Line, Column, PrologueEnd,
527  IsStmt);
528 }
529 
531  const MCSymbol *Begin,
532  const MCSymbol *End) {
533  getContext().getCVContext().emitLineTableForFunction(*this, FunctionId, Begin,
534  End);
535  this->MCStreamer::EmitCVLinetableDirective(FunctionId, Begin, End);
536 }
537 
539  unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum,
540  const MCSymbol *FnStartSym, const MCSymbol *FnEndSym) {
542  *this, PrimaryFunctionId, SourceFileId, SourceLineNum, FnStartSym,
543  FnEndSym);
545  PrimaryFunctionId, SourceFileId, SourceLineNum, FnStartSym, FnEndSym);
546 }
547 
549  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
550  StringRef FixedSizePortion) {
551  MCFragment *Frag =
552  getContext().getCVContext().emitDefRange(*this, Ranges, FixedSizePortion);
553  // Attach labels that were pending before we created the defrange fragment to
554  // the beginning of the new fragment.
555  flushPendingLabels(Frag, 0);
556  this->MCStreamer::EmitCVDefRangeDirective(Ranges, FixedSizePortion);
557 }
558 
561 }
564 }
565 
568 }
569 
573  flushPendingLabels(DF, DF->getContents().size());
574  DF->getContents().append(Data.begin(), Data.end());
575 }
576 
578  int64_t Value,
579  unsigned ValueSize,
580  unsigned MaxBytesToEmit) {
581  if (MaxBytesToEmit == 0)
582  MaxBytesToEmit = ByteAlignment;
583  insert(new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit));
584 
585  // Update the maximum alignment on the current section if necessary.
586  MCSection *CurSec = getCurrentSectionOnly();
587  if (ByteAlignment > CurSec->getAlignment())
588  CurSec->setAlignment(Align(ByteAlignment));
589 }
590 
592  unsigned MaxBytesToEmit) {
593  EmitValueToAlignment(ByteAlignment, 0, 1, MaxBytesToEmit);
594  cast<MCAlignFragment>(getCurrentFragment())->setEmitNops(true);
595 }
596 
598  unsigned char Value,
599  SMLoc Loc) {
600  insert(new MCOrgFragment(*Offset, Value, Loc));
601 }
602 
603 // Associate DTPRel32 fixup with data and resize data area
606  flushPendingLabels(DF, DF->getContents().size());
607 
608  DF->getFixups().push_back(MCFixup::create(DF->getContents().size(),
609  Value, FK_DTPRel_4));
610  DF->getContents().resize(DF->getContents().size() + 4, 0);
611 }
612 
613 // Associate DTPRel64 fixup with data and resize data area
616  flushPendingLabels(DF, DF->getContents().size());
617 
618  DF->getFixups().push_back(MCFixup::create(DF->getContents().size(),
619  Value, FK_DTPRel_8));
620  DF->getContents().resize(DF->getContents().size() + 8, 0);
621 }
622 
623 // Associate TPRel32 fixup with data and resize data area
626  flushPendingLabels(DF, DF->getContents().size());
627 
628  DF->getFixups().push_back(MCFixup::create(DF->getContents().size(),
629  Value, FK_TPRel_4));
630  DF->getContents().resize(DF->getContents().size() + 4, 0);
631 }
632 
633 // Associate TPRel64 fixup with data and resize data area
636  flushPendingLabels(DF, DF->getContents().size());
637 
638  DF->getFixups().push_back(MCFixup::create(DF->getContents().size(),
639  Value, FK_TPRel_8));
640  DF->getContents().resize(DF->getContents().size() + 8, 0);
641 }
642 
643 // Associate GPRel32 fixup with data and resize data area
646  flushPendingLabels(DF, DF->getContents().size());
647 
648  DF->getFixups().push_back(
650  DF->getContents().resize(DF->getContents().size() + 4, 0);
651 }
652 
653 // Associate GPRel64 fixup with data and resize data area
656  flushPendingLabels(DF, DF->getContents().size());
657 
658  DF->getFixups().push_back(
660  DF->getContents().resize(DF->getContents().size() + 8, 0);
661 }
662 
664  const MCExpr *Expr, SMLoc Loc,
665  const MCSubtargetInfo &STI) {
666  Optional<MCFixupKind> MaybeKind = Assembler->getBackend().getFixupKind(Name);
667  if (!MaybeKind.hasValue())
668  return true;
669 
670  MCFixupKind Kind = *MaybeKind;
671 
672  if (Expr == nullptr)
673  Expr =
674  MCSymbolRefExpr::create(getContext().createTempSymbol(), getContext());
675 
677  flushPendingLabels(DF, DF->getContents().size());
678 
679  int64_t OffsetValue;
680  if (Offset.evaluateAsAbsolute(OffsetValue)) {
681  if (OffsetValue < 0)
682  llvm_unreachable(".reloc offset is negative");
683  DF->getFixups().push_back(MCFixup::create(OffsetValue, Expr, Kind, Loc));
684  return false;
685  }
686 
687  if (Offset.getKind() != llvm::MCExpr::SymbolRef)
688  llvm_unreachable(".reloc offset is not absolute nor a label");
689 
690  const MCSymbolRefExpr &SRE = cast<MCSymbolRefExpr>(Offset);
691  if (SRE.getSymbol().isDefined()) {
692  DF->getFixups().push_back(MCFixup::create(SRE.getSymbol().getOffset(),
693  Expr, Kind, Loc));
694  return false;
695  }
696 
697  PendingFixups.emplace_back(&SRE.getSymbol(), DF,
698  MCFixup::create(-1, Expr, Kind, Loc));
699  return false;
700 }
701 
702 void MCObjectStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue,
703  SMLoc Loc) {
705  flushPendingLabels(DF, DF->getContents().size());
706 
707  assert(getCurrentSectionOnly() && "need a section");
708  insert(new MCFillFragment(FillValue, 1, NumBytes, Loc));
709 }
710 
711 void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size,
712  int64_t Expr, SMLoc Loc) {
713  int64_t IntNumValues;
714  // Do additional checking now if we can resolve the value.
715  if (NumValues.evaluateAsAbsolute(IntNumValues, getAssemblerPtr())) {
716  if (IntNumValues < 0) {
719  "'.fill' directive with negative repeat count has no effect");
720  return;
721  }
722  // Emit now if we can for better errors.
723  int64_t NonZeroSize = Size > 4 ? 4 : Size;
724  Expr &= ~0ULL >> (64 - NonZeroSize * 8);
725  for (uint64_t i = 0, e = IntNumValues; i != e; ++i) {
726  EmitIntValue(Expr, NonZeroSize);
727  if (NonZeroSize < Size)
728  EmitIntValue(0, Size - NonZeroSize);
729  }
730  return;
731  }
732 
733  // Otherwise emit as fragment.
735  flushPendingLabels(DF, DF->getContents().size());
736 
737  assert(getCurrentSectionOnly() && "need a section");
738  insert(new MCFillFragment(Expr, Size, NumValues, Loc));
739 }
740 
742  getAssembler().addFileName(Filename);
743 }
744 
747 }
748 
752 }
753 
756 
757  // If we are generating dwarf for assembly source files dump out the sections.
758  if (getContext().getGenDwarfForAssembly())
759  MCGenDwarfInfo::Emit(this);
760 
761  // Dump out the dwarf file & directory tables and line tables.
762  MCDwarfLineTable::Emit(this, getAssembler().getDWARFLinetableParams());
763 
764  // Update any remaining pending labels with empty data fragments.
766 
767  resolvePendingFixups();
768  getAssembler().Finish();
769 }
virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName)
This implements the DWARF2 &#39;.loc fileno lineno ...&#39; assembler directive.
Definition: MCStreamer.cpp:238
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
reference emplace_back(ArgTypes &&... Args)
Definition: SmallVector.h:641
virtual void EmitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>> Ranges, StringRef FixedSizePortion)
This implements the CodeView &#39;.cv_def_range&#39; assembler directive.
Definition: MCStreamer.cpp:345
void addPendingLabel(MCSymbol *label, unsigned Subsection=0)
Add a pending label for the requested subsection.
Definition: MCSection.cpp:88
void EmitBytes(StringRef Data) override
Emit the bytes in Data into the output.
bool changeSectionImpl(MCSection *Section, const MCExpr *Subsection)
void emitLineTableForFunction(MCObjectStreamer &OS, unsigned FuncId, const MCSymbol *FuncBegin, const MCSymbol *FuncEnd)
Emits a line table substream.
Definition: MCCodeView.cpp:326
A eight-byte dtp relative fixup.
Definition: MCFixup.h:38
LLVMContext & Context
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:224
bool hasInstructions() const
Definition: MCSection.h:146
static void Make(MCObjectStreamer *MCOS, MCSection *Section)
Definition: MCDwarf.cpp:87
static const char *const BundlingNotImplementedMsg
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:329
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:155
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:140
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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:166
bool isVariable() const
isVariable - Check if this is a variable symbol.
Definition: MCSymbol.h:289
virtual bool mayNeedRelaxation(const MCInst &Inst, const MCSubtargetInfo &STI) const =0
Check whether the given instruction may need relaxation.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
virtual void addAddrsigSymbol(const MCSymbol *Sym)
Record the given symbol in the address-significance table to be written diring writeObject().
virtual bool requiresDiffExpressionRelocations() const
Check whether the given target requires emitting differences of two symbols as a set of relocations...
Definition: MCAsmBackend.h:132
virtual void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, MCInst &Res) const =0
Relax the instruction in the given fragment to the next wider instruction.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
virtual void EmitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &)
Emit an instruction to a special fragment, because this instruction can change its size during relaxa...
virtual void reset()
State management.
Definition: MCStreamer.cpp:99
MCFragment * emitDefRange(MCObjectStreamer &OS, ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>> Ranges, StringRef FixedSizePortion)
Definition: MCCodeView.cpp:434
static void EmitAdvanceLoc(MCObjectStreamer &Streamer, uint64_t AddrDelta)
Definition: MCDwarf.cpp:1891
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:543
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
F(f)
void EmitCVFileChecksumOffsetDirective(unsigned FileNo) override
This implements the CodeView &#39;.cv_filechecksumoffset&#39; assembler directive.
void EmitCVDefRangeDirective(ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>> Ranges, StringRef FixedSizePortion) override
This implements the CodeView &#39;.cv_def_range&#39; assembler directive.
block Block Frequency true
virtual void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo)
Emit the absolute difference between two symbols encoded with ULEB128.
void flushPendingLabels(MCFragment *F, uint64_t FOffset=0, unsigned Subsection=0)
Associate all pending labels in a subsection with a fragment.
Definition: MCSection.cpp:92
static void Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params, int64_t LineDelta, uint64_t AddrDelta)
Utility function to emit the encoding to a streamer.
Definition: MCDwarf.cpp:644
bool isBundlingEnabled() const
Definition: MCAssembler.h:320
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.
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize)
void EmitCVStringTableDirective() override
This implements the CodeView &#39;.cv_stringtable&#39; assembler directive.
virtual void EmitCFISections(bool EH, bool Debug)
Definition: MCStreamer.cpp:418
unsigned getAlignment() const
Definition: MCSection.h:126
void emitInlineLineTableForFunction(MCObjectStreamer &OS, unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
Definition: MCCodeView.cpp:421
MCContext & getContext() const
Definition: MCStreamer.h:266
unsigned getNumFrameInfos()
Definition: MCStreamer.cpp:113
void PrintMessage(raw_ostream &OS, SMLoc Loc, DiagKind Kind, const Twine &Msg, ArrayRef< SMRange > Ranges=None, ArrayRef< SMFixIt > FixIts=None, bool ShowColors=true) const
Emit a message about the specified location with the specified string.
Definition: SourceMgr.cpp:242
Definition: BitVector.h:937
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
void setHasInstructions(bool Value)
Definition: MCSection.h:147
void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override
Emit an weak reference from Alias to Symbol.
bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc, const MCSubtargetInfo &STI) override
Emit a .reloc directive.
MCCodeEmitter & getEmitter() const
Definition: MCAssembler.h:291
void flushPendingLabels()
Create a data fragment for any pending labels across all Sections and Subsections.
virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
A four-byte tp relative fixup.
Definition: MCFixup.h:39
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
bool registerSection(MCSection &Section)
MCSymbol * Begin
Definition: MCDwarf.h:609
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:169
MCObjectWriter & getWriter() const
Definition: MCAssembler.h:293
void setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
Definition: MCSymbol.h:266
bool mayHaveInstructions(MCSection &Sec) const override
void EmitBundleLock(bool AlignToEnd) override
The following instructions are a bundle-locked group.
void addPendingLabel(MCSymbol *label)
Assign a label to the current Section and Subsection even though a fragment is not yet present...
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Definition: MCStreamer.cpp:970
Context object for machine code objects.
Definition: MCContext.h:65
void EmitDTPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a dtprel (64-bit DTP relative) value.
A four-byte gp relative fixup.
Definition: MCFixup.h:35
void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc=SMLoc()) override
Emit Size bytes worth of the value specified by FillValue.
void EmitFileDirective(StringRef Filename) override
Switch to a new logical file.
virtual void alignBranchesBegin(MCObjectStreamer &OS, const MCInst &Inst)
Give the target a chance to manipulate state related to instruction alignment (e.g.
Definition: MCAsmBackend.h:56
Streaming object file generation interface.
void RemapDebugPaths()
Definition: MCContext.cpp:584
MCAssembler * getAssemblerPtr() override
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
bool isBundleLocked() const
Definition: MCSection.h:137
bool getUseAssemblerInfoForParsing()
Definition: MCStreamer.h:271
void EmitDTPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a dtprel (32-bit DTP relative) value.
SmallVectorImpl< char > & getContents()
Definition: MCFragment.h:184
virtual void EmitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers...
Definition: MCStreamer.cpp:131
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:158
static const MCBinaryExpr * create(Opcode Op, const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.cpp:158
void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) override
Emit the absolute difference between two symbols if possible.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:258
A four-byte dtp relative fixup.
Definition: MCFixup.h:37
void EmitULEB128Value(const MCExpr *Value) override
Streaming machine code generation interface.
Definition: MCStreamer.h:197
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
Definition: MCContext.cpp:226
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
void visitUsedSymbol(const MCSymbol &Sym) override
void EmitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc) override
This implements the CodeView &#39;.cv_loc&#39; assembler directive.
virtual void EmitCVLinetableDirective(unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd)
This implements the CodeView &#39;.cv_linetable&#39; assembler directive.
Definition: MCStreamer.cpp:323
void EmitSLEB128Value(const MCExpr *Value) override
void insert(MCFragment *F)
void EmitAddrsigSym(const MCSymbol *Sym) override
void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0) override
Emit nops until the byte alignment ByteAlignment is reached.
MCAssembler & getAssembler()
MCFixupKind
Extensible enumeration to represent the type of a fixup.
Definition: MCFixup.h:22
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCFragment.h:210
void setAlignment(Align Value)
Definition: MCSection.h:127
constexpr double e
Definition: MathExtras.h:57
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:690
uint64_t getOffset() const
Definition: MCSymbol.h:316
A eight-byte tp relative fixup.
Definition: MCFixup.h:40
void EmitFrames(MCAsmBackend *MAB)
const SourceMgr * getSourceManager() const
Definition: MCContext.h:314
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
Definition: MathExtras.h:434
void setOffset(uint64_t Value)
Definition: MCSymbol.h:322
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc())
Definition: MCFixup.h:93
size_t size() const
Definition: SmallVector.h:52
auto find(R &&Range, const T &Val) -> decltype(adl_begin(Range))
Provide wrappers to std::find which take ranges instead of having to pass begin/end explicitly...
Definition: STLExtras.h:1203
void emitValueToOffset(const MCExpr *Offset, unsigned char Value, SMLoc Loc) override
Emit some number of copies of Value until the byte offset Offset is reached.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:40
void clearDwarfLocSeen()
Definition: MCContext.h:613
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
static const MCExpr * buildSymbolDiff(MCObjectStreamer &OS, const MCSymbol *A, const MCSymbol *B)
void EmitCFISections(bool EH, bool Debug) override
void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel, const MCSymbol *Label)
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
MCAsmBackend * getBackendPtr() const
Definition: MCAssembler.h:283
virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size)
Emit the absolute difference between two symbols.
MCAsmBackend & getBackend() const
Definition: MCAssembler.h:289
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
const MCSymbol & getSymbol() const
Definition: MCExpr.h:342
ExprKind getKind() const
Definition: MCExpr.h:68
MCFragment * getFragment(bool SetUsed=true) const
Definition: MCSymbol.h:388
virtual void alignBranchesEnd(MCObjectStreamer &OS, const MCInst &Inst)
Definition: MCAsmBackend.h:57
virtual void EmitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
This implements the CodeView &#39;.cv_inline_linetable&#39; assembler directive.
Definition: MCStreamer.cpp:327
void EmitCVLinetableDirective(unsigned FunctionId, const MCSymbol *Begin, const MCSymbol *End) override
This implements the CodeView &#39;.cv_linetable&#39; assembler directive.
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:146
void addFileName(StringRef FileName)
Definition: MCAssembler.h:441
bool getRelaxAll() const
Definition: MCAssembler.h:317
void EmitBundleAlignMode(unsigned AlignPow2) override
Set the bundle alignment mode from now on in the section.
virtual void EmitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset)
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
Definition: MCSymbol.h:241
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:362
void recordCVLoc(MCContext &Ctx, const MCSymbol *Label, unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt)
Saves the information from the currently parsed .cv_loc directive and sets CVLocSeen.
Definition: MCCodeView.cpp:130
MCSection * getParent() const
Definition: MCFragment.h:87
bool hasInstructions() const
Does this fragment have instructions emitted into it? By default this is false, but specific fragment...
Definition: MCFragment.h:98
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
Definition: MCFragment.h:160
bool checkCVLocSection(unsigned FuncId, unsigned FileNo, SMLoc Loc)
Returns true if the the .cv_loc directive is in the right section.
Definition: MCStreamer.cpp:301
static void Emit(MCStreamer *MCOS)
Definition: MCDwarf.cpp:1136
static void emitDwarfSetLineAddr(MCObjectStreamer &OS, MCDwarfLineTableParams Params, int64_t LineDelta, const MCSymbol *Label, int PointerSize)
iterator begin() const
Definition: StringRef.h:122
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:387
void EmitTPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a tprel (32-bit TP relative) value.
static void Emit(MCObjectStreamer *MCOS, MCDwarfLineTableParams Params)
Definition: MCDwarf.cpp:232
MCDataFragment * getOrCreateDataFragment(const MCSubtargetInfo *STI=nullptr)
Get a data fragment to write into, creating a new one if the current fragment is not a data fragment...
bool hasValue() const
Definition: Optional.h:259
void EmitBundleUnlock() override
Ends a bundle-locked group.
void FinishImpl() override
Streamer specific finalization.
static Optional< uint64_t > absoluteSymbolDiff(MCAssembler &Asm, const MCSymbol *Hi, const MCSymbol *Lo)
void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
void reset() override
state management
static bool CanReuseDataFragment(const MCDataFragment &F, const MCAssembler &Assembler, const MCSubtargetInfo *STI)
Generic base class for all target subtargets.
void emitStringTable(MCObjectStreamer &OS)
Emits the string table substream.
Definition: MCCodeView.cpp:170
References to labels and assigned expressions.
Definition: MCExpr.h:40
uint32_t Size
Definition: Profile.cpp:46
void setAllowAutoPadding(bool v)
Definition: MCStreamer.h:277
void emitFileChecksumOffset(MCObjectStreamer &OS, unsigned FileNo)
Emits the offset into the checksum table of the given file number.
Definition: MCCodeView.cpp:247
void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc()) override
Emit the expression Value into the output as a native integer of the given Size bytes.
void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName) override
This implements the DWARF2 &#39;.loc fileno lineno ...&#39; assembler directive.
void EmitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym) override
This implements the CodeView &#39;.cv_inline_linetable&#39; assembler directive.
MCFragment * getCurrentFragment() const
CodeViewContext & getCVContext()
Definition: MCContext.cpp:680
static MCFixupKind getKindForSize(unsigned Size, bool IsPCRel)
Return the generic fixup kind for a value with the given size.
Definition: MCFixup.h:137
Fragment for data and encoded instructions.
Definition: MCFragment.h:229
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MCObjectStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection)
Definition: MCSection.cpp:57
LLVM Value Representation.
Definition: Value.h:74
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:38
static cl::opt< bool, true > Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag))
void EmitGPRel32Value(const MCExpr *Value) override
Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Definition: MCStreamer.cpp:400
Subtraction.
Definition: MCExpr.h:447
static void Emit(MCObjectStreamer &streamer, MCAsmBackend *MAB, bool isEH)
Definition: MCDwarf.cpp:1822
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54
FragmentListType::iterator iterator
Definition: MCSection.h:53
void EmitCVFileChecksumsDirective() override
This implements the CodeView &#39;.cv_filechecksums&#39; assembler directive.
Represents a location in source code.
Definition: SMLoc.h:23
bool isUIntN(unsigned N, uint64_t x)
Checks if an unsigned integer fits into the given (dynamic) bit width.
Definition: MathExtras.h:429
void emitFileChecksums(MCObjectStreamer &OS)
Emits the file checksum substream.
Definition: MCCodeView.cpp:192
virtual void emitAddrsigSection()
Tell the object writer to emit an address-significance table during writeObject().
iterator end() const
Definition: StringRef.h:124
void emitAbsoluteSymbolDiffAsULEB128(const MCSymbol *Hi, const MCSymbol *Lo) override
Emit the absolute difference between two symbols encoded with ULEB128.
void Finish()
Finish - Do final processing and write the object to the output stream.
void EmitGPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.
void EmitTPRel64Value(const MCExpr *Value) override
Emit the expression Value into the output as a tprel (64-bit TP relative) value.
void resize(size_type N)
Definition: SmallVector.h:344