LLVM  13.0.0git
MCELFStreamer.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCELFStreamer.cpp - ELF Object 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 // This file assembles .s files and emits ELF .o object files.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "llvm/MC/MCELFStreamer.h"
14 #include "llvm/ADT/SmallString.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/BinaryFormat/ELF.h"
17 #include "llvm/MC/MCAsmBackend.h"
18 #include "llvm/MC/MCAsmInfo.h"
19 #include "llvm/MC/MCAssembler.h"
20 #include "llvm/MC/MCCodeEmitter.h"
21 #include "llvm/MC/MCContext.h"
22 #include "llvm/MC/MCExpr.h"
23 #include "llvm/MC/MCFixup.h"
24 #include "llvm/MC/MCFragment.h"
26 #include "llvm/MC/MCObjectWriter.h"
27 #include "llvm/MC/MCSection.h"
28 #include "llvm/MC/MCSectionELF.h"
29 #include "llvm/MC/MCStreamer.h"
30 #include "llvm/MC/MCSymbol.h"
31 #include "llvm/MC/MCSymbolELF.h"
32 #include "llvm/Support/Casting.h"
36 #include <cassert>
37 #include <cstdint>
38 
39 using namespace llvm;
40 
42  std::unique_ptr<MCAsmBackend> TAB,
43  std::unique_ptr<MCObjectWriter> OW,
44  std::unique_ptr<MCCodeEmitter> Emitter)
45  : MCObjectStreamer(Context, std::move(TAB), std::move(OW),
46  std::move(Emitter)) {}
47 
48 bool MCELFStreamer::isBundleLocked() const {
50 }
51 
52 void MCELFStreamer::mergeFragment(MCDataFragment *DF,
53  MCDataFragment *EF) {
54  MCAssembler &Assembler = getAssembler();
55 
56  if (Assembler.isBundlingEnabled() && Assembler.getRelaxAll()) {
57  uint64_t FSize = EF->getContents().size();
58 
59  if (FSize > Assembler.getBundleAlignSize())
60  report_fatal_error("Fragment can't be larger than a bundle size");
61 
62  uint64_t RequiredBundlePadding = computeBundlePadding(
63  Assembler, EF, DF->getContents().size(), FSize);
64 
65  if (RequiredBundlePadding > UINT8_MAX)
66  report_fatal_error("Padding cannot exceed 255 bytes");
67 
68  if (RequiredBundlePadding > 0) {
69  SmallString<256> Code;
70  raw_svector_ostream VecOS(Code);
71  EF->setBundlePadding(static_cast<uint8_t>(RequiredBundlePadding));
72  Assembler.writeFragmentPadding(VecOS, *EF, FSize);
73 
74  DF->getContents().append(Code.begin(), Code.end());
75  }
76  }
77 
78  flushPendingLabels(DF, DF->getContents().size());
79 
80  for (unsigned i = 0, e = EF->getFixups().size(); i != e; ++i) {
81  EF->getFixups()[i].setOffset(EF->getFixups()[i].getOffset() +
82  DF->getContents().size());
83  DF->getFixups().push_back(EF->getFixups()[i]);
84  }
85  if (DF->getSubtargetInfo() == nullptr && EF->getSubtargetInfo())
86  DF->setHasInstructions(*EF->getSubtargetInfo());
87  DF->getContents().append(EF->getContents().begin(), EF->getContents().end());
88 }
89 
90 void MCELFStreamer::InitSections(bool NoExecStack) {
91  MCContext &Ctx = getContext();
94 
95  if (NoExecStack)
97 }
98 
100  auto *Symbol = cast<MCSymbolELF>(S);
102 
103  const MCSectionELF &Section =
104  static_cast<const MCSectionELF &>(*getCurrentSectionOnly());
105  if (Section.getFlags() & ELF::SHF_TLS)
106  Symbol->setType(ELF::STT_TLS);
107 }
108 
110  uint64_t Offset) {
111  auto *Symbol = cast<MCSymbolELF>(S);
113 
114  const MCSectionELF &Section =
115  static_cast<const MCSectionELF &>(*getCurrentSectionOnly());
116  if (Section.getFlags() & ELF::SHF_TLS)
117  Symbol->setType(ELF::STT_TLS);
118 }
119 
121  // Let the target do whatever target specific stuff it needs to do.
123  // Do any generic stuff we need to do.
124  switch (Flag) {
125  case MCAF_SyntaxUnified: return; // no-op here.
126  case MCAF_Code16: return; // Change parsing mode; no-op here.
127  case MCAF_Code32: return; // Change parsing mode; no-op here.
128  case MCAF_Code64: return; // Change parsing mode; no-op here.
131  return;
132  }
133 
134  llvm_unreachable("invalid assembler flag!");
135 }
136 
137 // If bundle alignment is used and there are any instructions in the section, it
138 // needs to be aligned to at least the bundle size.
139 static void setSectionAlignmentForBundling(const MCAssembler &Assembler,
140  MCSection *Section) {
141  if (Section && Assembler.isBundlingEnabled() && Section->hasInstructions() &&
142  Section->getAlignment() < Assembler.getBundleAlignSize())
143  Section->setAlignment(Align(Assembler.getBundleAlignSize()));
144 }
145 
147  const MCExpr *Subsection) {
148  MCSection *CurSection = getCurrentSectionOnly();
149  if (CurSection && isBundleLocked())
150  report_fatal_error("Unterminated .bundle_lock when changing a section");
151 
153  // Ensure the previous section gets aligned if necessary.
154  setSectionAlignmentForBundling(Asm, CurSection);
155  auto *SectionELF = static_cast<const MCSectionELF *>(Section);
156  const MCSymbol *Grp = SectionELF->getGroup();
157  if (Grp)
158  Asm.registerSymbol(*Grp);
159  if (SectionELF->getFlags() & ELF::SHF_GNU_RETAIN)
160  Asm.getWriter().markGnuAbi();
161 
162  changeSectionImpl(Section, Subsection);
163  Asm.registerSymbol(*Section->getBeginSymbol());
164 }
165 
170  Alias->setVariableValue(Value);
171 }
172 
173 // When GNU as encounters more than one .type declaration for an object it seems
174 // to use a mechanism similar to the one below to decide which type is actually
175 // used in the object file. The greater of T1 and T2 is selected based on the
176 // following ordering:
177 // STT_NOTYPE < STT_OBJECT < STT_FUNC < STT_GNU_IFUNC < STT_TLS < anything else
178 // If neither T1 < T2 nor T2 < T1 according to this ordering, use T2 (the user
179 // provided type).
180 static unsigned CombineSymbolTypes(unsigned T1, unsigned T2) {
183  if (T1 == Type)
184  return T2;
185  if (T2 == Type)
186  return T1;
187  }
188 
189  return T2;
190 }
191 
193  auto *Symbol = cast<MCSymbolELF>(S);
194 
195  // Adding a symbol attribute always introduces the symbol, note that an
196  // important side effect of calling registerSymbol here is to register
197  // the symbol with the assembler.
199 
200  // The implementation of symbol attributes is designed to match 'as', but it
201  // leaves much to desired. It doesn't really make sense to arbitrarily add and
202  // remove flags, but 'as' allows this (in particular, see .desc).
203  //
204  // In the future it might be worth trying to make these operations more well
205  // defined.
206  switch (Attribute) {
207  case MCSA_Cold:
208  case MCSA_Extern:
209  case MCSA_LazyReference:
210  case MCSA_Reference:
211  case MCSA_SymbolResolver:
212  case MCSA_PrivateExtern:
213  case MCSA_WeakDefinition:
215  case MCSA_Invalid:
216  case MCSA_IndirectSymbol:
217  return false;
218 
219  case MCSA_NoDeadStrip:
220  // Ignore for now.
221  break;
222 
224  Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_OBJECT));
225  Symbol->setBinding(ELF::STB_GNU_UNIQUE);
226  break;
227 
228  case MCSA_Global:
229  // For `.weak x; .global x`, GNU as sets the binding to STB_WEAK while we
230  // traditionally set the binding to STB_GLOBAL. This is error-prone, so we
231  // error on such cases. Note, we also disallow changed binding from .local.
232  if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_GLOBAL)
234  Symbol->getName() +
235  " changed binding to STB_GLOBAL");
236  Symbol->setBinding(ELF::STB_GLOBAL);
237  break;
238 
239  case MCSA_WeakReference:
240  case MCSA_Weak:
241  // For `.global x; .weak x`, both MC and GNU as set the binding to STB_WEAK.
242  // We emit a warning for now but may switch to an error in the future.
243  if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_WEAK)
245  getStartTokLoc(), Symbol->getName() + " changed binding to STB_WEAK");
246  Symbol->setBinding(ELF::STB_WEAK);
247  break;
248 
249  case MCSA_Local:
250  if (Symbol->isBindingSet() && Symbol->getBinding() != ELF::STB_LOCAL)
252  Symbol->getName() +
253  " changed binding to STB_LOCAL");
254  Symbol->setBinding(ELF::STB_LOCAL);
255  break;
256 
258  Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_FUNC));
259  break;
260 
262  Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_GNU_IFUNC));
263  break;
264 
265  case MCSA_ELF_TypeObject:
266  Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_OBJECT));
267  break;
268 
269  case MCSA_ELF_TypeTLS:
270  Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_TLS));
271  break;
272 
273  case MCSA_ELF_TypeCommon:
274  // TODO: Emit these as a common symbol.
275  Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_OBJECT));
276  break;
277 
278  case MCSA_ELF_TypeNoType:
279  Symbol->setType(CombineSymbolTypes(Symbol->getType(), ELF::STT_NOTYPE));
280  break;
281 
282  case MCSA_Protected:
283  Symbol->setVisibility(ELF::STV_PROTECTED);
284  break;
285 
286  case MCSA_Hidden:
287  Symbol->setVisibility(ELF::STV_HIDDEN);
288  break;
289 
290  case MCSA_Internal:
291  Symbol->setVisibility(ELF::STV_INTERNAL);
292  break;
293 
294  case MCSA_AltEntry:
295  llvm_unreachable("ELF doesn't support the .alt_entry attribute");
296 
297  case MCSA_LGlobal:
298  llvm_unreachable("ELF doesn't support the .lglobl attribute");
299  }
300 
301  return true;
302 }
303 
305  unsigned ByteAlignment) {
306  auto *Symbol = cast<MCSymbolELF>(S);
308 
309  if (!Symbol->isBindingSet())
310  Symbol->setBinding(ELF::STB_GLOBAL);
311 
312  Symbol->setType(ELF::STT_OBJECT);
313 
314  if (Symbol->getBinding() == ELF::STB_LOCAL) {
319 
321  emitLabel(Symbol);
322  emitZeros(Size);
323 
324  SwitchSection(P.first, P.second);
325  } else {
326  if(Symbol->declareCommon(Size, ByteAlignment))
327  report_fatal_error("Symbol: " + Symbol->getName() +
328  " redeclared as different type");
329  }
330 
331  cast<MCSymbolELF>(Symbol)
332  ->setSize(MCConstantExpr::create(Size, getContext()));
333 }
334 
336  cast<MCSymbolELF>(Symbol)->setSize(Value);
337 }
338 
340  StringRef Name,
341  bool KeepOriginalSym) {
343  getStartTokLoc(), OriginalSym, Name, KeepOriginalSym});
344 }
345 
347  unsigned ByteAlignment) {
348  auto *Symbol = cast<MCSymbolELF>(S);
349  // FIXME: Should this be caught and done earlier?
351  Symbol->setBinding(ELF::STB_LOCAL);
353 }
354 
356  SMLoc Loc) {
357  if (isBundleLocked())
358  report_fatal_error("Emitting values inside a locked bundle is forbidden");
359  fixSymbolsInTLSFixups(Value);
361 }
362 
364  int64_t Value,
365  unsigned ValueSize,
366  unsigned MaxBytesToEmit) {
367  if (isBundleLocked())
368  report_fatal_error("Emitting values inside a locked bundle is forbidden");
370  ValueSize, MaxBytesToEmit);
371 }
372 
374  const MCSymbolRefExpr *To,
375  uint64_t Count) {
376  getAssembler().CGProfile.push_back({From, To, Count});
377 }
378 
382  PushSection();
383  SwitchSection(Comment);
384  if (!SeenIdent) {
385  emitInt8(0);
386  SeenIdent = true;
387  }
388  emitBytes(IdentString);
389  emitInt8(0);
390  PopSection();
391 }
392 
393 void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
394  switch (expr->getKind()) {
395  case MCExpr::Target:
396  cast<MCTargetExpr>(expr)->fixELFSymbolsInTLSFixups(getAssembler());
397  break;
398  case MCExpr::Constant:
399  break;
400 
401  case MCExpr::Binary: {
402  const MCBinaryExpr *be = cast<MCBinaryExpr>(expr);
403  fixSymbolsInTLSFixups(be->getLHS());
404  fixSymbolsInTLSFixups(be->getRHS());
405  break;
406  }
407 
408  case MCExpr::SymbolRef: {
409  const MCSymbolRefExpr &symRef = *cast<MCSymbolRefExpr>(expr);
410  switch (symRef.getKind()) {
411  default:
412  return;
467  break;
468  }
470  cast<MCSymbolELF>(symRef.getSymbol()).setType(ELF::STT_TLS);
471  break;
472  }
473 
474  case MCExpr::Unary:
475  fixSymbolsInTLSFixups(cast<MCUnaryExpr>(expr)->getSubExpr());
476  break;
477  }
478 }
479 
480 void MCELFStreamer::finalizeCGProfileEntry(const MCSymbolRefExpr *&SRE) {
481  const MCSymbol *S = &SRE->getSymbol();
482  if (S->isTemporary()) {
483  if (!S->isInSection()) {
485  SRE->getLoc(), Twine("Reference to undefined temporary symbol ") +
486  "`" + S->getName() + "`");
487  return;
488  }
489  S = S->getSection().getBeginSymbol();
490  S->setUsedInReloc();
491  SRE =
492  MCSymbolRefExpr::create(S, SRE->getKind(), getContext(), SRE->getLoc());
493  return;
494  }
495  // Not a temporary, referece it as a weak undefined.
496  bool Created;
497  getAssembler().registerSymbol(*S, &Created);
498  if (Created)
499  cast<MCSymbolELF>(S)->setBinding(ELF::STB_WEAK);
500 }
501 
502 void MCELFStreamer::finalizeCGProfile() {
503  for (MCAssembler::CGProfileEntry &E : getAssembler().CGProfile) {
504  finalizeCGProfileEntry(E.From);
505  finalizeCGProfileEntry(E.To);
506  }
507 }
508 
509 void MCELFStreamer::emitInstToFragment(const MCInst &Inst,
510  const MCSubtargetInfo &STI) {
511  this->MCObjectStreamer::emitInstToFragment(Inst, STI);
512  MCRelaxableFragment &F = *cast<MCRelaxableFragment>(getCurrentFragment());
513 
514  for (auto &Fixup : F.getFixups())
515  fixSymbolsInTLSFixups(Fixup.getValue());
516 }
517 
518 // A fragment can only have one Subtarget, and when bundling is enabled we
519 // sometimes need to use the same fragment. We give an error if there
520 // are conflicting Subtargets.
521 static void CheckBundleSubtargets(const MCSubtargetInfo *OldSTI,
522  const MCSubtargetInfo *NewSTI) {
523  if (OldSTI && NewSTI && OldSTI != NewSTI)
524  report_fatal_error("A Bundle can only have one Subtarget.");
525 }
526 
527 void MCELFStreamer::emitInstToData(const MCInst &Inst,
528  const MCSubtargetInfo &STI) {
529  MCAssembler &Assembler = getAssembler();
532  raw_svector_ostream VecOS(Code);
533  Assembler.getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);
534 
535  for (auto &Fixup : Fixups)
536  fixSymbolsInTLSFixups(Fixup.getValue());
537 
538  // There are several possibilities here:
539  //
540  // If bundling is disabled, append the encoded instruction to the current data
541  // fragment (or create a new such fragment if the current fragment is not a
542  // data fragment, or the Subtarget has changed).
543  //
544  // If bundling is enabled:
545  // - If we're not in a bundle-locked group, emit the instruction into a
546  // fragment of its own. If there are no fixups registered for the
547  // instruction, emit a MCCompactEncodedInstFragment. Otherwise, emit a
548  // MCDataFragment.
549  // - If we're in a bundle-locked group, append the instruction to the current
550  // data fragment because we want all the instructions in a group to get into
551  // the same fragment. Be careful not to do that for the first instruction in
552  // the group, though.
554 
555  if (Assembler.isBundlingEnabled()) {
557  if (Assembler.getRelaxAll() && isBundleLocked()) {
558  // If the -mc-relax-all flag is used and we are bundle-locked, we re-use
559  // the current bundle group.
560  DF = BundleGroups.back();
561  CheckBundleSubtargets(DF->getSubtargetInfo(), &STI);
562  }
563  else if (Assembler.getRelaxAll() && !isBundleLocked())
564  // When not in a bundle-locked group and the -mc-relax-all flag is used,
565  // we create a new temporary fragment which will be later merged into
566  // the current fragment.
567  DF = new MCDataFragment();
568  else if (isBundleLocked() && !Sec.isBundleGroupBeforeFirstInst()) {
569  // If we are bundle-locked, we re-use the current fragment.
570  // The bundle-locking directive ensures this is a new data fragment.
571  DF = cast<MCDataFragment>(getCurrentFragment());
572  CheckBundleSubtargets(DF->getSubtargetInfo(), &STI);
573  }
574  else if (!isBundleLocked() && Fixups.size() == 0) {
575  // Optimize memory usage by emitting the instruction to a
576  // MCCompactEncodedInstFragment when not in a bundle-locked group and
577  // there are no fixups registered.
579  insert(CEIF);
580  CEIF->getContents().append(Code.begin(), Code.end());
581  CEIF->setHasInstructions(STI);
582  return;
583  } else {
584  DF = new MCDataFragment();
585  insert(DF);
586  }
588  // If this fragment is for a group marked "align_to_end", set a flag
589  // in the fragment. This can happen after the fragment has already been
590  // created if there are nested bundle_align groups and an inner one
591  // is the one marked align_to_end.
592  DF->setAlignToBundleEnd(true);
593  }
594 
595  // We're now emitting an instruction in a bundle group, so this flag has
596  // to be turned off.
598  } else {
599  DF = getOrCreateDataFragment(&STI);
600  }
601 
602  // Add the fixups and data.
603  for (auto &Fixup : Fixups) {
604  Fixup.setOffset(Fixup.getOffset() + DF->getContents().size());
605  DF->getFixups().push_back(Fixup);
606  }
607 
608  DF->setHasInstructions(STI);
609  DF->getContents().append(Code.begin(), Code.end());
610 
611  if (Assembler.isBundlingEnabled() && Assembler.getRelaxAll()) {
612  if (!isBundleLocked()) {
613  mergeFragment(getOrCreateDataFragment(&STI), DF);
614  delete DF;
615  }
616  }
617 }
618 
619 void MCELFStreamer::emitBundleAlignMode(unsigned AlignPow2) {
620  assert(AlignPow2 <= 30 && "Invalid bundle alignment");
621  MCAssembler &Assembler = getAssembler();
622  if (AlignPow2 > 0 && (Assembler.getBundleAlignSize() == 0 ||
623  Assembler.getBundleAlignSize() == 1U << AlignPow2))
624  Assembler.setBundleAlignSize(1U << AlignPow2);
625  else
626  report_fatal_error(".bundle_align_mode cannot be changed once set");
627 }
628 
629 void MCELFStreamer::emitBundleLock(bool AlignToEnd) {
631 
632  // Sanity checks
633  //
634  if (!getAssembler().isBundlingEnabled())
635  report_fatal_error(".bundle_lock forbidden when bundling is disabled");
636 
637  if (!isBundleLocked())
639 
640  if (getAssembler().getRelaxAll() && !isBundleLocked()) {
641  // TODO: drop the lock state and set directly in the fragment
643  BundleGroups.push_back(DF);
644  }
645 
648 }
649 
652 
653  // Sanity checks
654  if (!getAssembler().isBundlingEnabled())
655  report_fatal_error(".bundle_unlock forbidden when bundling is disabled");
656  else if (!isBundleLocked())
657  report_fatal_error(".bundle_unlock without matching lock");
658  else if (Sec.isBundleGroupBeforeFirstInst())
659  report_fatal_error("Empty bundle-locked group is forbidden");
660 
661  // When the -mc-relax-all flag is used, we emit instructions to fragments
662  // stored on a stack. When the bundle unlock is emitted, we pop a fragment
663  // from the stack a merge it to the one below.
664  if (getAssembler().getRelaxAll()) {
665  assert(!BundleGroups.empty() && "There are no bundle groups");
666  MCDataFragment *DF = BundleGroups.back();
667 
668  // FIXME: Use BundleGroups to track the lock state instead.
670 
671  // FIXME: Use more separate fragments for nested groups.
672  if (!isBundleLocked()) {
673  mergeFragment(getOrCreateDataFragment(DF->getSubtargetInfo()), DF);
674  BundleGroups.pop_back();
675  delete DF;
676  }
677 
680  } else
682 }
683 
685  // Ensure the last section gets aligned if necessary.
686  MCSection *CurSection = getCurrentSectionOnly();
688 
689  finalizeCGProfile();
690  emitFrames(nullptr);
691 
693 }
694 
696  llvm_unreachable("Generic ELF doesn't support this directive");
697 }
698 
699 void MCELFStreamer::emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
700  llvm_unreachable("ELF doesn't support this directive");
701 }
702 
704  uint64_t Size, unsigned ByteAlignment,
705  SMLoc Loc) {
706  llvm_unreachable("ELF doesn't support this directive");
707 }
708 
710  uint64_t Size, unsigned ByteAlignment) {
711  llvm_unreachable("ELF doesn't support this directive");
712 }
713 
715  std::unique_ptr<MCAsmBackend> &&MAB,
716  std::unique_ptr<MCObjectWriter> &&OW,
717  std::unique_ptr<MCCodeEmitter> &&CE,
718  bool RelaxAll) {
719  MCELFStreamer *S =
720  new MCELFStreamer(Context, std::move(MAB), std::move(OW), std::move(CE));
721  if (RelaxAll)
722  S->getAssembler().setRelaxAll(true);
723  return S;
724 }
llvm::ELF::SHF_GNU_RETAIN
@ SHF_GNU_RETAIN
Definition: ELF.h:1014
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::MCAssembler::getBackend
MCAsmBackend & getBackend() const
Definition: MCAssembler.h:300
llvm::MCSection::isBundleLocked
bool isBundleLocked() const
Definition: MCSection.h:142
llvm::MCSymbolRefExpr::getKind
VariantKind getKind() const
Definition: MCExpr.h:399
i
i
Definition: README.txt:29
llvm::MCContext::getObjectFileInfo
const MCObjectFileInfo * getObjectFileInfo() const
Definition: MCContext.h:423
llvm
Definition: AllocatorList.h:23
llvm::MCRelaxableFragment
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:271
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MCEncodedFragment::setHasInstructions
void setHasInstructions(const MCSubtargetInfo &STI)
Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instructio...
Definition: MCFragment.h:177
llvm::MCObjectStreamer::emitLabel
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Definition: MCObjectStreamer.cpp:269
llvm::MCAssembler::Symvers
std::vector< Symver > Symvers
Definition: MCAssembler.h:221
llvm::MCELFStreamer::emitLabel
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
Definition: MCELFStreamer.cpp:99
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HA
@ VK_PPC_TPREL_HA
Definition: MCExpr.h:269
llvm::MCAssembler::registerSymbol
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
Definition: MCAssembler.cpp:463
llvm::MCSection::setBundleLockState
void setBundleLockState(BundleLockStateType NewState)
Definition: MCSection.cpp:39
llvm::MCObjectStreamer::emitValueToAlignment
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.
Definition: MCObjectStreamer.cpp:602
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHER
@ VK_PPC_DTPREL_HIGHER
Definition: MCExpr.h:281
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHEST
@ VK_PPC_DTPREL_HIGHEST
Definition: MCExpr.h:283
llvm::MCSymbolRefExpr::VK_PPC_TLSGD
@ VK_PPC_TLSGD
Definition: MCExpr.h:298
llvm::MCSymbolRefExpr::VK_INDNTPOFF
@ VK_INDNTPOFF
Definition: MCExpr.h:204
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:71
llvm::Attribute
Definition: Attributes.h:52
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::MCSA_ELF_TypeObject
@ MCSA_ELF_TypeObject
.type _foo, STT_OBJECT # aka @object
Definition: MCDirectives.h:25
MCCodeEmitter.h
llvm::MCSA_Invalid
@ MCSA_Invalid
Not a valid directive.
Definition: MCDirectives.h:19
llvm::MCELFStreamer::emitZerofill
void emitZerofill(MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, unsigned ByteAlignment=0, SMLoc L=SMLoc()) override
Emit the zerofill section and an optional symbol.
Definition: MCELFStreamer.cpp:703
llvm::MCConstantExpr::create
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition: MCExpr.cpp:194
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_HI
@ VK_PPC_GOT_TPREL_HI
Definition: MCExpr.h:287
MCSectionELF.h
llvm::MCStreamer::emitInt8
void emitInt8(uint64_t Value)
Definition: MCStreamer.h:700
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::tgtok::Code
@ Code
Definition: TGLexer.h:50
llvm::MCELFStreamer::changeSection
void changeSection(MCSection *Section, const MCExpr *Subsection) override
Update streamer for a new active section.
Definition: MCELFStreamer.cpp:146
llvm::MCAsmBackend::handleAssemblerFlag
virtual void handleAssemblerFlag(MCAssemblerFlag Flag)
Handle any target-specific assembler flags. By default, do nothing.
Definition: MCAsmBackend.h:195
ErrorHandling.h
MCFragment.h
llvm::ELF::STB_LOCAL
@ STB_LOCAL
Definition: ELF.h:1133
MCAssembler.h
llvm::MCELFStreamer::MCELFStreamer
MCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Definition: MCELFStreamer.cpp:41
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HI
@ VK_PPC_GOT_TLSGD_HI
Definition: MCExpr.h:296
llvm::ELF::STT_GNU_IFUNC
@ STT_GNU_IFUNC
Definition: ELF.h:1152
MCObjectFileInfo.h
llvm::MCObjectStreamer::emitLabelAtPos
virtual void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset)
Definition: MCObjectStreamer.cpp:293
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HI
@ VK_PPC_DTPREL_HI
Definition: MCExpr.h:277
llvm::MCSection::getBundleLockState
BundleLockStateType getBundleLockState() const
Definition: MCSection.h:140
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::MCELFStreamer::emitTBSSSymbol
void emitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0) override
Emit a thread local bss (.tbss) symbol.
Definition: MCELFStreamer.cpp:709
llvm::ELF::STB_GLOBAL
@ STB_GLOBAL
Definition: ELF.h:1134
T1
#define T1
Definition: Mips16ISelLowering.cpp:340
llvm::ELF::STV_INTERNAL
@ STV_INTERNAL
Definition: ELF.h:1164
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::MCSA_ELF_TypeNoType
@ MCSA_ELF_TypeNoType
.type _foo, STT_NOTYPE # aka @notype
Definition: MCDirectives.h:28
llvm::MCStreamer::getCurrentSection
MCSectionSubPair getCurrentSection() const
Return the current section that the streamer is emitting code to.
Definition: MCStreamer.h:369
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_LO
@ VK_PPC_GOT_TLSGD_LO
Definition: MCExpr.h:295
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHESTA
@ VK_PPC_DTPREL_HIGHESTA
Definition: MCExpr.h:284
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:183
llvm::MCEncodedFragmentWithFixups::getFixups
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCFragment.h:223
llvm::MCSectionELF
This represents a section on linux, lots of unix variants and some bare metal systems.
Definition: MCSectionELF.h:28
llvm::MCAssemblerFlag
MCAssemblerFlag
Definition: MCDirectives.h:50
llvm::MCSymbol::setVariableValue
void setVariableValue(const MCExpr *Value)
Definition: MCSymbol.cpp:48
llvm::MCSection::setBundleGroupBeforeFirstInst
void setBundleGroupBeforeFirstInst(bool IsFirst)
Definition: MCSection.h:147
llvm::MCBinaryExpr
Binary assembler expressions.
Definition: MCExpr.h:479
llvm::ELF::SHF_WRITE
@ SHF_WRITE
Definition: ELF.h:980
llvm::ELF::SHT_NOBITS
@ SHT_NOBITS
Definition: ELF.h:912
llvm::ELF::STB_GNU_UNIQUE
@ STB_GNU_UNIQUE
Definition: ELF.h:1136
MCELFStreamer.h
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::MCSymbolAttr
MCSymbolAttr
Definition: MCDirectives.h:18
llvm::MCSA_Cold
@ MCSA_Cold
.cold (MachO)
Definition: MCDirectives.h:22
llvm::MCSA_Local
@ MCSA_Local
.local (ELF)
Definition: MCDirectives.h:37
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHA
@ VK_PPC_TPREL_HIGHA
Definition: MCExpr.h:271
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::MCSA_NoDeadStrip
@ MCSA_NoDeadStrip
.no_dead_strip (MachO)
Definition: MCDirectives.h:38
llvm::MCSymbolRefExpr::VK_PPC_TLS
@ VK_PPC_TLS
Definition: MCExpr.h:293
llvm::MCFragment
Definition: MCFragment.h:31
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:197
llvm::MCSymbolRefExpr::VK_NTPOFF
@ VK_NTPOFF
Definition: MCExpr.h:205
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_PCREL
@ VK_PPC_GOT_TLSGD_PCREL
Definition: MCExpr.h:306
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL_LO
@ VK_PPC_GOT_DTPREL_LO
Definition: MCExpr.h:290
ELF.h
llvm::MCELFStreamer
Definition: MCELFStreamer.h:23
MCAsmBackend.h
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
SmallString.h
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHEST
@ VK_PPC_TPREL_HIGHEST
Definition: MCExpr.h:274
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::SmallVectorImpl::append
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:648
llvm::MCAssembler::getContext
MCContext & getContext() const
Definition: MCAssembler.h:292
llvm::MCExpr::Target
@ Target
Target specific expression.
Definition: MCExpr.h:42
llvm::MCSA_Extern
@ MCSA_Extern
.extern (XCOFF)
Definition: MCDirectives.h:32
llvm::MCSA_AltEntry
@ MCSA_AltEntry
.alt_entry (MachO)
Definition: MCDirectives.h:40
llvm::MCObjectStreamer::emitValueImpl
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.
Definition: MCObjectStreamer.cpp:227
MCSymbolELF.h
llvm::MCSA_Protected
@ MCSA_Protected
.protected (ELF)
Definition: MCDirectives.h:42
MCContext.h
llvm::MCSymbolRefExpr::VK_GOTNTPOFF
@ VK_GOTNTPOFF
Definition: MCExpr.h:206
llvm::MCSymbolRefExpr::VK_DTPREL
@ VK_DTPREL
Definition: MCExpr.h:356
llvm::ELF::STB_WEAK
@ STB_WEAK
Definition: ELF.h:1135
MCSymbol.h
llvm::MCSA_LazyReference
@ MCSA_LazyReference
.lazy_reference (MachO)
Definition: MCDirectives.h:36
llvm::MCELFStreamer::emitCGProfileEntry
void emitCGProfileEntry(const MCSymbolRefExpr *From, const MCSymbolRefExpr *To, uint64_t Count) override
Definition: MCELFStreamer.cpp:373
llvm::MCSA_LGlobal
@ MCSA_LGlobal
.lglobl (XCOFF)
Definition: MCDirectives.h:31
llvm::MCContext::getELFSection
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Definition: MCContext.h:536
llvm::MCSymbolRefExpr::VK_TLSLDM
@ VK_TLSLDM
Definition: MCExpr.h:210
llvm::MCAF_Code16
@ MCAF_Code16
.code16 (X86) / .code 16 (ARM)
Definition: MCDirectives.h:53
llvm::MCObjectStreamer
Streaming object file generation interface.
Definition: MCObjectStreamer.h:36
llvm::MCSA_ELF_TypeIndFunction
@ MCSA_ELF_TypeIndFunction
.type _foo, STT_GNU_IFUNC
Definition: MCDirectives.h:24
llvm::AArch64::Fixups
Fixups
Definition: AArch64FixupKinds.h:17
llvm::MCSA_Reference
@ MCSA_Reference
.reference (MachO)
Definition: MCDirectives.h:43
llvm::MCELFStreamer::emitBundleLock
void emitBundleLock(bool AlignToEnd) override
The following instructions are a bundle-locked group.
Definition: MCELFStreamer.cpp:629
llvm::MCID::Flag
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:146
be
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can be
Definition: README.txt:14
llvm::report_fatal_error
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
llvm::MCSymbolRefExpr::getSymbol
const MCSymbol & getSymbol() const
Definition: MCExpr.h:397
llvm::ELF::STV_HIDDEN
@ STV_HIDDEN
Definition: ELF.h:1165
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHERA
@ VK_PPC_DTPREL_HIGHERA
Definition: MCExpr.h:282
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HA
@ VK_PPC_GOT_DTPREL_HA
Definition: MCExpr.h:292
llvm::MCELFStreamer::emitWeakReference
void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override
Emit an weak reference from Alias to Symbol.
Definition: MCELFStreamer.cpp:166
llvm::MCSA_Hidden
@ MCSA_Hidden
.hidden (ELF)
Definition: MCDirectives.h:33
llvm::MCSymbolRefExpr::VK_TLSLD
@ VK_TLSLD
Definition: MCExpr.h:209
llvm::MCELFStreamer::emitCommonSymbol
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
Definition: MCELFStreamer.cpp:304
llvm::MCSA_ELF_TypeGnuUniqueObject
@ MCSA_ELF_TypeGnuUniqueObject
Definition: MCDirectives.h:29
Align
uint64_t Align
Definition: ELFObjHandler.cpp:83
llvm::MCELFStreamer::emitLabelAtPos
void emitLabelAtPos(MCSymbol *Symbol, SMLoc Loc, MCFragment *F, uint64_t Offset) override
Definition: MCELFStreamer.cpp:109
llvm::MCExpr::getKind
ExprKind getKind() const
Definition: MCExpr.h:81
llvm::MCObjectStreamer::getCurrentFragment
MCFragment * getCurrentFragment() const
Definition: MCObjectStreamer.cpp:184
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HI
@ VK_PPC_TPREL_HI
Definition: MCExpr.h:268
llvm::MCAssembler::setBundleAlignSize
void setBundleAlignSize(unsigned Size)
Definition: MCAssembler.h:335
llvm::ELF::STT_TLS
@ STT_TLS
Definition: ELF.h:1151
llvm::MCStreamer::getCurrentSectionOnly
MCSection * getCurrentSectionOnly() const
Definition: MCStreamer.h:374
llvm::MCObjectFileInfo::getTextSection
MCSection * getTextSection() const
Definition: MCObjectFileInfo.h:254
llvm::MCExpr::Binary
@ Binary
Binary expressions.
Definition: MCExpr.h:38
DF
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
llvm::SmallString< 256 >
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_PCREL
@ VK_PPC_GOT_TPREL_PCREL
Definition: MCExpr.h:308
llvm::MCELFStreamer::emitValueToAlignment
void emitValueToAlignment(unsigned, int64_t, unsigned, unsigned) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
Definition: MCELFStreamer.cpp:363
llvm::MCELFStreamer::emitThumbFunc
void emitThumbFunc(MCSymbol *Func) override
Note in the output that the specified Func is a Thumb mode function (ARM target only).
Definition: MCELFStreamer.cpp:695
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL_HI
@ VK_PPC_GOT_DTPREL_HI
Definition: MCExpr.h:291
llvm::MCSA_WeakDefAutoPrivate
@ MCSA_WeakDefAutoPrivate
.weak_def_can_be_hidden (MachO)
Definition: MCDirectives.h:47
llvm::MCELFStreamer::finishImpl
void finishImpl() override
Streamer specific finalization.
Definition: MCELFStreamer.cpp:684
llvm::MCSection::BundleLockedAlignToEnd
@ BundleLockedAlignToEnd
Definition: MCSection.h:49
llvm::MCELFStreamer::emitELFSymverDirective
void emitELFSymverDirective(const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym) override
Emit an ELF .symver directive.
Definition: MCELFStreamer.cpp:339
llvm::MCSymbolRefExpr::VK_PPC_TLSLD
@ VK_PPC_TLSLD
Definition: MCExpr.h:310
llvm::ELF::SHT_PROGBITS
@ SHT_PROGBITS
Definition: ELF.h:905
llvm::MCAssembler
Definition: MCAssembler.h:60
llvm::MCAssembler::getEmitter
MCCodeEmitter & getEmitter() const
Definition: MCAssembler.h:302
llvm::MCAF_SubsectionsViaSymbols
@ MCAF_SubsectionsViaSymbols
.subsections_via_symbols (MachO)
Definition: MCDirectives.h:52
llvm::MCELFStreamer::emitLocalCommonSymbol
void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a local common (.lcomm) symbol.
Definition: MCELFStreamer.cpp:346
llvm::MCCompactEncodedInstFragment
This is a compact (memory-size-wise) fragment for holding an encoded instruction (non-relaxable) that...
Definition: MCFragment.h:257
llvm::MCContext::getAsmInfo
const MCAsmInfo * getAsmInfo() const
Definition: MCContext.h:419
llvm::MCSymbolRefExpr::VK_PPC_TLS_PCREL
@ VK_PPC_TLS_PCREL
Definition: MCExpr.h:309
llvm::MCSA_WeakReference
@ MCSA_WeakReference
.weak_reference (MachO)
Definition: MCDirectives.h:46
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::MCELFStreamer::emitIdent
void emitIdent(StringRef IdentString) override
Emit the "identifiers" directive.
Definition: MCELFStreamer.cpp:379
llvm::numbers::e
constexpr double e
Definition: MathExtras.h:57
llvm::MCELFStreamer::emitSymbolDesc
void emitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override
Set the DescValue for the Symbol.
Definition: MCELFStreamer.cpp:699
llvm::MCEncodedFragment::setBundlePadding
void setBundlePadding(uint8_t N)
Set the padding size for this fragment.
Definition: MCFragment.h:169
llvm::MCSymbolRefExpr::VK_TLSDESC
@ VK_TLSDESC
Definition: MCExpr.h:214
llvm::MCAssembler::getBundleAlignSize
unsigned getBundleAlignSize() const
Definition: MCAssembler.h:333
llvm::ELF::SHF_ALLOC
@ SHF_ALLOC
Definition: ELF.h:983
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD
@ VK_PPC_GOT_TLSGD
Definition: MCExpr.h:294
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL
@ VK_PPC_GOT_TPREL
Definition: MCExpr.h:285
llvm::ELF::STT_NOTYPE
@ STT_NOTYPE
Definition: ELF.h:1145
llvm::MCStreamer::getStartTokLoc
SMLoc getStartTokLoc() const
Definition: MCStreamer.h:270
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGH
@ VK_PPC_TPREL_HIGH
Definition: MCExpr.h:270
llvm::MCStreamer::PopSection
bool PopSection()
Restore the current and previous section from the section stack.
Definition: MCStreamer.h:405
llvm::MCObjectStreamer::insert
void insert(MCFragment *F)
Definition: MCObjectStreamer.h:78
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1540
llvm::MCSymbolRefExpr::VK_TLSCALL
@ VK_TLSCALL
Definition: MCExpr.h:213
llvm::MCContext::reportError
void reportError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:948
llvm::MCAssembler::getRelaxAll
bool getRelaxAll() const
Definition: MCAssembler.h:328
llvm::MCSymbolRefExpr::VK_PPC_TPREL_LO
@ VK_PPC_TPREL_LO
Definition: MCExpr.h:267
llvm::MCSymbolRefExpr::VK_PPC_GOT_DTPREL
@ VK_PPC_GOT_DTPREL
Definition: MCExpr.h:289
llvm::MCSymbolRefExpr
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:192
llvm::MCSymbolRefExpr::VK_TPOFF
@ VK_TPOFF
Definition: MCExpr.h:211
MCSection.h
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_LO
@ VK_PPC_DTPREL_LO
Definition: MCExpr.h:276
llvm::MCObjectStreamer::getAssembler
MCAssembler & getAssembler()
Definition: MCObjectStreamer.h:112
llvm::MCELFStreamer::emitValueImpl
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.
Definition: MCELFStreamer.cpp:355
llvm::MCObjectStreamer::getOrCreateDataFragment
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.
Definition: MCObjectStreamer.cpp:208
MCAsmInfo.h
Fixup
PowerPC TLS Dynamic Call Fixup
Definition: PPCTLSDynamicCall.cpp:235
llvm::MCObjectStreamer::changeSectionImpl
bool changeSectionImpl(MCSection *Section, const MCExpr *Subsection)
Definition: MCObjectStreamer.cpp:339
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::MCAssembler::Symver
Definition: MCAssembler.h:214
MCFixup.h
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_LO
@ VK_PPC_GOT_TLSLD_LO
Definition: MCExpr.h:302
llvm::MCSA_ELF_TypeTLS
@ MCSA_ELF_TypeTLS
.type _foo, STT_TLS # aka @tls_object
Definition: MCDirectives.h:26
llvm::MCObjectStreamer::emitInstToFragment
virtual void emitInstToFragment(const MCInst &Inst, const MCSubtargetInfo &)
Emit an instruction to a special fragment, because this instruction can change its size during relaxa...
Definition: MCObjectStreamer.cpp:419
llvm::MCSA_IndirectSymbol
@ MCSA_IndirectSymbol
.indirect_symbol (MachO)
Definition: MCDirectives.h:34
CombineSymbolTypes
static unsigned CombineSymbolTypes(unsigned T1, unsigned T2)
Definition: MCELFStreamer.cpp:180
llvm::MCSymbolRefExpr::VK_WEAKREF
@ VK_WEAKREF
Definition: MCExpr.h:224
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHER
@ VK_PPC_TPREL_HIGHER
Definition: MCExpr.h:272
llvm::MCSA_Internal
@ MCSA_Internal
.internal (ELF)
Definition: MCDirectives.h:35
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHESTA
@ VK_PPC_TPREL_HIGHESTA
Definition: MCExpr.h:275
llvm::MCAF_Code32
@ MCAF_Code32
.code32 (X86) / .code 32 (ARM)
Definition: MCDirectives.h:54
llvm::MCSA_ELF_TypeCommon
@ MCSA_ELF_TypeCommon
.type _foo, STT_COMMON # aka @common
Definition: MCDirectives.h:27
llvm::MCSection::BundleLocked
@ BundleLocked
Definition: MCSection.h:48
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_LO
@ VK_PPC_GOT_TPREL_LO
Definition: MCExpr.h:286
llvm::createELFStreamer
MCStreamer * createELFStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll)
Definition: MCELFStreamer.cpp:714
llvm::MCSection::isBundleGroupBeforeFirstInst
bool isBundleGroupBeforeFirstInst() const
Definition: MCSection.h:144
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HI
@ VK_PPC_GOT_TLSLD_HI
Definition: MCExpr.h:303
llvm::MCAF_Code64
@ MCAF_Code64
.code64 (X86)
Definition: MCDirectives.h:55
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_HA
@ VK_PPC_GOT_TLSGD_HA
Definition: MCExpr.h:297
MCObjectWriter.h
llvm::MCSymbolRefExpr::VK_TPREL
@ VK_TPREL
Definition: MCExpr.h:355
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
llvm::MCELFStreamer::emitBundleAlignMode
void emitBundleAlignMode(unsigned AlignPow2) override
Set the bundle alignment mode from now on in the section.
Definition: MCELFStreamer.cpp:619
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGH
@ VK_PPC_DTPREL_HIGH
Definition: MCExpr.h:279
llvm::MCSymbolRefExpr::VK_PPC_TPREL_HIGHERA
@ VK_PPC_TPREL_HIGHERA
Definition: MCExpr.h:273
llvm::MCAF_SyntaxUnified
@ MCAF_SyntaxUnified
.syntax (ARM/ELF)
Definition: MCDirectives.h:51
llvm::MCObjectStreamer::emitCodeAlignment
void emitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit=0) override
Emit nops until the byte alignment ByteAlignment is reached.
Definition: MCObjectStreamer.cpp:616
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:838
llvm::MCSA_SymbolResolver
@ MCSA_SymbolResolver
.symbol_resolver (MachO)
Definition: MCDirectives.h:39
llvm::MCStreamer::PushSection
void PushSection()
Save the current and previous section on the section stack.
Definition: MCStreamer.h:396
llvm::MCEncodedFragment::getSubtargetInfo
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
Definition: MCFragment.h:173
Casting.h
llvm::MCELFStreamer::emitSymbolAttribute
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
Definition: MCELFStreamer.cpp:192
llvm::MCELFStreamer::emitAssemblerFlag
void emitAssemblerFlag(MCAssemblerFlag Flag) override
Note in the output the specified Flag.
Definition: MCELFStreamer.cpp:120
llvm::MCSection::NotBundleLocked
@ NotBundleLocked
Definition: MCSection.h:47
llvm::MCSymbolRefExpr::VK_TLSGD
@ VK_TLSGD
Definition: MCExpr.h:208
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:384
llvm::MCSA_Global
@ MCSA_Global
.type _foo, @gnu_unique_object
Definition: MCDirectives.h:30
llvm::MCSA_WeakDefinition
@ MCSA_WeakDefinition
.weak_definition (MachO)
Definition: MCDirectives.h:45
llvm::LCOMM::ByteAlignment
@ ByteAlignment
Definition: MCAsmInfo.h:50
llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_HA
@ VK_PPC_GOT_TPREL_HA
Definition: MCExpr.h:288
llvm::MCSA_ELF_TypeFunction
@ MCSA_ELF_TypeFunction
.type _foo, STT_FUNC # aka @function
Definition: MCDirectives.h:23
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79
llvm::computeBundlePadding
uint64_t computeBundlePadding(const MCAssembler &Assembler, const MCEncodedFragment *F, uint64_t FOffset, uint64_t FSize)
Compute the amount of padding required before the fragment F to obey bundling restrictions,...
Definition: MCFragment.cpp:209
llvm::MCSA_Weak
@ MCSA_Weak
.weak
Definition: MCDirectives.h:44
llvm::MCEncodedFragment::setAlignToBundleEnd
void setAlignToBundleEnd(bool V)
Definition: MCFragment.h:158
llvm::MCObjectStreamer::emitBytes
void emitBytes(StringRef Data) override
Emit the bytes in Data into the output.
Definition: MCObjectStreamer.cpp:595
llvm::MCObjectStreamer::flushPendingLabels
void flushPendingLabels()
Create a data fragment for any pending labels across all Sections and Subsections.
Definition: MCObjectStreamer.cpp:92
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HA
@ VK_PPC_DTPREL_HA
Definition: MCExpr.h:278
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD
@ VK_PPC_GOT_TLSLD
Definition: MCExpr.h:301
llvm::ELF::SHF_MERGE
@ SHF_MERGE
Definition: ELF.h:989
llvm::ELF::SHF_TLS
@ SHF_TLS
Definition: ELF.h:1008
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition: MCStreamer.h:278
SmallVector.h
llvm::ELF::STT_OBJECT
@ STT_OBJECT
Definition: ELF.h:1146
llvm::MCExpr::SymbolRef
@ SymbolRef
References to labels and assigned expressions.
Definition: MCExpr.h:40
llvm::MCExpr::Unary
@ Unary
Unary expressions.
Definition: MCExpr.h:41
llvm::MCELFStreamer::emitELFSize
void emitELFSize(MCSymbol *Symbol, const MCExpr *Value) override
Emit an ELF .size directive.
Definition: MCELFStreamer.cpp:335
MCStreamer.h
llvm::MCELFStreamer::emitBundleUnlock
void emitBundleUnlock() override
Ends a bundle-locked group.
Definition: MCELFStreamer.cpp:650
llvm::MCSectionSubPair
std::pair< MCSection *, const MCExpr * > MCSectionSubPair
Definition: MCStreamer.h:64
llvm::ELF::STV_PROTECTED
@ STV_PROTECTED
Definition: ELF.h:1166
llvm::MCAsmInfo::getNonexecutableStackSection
virtual MCSection * getNonexecutableStackSection(MCContext &Ctx) const
Targets can implement this method to specify a section to switch to if the translation unit doesn't h...
Definition: MCAsmInfo.h:550
llvm::MCExpr::Constant
@ Constant
Constant expressions.
Definition: MCExpr.h:39
llvm::MCAssembler::setSubsectionsViaSymbols
void setSubsectionsViaSymbols(bool Value)
Definition: MCAssembler.h:319
llvm::raw_svector_ostream
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:647
llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_HA
@ VK_PPC_GOT_TLSLD_HA
Definition: MCExpr.h:304
llvm::MCSA_PrivateExtern
@ MCSA_PrivateExtern
.private_extern (MachO)
Definition: MCDirectives.h:41
llvm::MCAssembler::writeFragmentPadding
void writeFragmentPadding(raw_ostream &OS, const MCEncodedFragment &F, uint64_t FSize) const
Write the necessary bundle padding to OS.
Definition: MCAssembler.cpp:473
llvm::HexStyle::Asm
@ Asm
0ffh
Definition: MCInstPrinter.h:34
llvm::mc::getRelaxAll
bool getRelaxAll()
From
BlockVerifier::State From
Definition: BlockVerifier.cpp:55
llvm::MCSymbolRefExpr::VK_PPC_DTPREL_HIGHA
@ VK_PPC_DTPREL_HIGHA
Definition: MCExpr.h:280
llvm::MCObjectStreamer::finishImpl
void finishImpl() override
Streamer specific finalization.
Definition: MCObjectStreamer.cpp:865
llvm::MCObjectStreamer::emitFrames
void emitFrames(MCAsmBackend *MAB)
Definition: MCObjectStreamer.cpp:173
raw_ostream.h
llvm::MCDataFragment
Fragment for data and encoded instructions.
Definition: MCFragment.h:242
TargetRegistry.h
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:1193
llvm::MCAssembler::isBundlingEnabled
bool isBundlingEnabled() const
Definition: MCAssembler.h:331
MCExpr.h
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:75
CheckBundleSubtargets
static void CheckBundleSubtargets(const MCSubtargetInfo *OldSTI, const MCSubtargetInfo *NewSTI)
Definition: MCELFStreamer.cpp:521
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::ELF::STT_FUNC
@ STT_FUNC
Definition: ELF.h:1147
llvm::MCSymbolRefExpr::VK_GOTTPOFF
@ VK_GOTTPOFF
Definition: MCExpr.h:203
setSectionAlignmentForBundling
static void setSectionAlignmentForBundling(const MCAssembler &Assembler, MCSection *Section)
Definition: MCELFStreamer.cpp:139
llvm::MCSymbolRefExpr::VK_PPC_DTPMOD
@ VK_PPC_DTPMOD
Definition: MCExpr.h:266
llvm::ELF::SHF_STRINGS
@ SHF_STRINGS
Definition: ELF.h:992
llvm::MCELFStreamer::InitSections
void InitSections(bool NoExecStack) override
Create the default sections and set the initial one.
Definition: MCELFStreamer.cpp:90
llvm::MCAssembler::CGProfileEntry
Definition: MCAssembler.h:436
llvm::MCEncodedFragmentWithContents::getContents
SmallVectorImpl< char > & getContents()
Definition: MCFragment.h:197
llvm::MCExpr::getLoc
SMLoc getLoc() const
Definition: MCExpr.h:82
llvm::MCContext::reportWarning
void reportWarning(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:955
llvm::MCCodeEmitter::encodeInstruction
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.
llvm::MCSymbolRefExpr::VK_DTPOFF
@ VK_DTPOFF
Definition: MCExpr.h:212
llvm::MCStreamer::emitZeros
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
Definition: MCStreamer.cpp:224
llvm::MCAssembler::CGProfile
std::vector< CGProfileEntry > CGProfile
Definition: MCAssembler.h:441