LLVM  7.0.0svn
MCMachOStreamer.cpp
Go to the documentation of this file.
1 //===- MCMachOStreamer.cpp - MachO Streamer -------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "llvm/ADT/DenseMap.h"
11 #include "llvm/ADT/SmallString.h"
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/ADT/Triple.h"
15 #include "llvm/MC/MCAsmBackend.h"
16 #include "llvm/MC/MCAssembler.h"
17 #include "llvm/MC/MCCodeEmitter.h"
18 #include "llvm/MC/MCContext.h"
19 #include "llvm/MC/MCDirectives.h"
20 #include "llvm/MC/MCExpr.h"
21 #include "llvm/MC/MCFixup.h"
22 #include "llvm/MC/MCFragment.h"
23 #include "llvm/MC/MCInst.h"
27 #include "llvm/MC/MCObjectWriter.h"
28 #include "llvm/MC/MCSection.h"
29 #include "llvm/MC/MCSectionMachO.h"
30 #include "llvm/MC/MCStreamer.h"
31 #include "llvm/MC/MCSymbol.h"
32 #include "llvm/MC/MCSymbolMachO.h"
33 #include "llvm/MC/MCValue.h"
34 #include "llvm/Support/Casting.h"
38 #include <cassert>
39 #include <vector>
40 
41 using namespace llvm;
42 
43 namespace {
44 
45 class MCMachOStreamer : public MCObjectStreamer {
46 private:
47  /// LabelSections - true if each section change should emit a linker local
48  /// label for use in relocations for assembler local references. Obviates the
49  /// need for local relocations. False by default.
50  bool LabelSections;
51 
52  bool DWARFMustBeAtTheEnd;
53  bool CreatedADWARFSection;
54 
55  /// HasSectionLabel - map of which sections have already had a non-local
56  /// label emitted to them. Used so we don't emit extraneous linker local
57  /// labels in the middle of the section.
58  DenseMap<const MCSection*, bool> HasSectionLabel;
59 
60  void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override;
61 
62  void EmitDataRegion(DataRegionData::KindTy Kind);
63  void EmitDataRegionEnd();
64 
65 public:
66  MCMachOStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
67  std::unique_ptr<MCObjectWriter> OW,
68  std::unique_ptr<MCCodeEmitter> Emitter,
69  bool DWARFMustBeAtTheEnd, bool label)
70  : MCObjectStreamer(Context, std::move(MAB), std::move(OW),
71  std::move(Emitter)),
72  LabelSections(label), DWARFMustBeAtTheEnd(DWARFMustBeAtTheEnd),
73  CreatedADWARFSection(false) {}
74 
75  /// state management
76  void reset() override {
77  CreatedADWARFSection = false;
78  HasSectionLabel.clear();
80  }
81 
82  /// @name MCStreamer Interface
83  /// @{
84 
85  void ChangeSection(MCSection *Sect, const MCExpr *Subsect) override;
86  void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
87  void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
88  void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol) override;
89  void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
90  void EmitLinkerOptions(ArrayRef<std::string> Options) override;
91  void EmitDataRegion(MCDataRegionType Kind) override;
92  void EmitVersionMin(MCVersionMinType Kind, unsigned Major,
93  unsigned Minor, unsigned Update) override;
94  void EmitBuildVersion(unsigned Platform, unsigned Major,
95  unsigned Minor, unsigned Update) override;
96  void EmitThumbFunc(MCSymbol *Func) override;
97  bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override;
98  void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
99  void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
100  unsigned ByteAlignment) override;
101 
102  void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
103  unsigned ByteAlignment) override;
104  void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
105  uint64_t Size = 0, unsigned ByteAlignment = 0) override;
106  void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
107  unsigned ByteAlignment = 0) override;
108 
109  void EmitIdent(StringRef IdentString) override {
110  llvm_unreachable("macho doesn't support this directive");
111  }
112 
113  void EmitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) override {
114  getAssembler().getLOHContainer().addDirective(Kind, Args);
115  }
116 
117  void FinishImpl() override;
118 };
119 
120 } // end anonymous namespace.
121 
122 static bool canGoAfterDWARF(const MCSectionMachO &MSec) {
123  // These sections are created by the assembler itself after the end of
124  // the .s file.
125  StringRef SegName = MSec.getSegmentName();
126  StringRef SecName = MSec.getSectionName();
127 
128  if (SegName == "__LD" && SecName == "__compact_unwind")
129  return true;
130 
131  if (SegName == "__IMPORT") {
132  if (SecName == "__jump_table")
133  return true;
134 
135  if (SecName == "__pointers")
136  return true;
137  }
138 
139  if (SegName == "__TEXT" && SecName == "__eh_frame")
140  return true;
141 
142  if (SegName == "__DATA" && (SecName == "__nl_symbol_ptr" ||
143  SecName == "__thread_ptr"))
144  return true;
145 
146  return false;
147 }
148 
149 void MCMachOStreamer::ChangeSection(MCSection *Section,
150  const MCExpr *Subsection) {
151  // Change the section normally.
152  bool Created = changeSectionImpl(Section, Subsection);
153  const MCSectionMachO &MSec = *cast<MCSectionMachO>(Section);
154  StringRef SegName = MSec.getSegmentName();
155  if (SegName == "__DWARF")
156  CreatedADWARFSection = true;
157  else if (Created && DWARFMustBeAtTheEnd && !canGoAfterDWARF(MSec))
158  assert(!CreatedADWARFSection && "Creating regular section after DWARF");
159 
160  // Output a linker-local symbol so we don't need section-relative local
161  // relocations. The linker hates us when we do that.
162  if (LabelSections && !HasSectionLabel[Section] &&
163  !Section->getBeginSymbol()) {
164  MCSymbol *Label = getContext().createLinkerPrivateTempSymbol();
165  Section->setBeginSymbol(Label);
166  HasSectionLabel[Section] = true;
167  }
168 }
169 
170 void MCMachOStreamer::EmitEHSymAttributes(const MCSymbol *Symbol,
171  MCSymbol *EHSymbol) {
172  getAssembler().registerSymbol(*Symbol);
173  if (Symbol->isExternal())
174  EmitSymbolAttribute(EHSymbol, MCSA_Global);
175  if (cast<MCSymbolMachO>(Symbol)->isWeakDefinition())
176  EmitSymbolAttribute(EHSymbol, MCSA_WeakDefinition);
177  if (Symbol->isPrivateExtern())
178  EmitSymbolAttribute(EHSymbol, MCSA_PrivateExtern);
179 }
180 
181 void MCMachOStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
182  // We have to create a new fragment if this is an atom defining symbol,
183  // fragments cannot span atoms.
184  if (getAssembler().isSymbolLinkerVisible(*Symbol))
185  insert(new MCDataFragment());
186 
187  MCObjectStreamer::EmitLabel(Symbol, Loc);
188 
189  // This causes the reference type flag to be cleared. Darwin 'as' was "trying"
190  // to clear the weak reference and weak definition bits too, but the
191  // implementation was buggy. For now we just try to match 'as', for
192  // diffability.
193  //
194  // FIXME: Cleanup this code, these bits should be emitted based on semantic
195  // properties, not on the order of definition, etc.
196  cast<MCSymbolMachO>(Symbol)->clearReferenceType();
197 }
198 
199 void MCMachOStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
200  MCValue Res;
201 
202  if (Value->evaluateAsRelocatable(Res, nullptr, nullptr)) {
203  if (const MCSymbolRefExpr *SymAExpr = Res.getSymA()) {
204  const MCSymbol &SymA = SymAExpr->getSymbol();
205  if (!Res.getSymB() && (SymA.getName() == "" || Res.getConstant() != 0))
206  cast<MCSymbolMachO>(Symbol)->setAltEntry();
207  }
208  }
209  MCObjectStreamer::EmitAssignment(Symbol, Value);
210 }
211 
212 void MCMachOStreamer::EmitDataRegion(DataRegionData::KindTy Kind) {
213  // Create a temporary label to mark the start of the data region.
214  MCSymbol *Start = getContext().createTempSymbol();
215  EmitLabel(Start);
216  // Record the region for the object writer to use.
217  DataRegionData Data = { Kind, Start, nullptr };
218  std::vector<DataRegionData> &Regions = getAssembler().getDataRegions();
219  Regions.push_back(Data);
220 }
221 
222 void MCMachOStreamer::EmitDataRegionEnd() {
223  std::vector<DataRegionData> &Regions = getAssembler().getDataRegions();
224  assert(!Regions.empty() && "Mismatched .end_data_region!");
225  DataRegionData &Data = Regions.back();
226  assert(!Data.End && "Mismatched .end_data_region!");
227  // Create a temporary label to mark the end of the data region.
228  Data.End = getContext().createTempSymbol();
229  EmitLabel(Data.End);
230 }
231 
232 void MCMachOStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
233  // Let the target do whatever target specific stuff it needs to do.
234  getAssembler().getBackend().handleAssemblerFlag(Flag);
235  // Do any generic stuff we need to do.
236  switch (Flag) {
237  case MCAF_SyntaxUnified: return; // no-op here.
238  case MCAF_Code16: return; // Change parsing mode; no-op here.
239  case MCAF_Code32: return; // Change parsing mode; no-op here.
240  case MCAF_Code64: return; // Change parsing mode; no-op here.
242  getAssembler().setSubsectionsViaSymbols(true);
243  return;
244  }
245 }
246 
247 void MCMachOStreamer::EmitLinkerOptions(ArrayRef<std::string> Options) {
248  getAssembler().getLinkerOptions().push_back(Options);
249 }
250 
251 void MCMachOStreamer::EmitDataRegion(MCDataRegionType Kind) {
252  switch (Kind) {
253  case MCDR_DataRegion:
254  EmitDataRegion(DataRegionData::Data);
255  return;
256  case MCDR_DataRegionJT8:
257  EmitDataRegion(DataRegionData::JumpTable8);
258  return;
259  case MCDR_DataRegionJT16:
260  EmitDataRegion(DataRegionData::JumpTable16);
261  return;
262  case MCDR_DataRegionJT32:
263  EmitDataRegion(DataRegionData::JumpTable32);
264  return;
265  case MCDR_DataRegionEnd:
266  EmitDataRegionEnd();
267  return;
268  }
269 }
270 
271 void MCMachOStreamer::EmitVersionMin(MCVersionMinType Kind, unsigned Major,
272  unsigned Minor, unsigned Update) {
273  getAssembler().setVersionMin(Kind, Major, Minor, Update);
274 }
275 
276 void MCMachOStreamer::EmitBuildVersion(unsigned Platform, unsigned Major,
277  unsigned Minor, unsigned Update) {
278  getAssembler().setBuildVersion((MachO::PlatformType)Platform, Major, Minor,
279  Update);
280 }
281 
282 void MCMachOStreamer::EmitThumbFunc(MCSymbol *Symbol) {
283  // Remember that the function is a thumb function. Fixup and relocation
284  // values will need adjusted.
285  getAssembler().setIsThumbFunc(Symbol);
286  cast<MCSymbolMachO>(Symbol)->setThumbFunc();
287 }
288 
289 bool MCMachOStreamer::EmitSymbolAttribute(MCSymbol *Sym,
291  MCSymbolMachO *Symbol = cast<MCSymbolMachO>(Sym);
292 
293  // Indirect symbols are handled differently, to match how 'as' handles
294  // them. This makes writing matching .o files easier.
295  if (Attribute == MCSA_IndirectSymbol) {
296  // Note that we intentionally cannot use the symbol data here; this is
297  // important for matching the string table that 'as' generates.
298  IndirectSymbolData ISD;
299  ISD.Symbol = Symbol;
300  ISD.Section = getCurrentSectionOnly();
301  getAssembler().getIndirectSymbols().push_back(ISD);
302  return true;
303  }
304 
305  // Adding a symbol attribute always introduces the symbol, note that an
306  // important side effect of calling registerSymbol here is to register
307  // the symbol with the assembler.
308  getAssembler().registerSymbol(*Symbol);
309 
310  // The implementation of symbol attributes is designed to match 'as', but it
311  // leaves much to desired. It doesn't really make sense to arbitrarily add and
312  // remove flags, but 'as' allows this (in particular, see .desc).
313  //
314  // In the future it might be worth trying to make these operations more well
315  // defined.
316  switch (Attribute) {
317  case MCSA_Invalid:
320  case MCSA_ELF_TypeObject:
321  case MCSA_ELF_TypeTLS:
322  case MCSA_ELF_TypeCommon:
323  case MCSA_ELF_TypeNoType:
325  case MCSA_Hidden:
326  case MCSA_IndirectSymbol:
327  case MCSA_Internal:
328  case MCSA_Protected:
329  case MCSA_Weak:
330  case MCSA_Local:
331  return false;
332 
333  case MCSA_Global:
334  Symbol->setExternal(true);
335  // This effectively clears the undefined lazy bit, in Darwin 'as', although
336  // it isn't very consistent because it implements this as part of symbol
337  // lookup.
338  //
339  // FIXME: Cleanup this code, these bits should be emitted based on semantic
340  // properties, not on the order of definition, etc.
341  Symbol->setReferenceTypeUndefinedLazy(false);
342  break;
343 
344  case MCSA_LazyReference:
345  // FIXME: This requires -dynamic.
346  Symbol->setNoDeadStrip();
347  if (Symbol->isUndefined())
348  Symbol->setReferenceTypeUndefinedLazy(true);
349  break;
350 
351  // Since .reference sets the no dead strip bit, it is equivalent to
352  // .no_dead_strip in practice.
353  case MCSA_Reference:
354  case MCSA_NoDeadStrip:
355  Symbol->setNoDeadStrip();
356  break;
357 
358  case MCSA_SymbolResolver:
359  Symbol->setSymbolResolver();
360  break;
361 
362  case MCSA_AltEntry:
363  Symbol->setAltEntry();
364  break;
365 
366  case MCSA_PrivateExtern:
367  Symbol->setExternal(true);
368  Symbol->setPrivateExtern(true);
369  break;
370 
371  case MCSA_WeakReference:
372  // FIXME: This requires -dynamic.
373  if (Symbol->isUndefined())
374  Symbol->setWeakReference();
375  break;
376 
377  case MCSA_WeakDefinition:
378  // FIXME: 'as' enforces that this is defined and global. The manual claims
379  // it has to be in a coalesced section, but this isn't enforced.
380  Symbol->setWeakDefinition();
381  break;
382 
384  Symbol->setWeakDefinition();
385  Symbol->setWeakReference();
386  break;
387  }
388 
389  return true;
390 }
391 
392 void MCMachOStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {
393  // Encode the 'desc' value into the lowest implementation defined bits.
394  getAssembler().registerSymbol(*Symbol);
395  cast<MCSymbolMachO>(Symbol)->setDesc(DescValue);
396 }
397 
398 void MCMachOStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
399  unsigned ByteAlignment) {
400  // FIXME: Darwin 'as' does appear to allow redef of a .comm by itself.
401  assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
402 
403  getAssembler().registerSymbol(*Symbol);
404  Symbol->setExternal(true);
405  Symbol->setCommon(Size, ByteAlignment);
406 }
407 
408 void MCMachOStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
409  unsigned ByteAlignment) {
410  // '.lcomm' is equivalent to '.zerofill'.
411  return EmitZerofill(getContext().getObjectFileInfo()->getDataBSSSection(),
412  Symbol, Size, ByteAlignment);
413 }
414 
415 void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,
416  uint64_t Size, unsigned ByteAlignment) {
417  // On darwin all virtual sections have zerofill type.
418  assert(Section->isVirtualSection() && "Section does not have zerofill type!");
419 
420  PushSection();
421  SwitchSection(Section);
422 
423  // The symbol may not be present, which only creates the section.
424  if (Symbol) {
425  EmitValueToAlignment(ByteAlignment, 0, 1, 0);
426  EmitLabel(Symbol);
427  EmitZeros(Size);
428  }
429  PopSection();
430 }
431 
432 // This should always be called with the thread local bss section. Like the
433 // .zerofill directive this doesn't actually switch sections on us.
434 void MCMachOStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
435  uint64_t Size, unsigned ByteAlignment) {
436  EmitZerofill(Section, Symbol, Size, ByteAlignment);
437 }
438 
439 void MCMachOStreamer::EmitInstToData(const MCInst &Inst,
440  const MCSubtargetInfo &STI) {
441  MCDataFragment *DF = getOrCreateDataFragment();
442 
444  SmallString<256> Code;
445  raw_svector_ostream VecOS(Code);
446  getAssembler().getEmitter().encodeInstruction(Inst, VecOS, Fixups, STI);
447 
448  // Add the fixups and data.
449  for (MCFixup &Fixup : Fixups) {
450  Fixup.setOffset(Fixup.getOffset() + DF->getContents().size());
451  DF->getFixups().push_back(Fixup);
452  }
453  DF->setHasInstructions(STI);
454  DF->getContents().append(Code.begin(), Code.end());
455 }
456 
457 void MCMachOStreamer::FinishImpl() {
458  EmitFrames(&getAssembler().getBackend());
459 
460  // We have to set the fragment atom associations so we can relax properly for
461  // Mach-O.
462 
463  // First, scan the symbol table to build a lookup table from fragments to
464  // defining symbols.
466  for (const MCSymbol &Symbol : getAssembler().symbols()) {
467  if (getAssembler().isSymbolLinkerVisible(Symbol) && Symbol.isInSection() &&
468  !Symbol.isVariable()) {
469  // An atom defining symbol should never be internal to a fragment.
470  assert(Symbol.getOffset() == 0 &&
471  "Invalid offset in atom defining symbol!");
472  DefiningSymbolMap[Symbol.getFragment()] = &Symbol;
473  }
474  }
475 
476  // Set the fragment atom associations by tracking the last seen atom defining
477  // symbol.
478  for (MCSection &Sec : getAssembler()) {
479  const MCSymbol *CurrentAtom = nullptr;
480  for (MCFragment &Frag : Sec) {
481  if (const MCSymbol *Symbol = DefiningSymbolMap.lookup(&Frag))
482  CurrentAtom = Symbol;
483  Frag.setAtom(CurrentAtom);
484  }
485  }
486 
488 }
489 
491  std::unique_ptr<MCAsmBackend> &&MAB,
492  std::unique_ptr<MCObjectWriter> &&OW,
493  std::unique_ptr<MCCodeEmitter> &&CE,
494  bool RelaxAll, bool DWARFMustBeAtTheEnd,
495  bool LabelSections) {
496  MCMachOStreamer *S =
497  new MCMachOStreamer(Context, std::move(MAB), std::move(OW), std::move(CE),
498  DWARFMustBeAtTheEnd, LabelSections);
499  const Triple &Target = Context.getObjectFileInfo()->getTargetTriple();
500  S->EmitVersionForTarget(Target);
501  if (RelaxAll)
502  S->getAssembler().setRelaxAll(true);
503  return S;
504 }
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
void setPrivateExtern(bool Value)
Definition: MCSymbol.h:397
void setReferenceTypeUndefinedLazy(bool Value) const
Definition: MCSymbolMachO.h:54
This represents a section on a Mach-O system (used by Mac OS X).
LLVMContext & Context
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
bool isVariable() const
isVariable - Check if this is a variable symbol.
Definition: MCSymbol.h:294
.type _foo, STT_OBJECT # aka
Definition: MCDirectives.h:25
This represents an "assembler immediate".
Definition: MCValue.h:40
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
Not a valid directive.
Definition: MCDirectives.h:20
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
Definition: SmallVector.h:137
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:504
MCDataRegionType
Definition: MCDirectives.h:56
.type _foo, STT_NOTYPE # aka
Definition: MCDirectives.h:28
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:74
int64_t getConstant() const
Definition: MCValue.h:47
const MCSymbolRefExpr * getSymB() const
Definition: MCValue.h:49
Definition: BitVector.h:921
void setExternal(bool Value) const
Definition: MCSymbol.h:394
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute)...
Definition: MCSymbol.h:252
.data_region jt16
Definition: MCDirectives.h:59
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:166
void setCommon(uint64_t Size, unsigned Align)
Mark this symbol as being &#39;common&#39;.
Definition: MCSymbol.h:345
.local (ELF)
Definition: MCDirectives.h:35
StringRef getSectionName() const
.no_dead_strip (MachO)
Definition: MCDirectives.h:36
PlatformType
Definition: MachO.h:484
Context object for machine code objects.
Definition: MCContext.h:63
void setSymbolResolver() const
Definition: MCSymbolMachO.h:89
.code16 (X86) / .code 16 (ARM)
Definition: MCDirectives.h:51
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
Definition: MCExpr.cpp:633
Streaming object file generation interface.
.type _foo, STT_GNU_IFUNC
Definition: MCDirectives.h:24
.alt_entry (MachO)
Definition: MCDirectives.h:38
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
.protected (ELF)
Definition: MCDirectives.h:40
.lazy_reference (MachO)
Definition: MCDirectives.h:34
SmallVectorImpl< char > & getContents()
Definition: MCFragment.h:197
.reference (MachO)
Definition: MCDirectives.h:41
StringRef getSegmentName() const
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:161
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:118
.hidden (ELF)
Definition: MCDirectives.h:31
.data_region jt32
Definition: MCDirectives.h:60
Streaming machine code generation interface.
Definition: MCStreamer.h:183
void setWeakDefinition() const
Definition: MCSymbolMachO.h:82
void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
.weak_def_can_be_hidden (MachO)
Definition: MCDirectives.h:45
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
Definition: SmallVector.h:117
void setHasInstructions(const MCSubtargetInfo &STI)
Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instructio...
Definition: MCFragment.h:177
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCFragment.h:223
MCLOHType
Linker Optimization Hint Type.
const MCSymbolRefExpr * getSymA() const
Definition: MCValue.h:48
const MCObjectFileInfo * getObjectFileInfo() const
Definition: MCContext.h:294
.subsections_via_symbols (MachO)
Definition: MCDirectives.h:50
uint64_t getOffset() const
Definition: MCSymbol.h:321
.weak_reference (MachO)
Definition: MCDirectives.h:44
bool isExternal() const
Definition: MCSymbol.h:393
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
static bool canGoAfterDWARF(const MCSectionMachO &MSec)
PowerPC TLS Dynamic Call Fixup
virtual bool isVirtualSection() const =0
Check whether this section is "virtual", that is has no actual object file contents.
void setAltEntry() const
Definition: MCSymbolMachO.h:93
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
Definition: MCSymbol.h:257
MCFragment * getFragment(bool SetUsed=true) const
Definition: MCSymbol.h:384
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
.indirect_symbol (MachO)
Definition: MCDirectives.h:32
.type _foo, STT_TLS # aka
Definition: MCDirectives.h:26
MCSymbol * getBeginSymbol()
Definition: MCSection.h:106
const Triple & getTargetTriple() const
MCSymbolAttr
Definition: MCDirectives.h:19
Target - Wrapper for Target specific information.
.syntax (ARM/ELF)
Definition: MCDirectives.h:49
.internal (ELF)
Definition: MCDirectives.h:33
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:395
.code32 (X86) / .code 32 (ARM)
Definition: MCDirectives.h:52
.type _foo, STT_COMMON # aka
Definition: MCDirectives.h:27
.code64 (X86)
Definition: MCDirectives.h:53
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Definition: SmallVector.h:121
.symbol_resolver (MachO)
Definition: MCDirectives.h:37
.type _foo,
Definition: MCDirectives.h:30
void FinishImpl() override
Streamer specific finalization.
MCAssemblerFlag
Definition: MCDirectives.h:48
.type _foo, STT_FUNC # aka
Definition: MCDirectives.h:23
void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
void reset() override
state management
Generic base class for all target subtargets.
void setNoDeadStrip() const
Definition: MCSymbolMachO.h:68
.weak_definition (MachO)
Definition: MCDirectives.h:43
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: DenseMap.h:181
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:203
const unsigned Kind
Fragment for data and encoded instructions.
Definition: MCFragment.h:241
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
.private_extern (MachO)
Definition: MCDirectives.h:39
.data_region jt8
Definition: MCDirectives.h:58
MCVersionMinType
Definition: MCDirectives.h:64
LLVM Value Representation.
Definition: Value.h:73
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
MCStreamer * createMachOStreamer(MCContext &Ctx, std::unique_ptr< MCAsmBackend > &&TAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&CE, bool RelaxAll, bool DWARFMustBeAtTheEnd, bool LabelSections=false)
Represents a location in source code.
Definition: SMLoc.h:24
void setWeakReference() const
Definition: MCSymbolMachO.h:75
bool isPrivateExtern() const
Definition: MCSymbol.h:396
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
.end_data_region
Definition: MCDirectives.h:61
void setBeginSymbol(MCSymbol *Sym)
Definition: MCSection.h:110