LLVM  10.0.0
MCAssembler.h
Go to the documentation of this file.
1 //===- MCAssembler.h - Object File Generation -------------------*- C++ -*-===//
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 #ifndef LLVM_MC_MCASSEMBLER_H
10 #define LLVM_MC_MCASSEMBLER_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/STLExtras.h"
14 #include "llvm/ADT/SmallPtrSet.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/ADT/iterator.h"
19 #include "llvm/MC/MCDirectives.h"
20 #include "llvm/MC/MCDwarf.h"
21 #include "llvm/MC/MCFixup.h"
22 #include "llvm/MC/MCFragment.h"
24 #include "llvm/MC/MCSymbol.h"
26 #include <cassert>
27 #include <cstddef>
28 #include <cstdint>
29 #include <string>
30 #include <utility>
31 #include <vector>
32 
33 namespace llvm {
34 
35 class MCAsmBackend;
36 class MCAsmLayout;
37 class MCContext;
38 class MCCodeEmitter;
39 class MCFragment;
40 class MCObjectWriter;
41 class MCSection;
42 class MCValue;
43 
44 // FIXME: This really doesn't belong here. See comments below.
48 };
49 
50 // FIXME: Ditto this. Purely so the Streamer and the ObjectWriter can talk
51 // to one another.
53  // This enum should be kept in sync w/ the mach-o definition in
54  // llvm/Object/MachOFormat.h.
55  enum KindTy { Data = 1, JumpTable8, JumpTable16, JumpTable32 } Kind;
58 };
59 
60 class MCAssembler {
61  friend class MCAsmLayout;
62 
63 public:
64  using SectionListType = std::vector<MCSection *>;
65  using SymbolDataListType = std::vector<const MCSymbol *>;
66 
69 
70  using const_symbol_iterator =
73 
76 
78  std::vector<IndirectSymbolData>::const_iterator;
79  using indirect_symbol_iterator = std::vector<IndirectSymbolData>::iterator;
80 
82  std::vector<DataRegionData>::const_iterator;
83  using data_region_iterator = std::vector<DataRegionData>::iterator;
84 
85  /// MachO specific deployment target version info.
86  // A Major version of 0 indicates that no version information was supplied
87  // and so the corresponding load command should not be emitted.
88  using VersionInfoType = struct {
89  bool EmitBuildVersion;
90  union {
91  MCVersionMinType Type; ///< Used when EmitBuildVersion==false.
92  MachO::PlatformType Platform; ///< Used when EmitBuildVersion==true.
93  } TypeOrPlatform;
94  unsigned Major;
95  unsigned Minor;
96  unsigned Update;
97  /// An optional version of the SDK that was used to build the source.
99  };
100 
101 private:
103 
104  std::unique_ptr<MCAsmBackend> Backend;
105 
106  std::unique_ptr<MCCodeEmitter> Emitter;
107 
108  std::unique_ptr<MCObjectWriter> Writer;
109 
110  SectionListType Sections;
111 
112  SymbolDataListType Symbols;
113 
114  std::vector<IndirectSymbolData> IndirectSymbols;
115 
116  std::vector<DataRegionData> DataRegions;
117 
118  /// The list of linker options to propagate into the object file.
119  std::vector<std::vector<std::string>> LinkerOptions;
120 
121  /// List of declared file names
122  std::vector<std::string> FileNames;
123 
124  MCDwarfLineTableParams LTParams;
125 
126  /// The set of function symbols for which a .thumb_func directive has
127  /// been seen.
128  //
129  // FIXME: We really would like this in target specific code rather than
130  // here. Maybe when the relocation stuff moves to target specific,
131  // this can go with it? The streamer would need some target specific
132  // refactoring too.
133  mutable SmallPtrSet<const MCSymbol *, 32> ThumbFuncs;
134 
135  /// The bundle alignment size currently set in the assembler.
136  ///
137  /// By default it's 0, which means bundling is disabled.
138  unsigned BundleAlignSize;
139 
140  bool RelaxAll : 1;
141  bool SubsectionsViaSymbols : 1;
142  bool IncrementalLinkerCompatible : 1;
143 
144  /// ELF specific e_header flags
145  // It would be good if there were an MCELFAssembler class to hold this.
146  // ELF header flags are used both by the integrated and standalone assemblers.
147  // Access to the flags is necessary in cases where assembler directives affect
148  // which flags to be set.
149  unsigned ELFHeaderEFlags;
150 
151  /// Used to communicate Linker Optimization Hint information between
152  /// the Streamer and the .o writer
153  MCLOHContainer LOHContainer;
154 
155  VersionInfoType VersionInfo;
156 
157  /// Evaluate a fixup to a relocatable expression and the value which should be
158  /// placed into the fixup.
159  ///
160  /// \param Layout The layout to use for evaluation.
161  /// \param Fixup The fixup to evaluate.
162  /// \param DF The fragment the fixup is inside.
163  /// \param Target [out] On return, the relocatable expression the fixup
164  /// evaluates to.
165  /// \param Value [out] On return, the value of the fixup as currently laid
166  /// out.
167  /// \param WasForced [out] On return, the value in the fixup is set to the
168  /// correct value if WasForced is true, even if evaluateFixup returns false.
169  /// \return Whether the fixup value was fully resolved. This is true if the
170  /// \p Value result is fixed, otherwise the value may change due to
171  /// relocation.
172  bool evaluateFixup(const MCAsmLayout &Layout, const MCFixup &Fixup,
173  const MCFragment *DF, MCValue &Target,
174  uint64_t &Value, bool &WasForced) const;
175 
176  /// Check whether a fixup can be satisfied, or whether it needs to be relaxed
177  /// (increased in size, in order to hold its value correctly).
178  bool fixupNeedsRelaxation(const MCFixup &Fixup, const MCRelaxableFragment *DF,
179  const MCAsmLayout &Layout) const;
180 
181  /// Check whether the given fragment needs relaxation.
182  bool fragmentNeedsRelaxation(const MCRelaxableFragment *IF,
183  const MCAsmLayout &Layout) const;
184 
185  /// Perform one layout iteration and return true if any offsets
186  /// were adjusted.
187  bool layoutOnce(MCAsmLayout &Layout);
188 
189  /// Perform one layout iteration of the given section and return true
190  /// if any offsets were adjusted.
191  bool layoutSectionOnce(MCAsmLayout &Layout, MCSection &Sec);
192 
193  bool relaxInstruction(MCAsmLayout &Layout, MCRelaxableFragment &IF);
194  bool relaxLEB(MCAsmLayout &Layout, MCLEBFragment &IF);
195  bool relaxBoundaryAlign(MCAsmLayout &Layout, MCBoundaryAlignFragment &BF);
196  bool relaxDwarfLineAddr(MCAsmLayout &Layout, MCDwarfLineAddrFragment &DF);
197  bool relaxDwarfCallFrameFragment(MCAsmLayout &Layout,
199  bool relaxCVInlineLineTable(MCAsmLayout &Layout,
201  bool relaxCVDefRange(MCAsmLayout &Layout, MCCVDefRangeFragment &DF);
202 
203  /// finishLayout - Finalize a layout, including fragment lowering.
204  void finishLayout(MCAsmLayout &Layout);
205 
206  std::tuple<MCValue, uint64_t, bool>
207  handleFixup(const MCAsmLayout &Layout, MCFragment &F, const MCFixup &Fixup);
208 
209 public:
210  std::vector<std::pair<StringRef, const MCSymbol *>> Symvers;
211 
212  /// Construct a new assembler instance.
213  //
214  // FIXME: How are we going to parameterize this? Two obvious options are stay
215  // concrete and require clients to pass in a target like object. The other
216  // option is to make this abstract, and have targets provide concrete
217  // implementations as we do with AsmParser.
218  MCAssembler(MCContext &Context, std::unique_ptr<MCAsmBackend> Backend,
219  std::unique_ptr<MCCodeEmitter> Emitter,
220  std::unique_ptr<MCObjectWriter> Writer);
221  MCAssembler(const MCAssembler &) = delete;
222  MCAssembler &operator=(const MCAssembler &) = delete;
223  ~MCAssembler();
224 
225  /// Compute the effective fragment size assuming it is laid out at the given
226  /// \p SectionAddress and \p FragmentOffset.
227  uint64_t computeFragmentSize(const MCAsmLayout &Layout,
228  const MCFragment &F) const;
229 
230  /// Find the symbol which defines the atom containing the given symbol, or
231  /// null if there is no such symbol.
232  const MCSymbol *getAtom(const MCSymbol &S) const;
233 
234  /// Check whether a particular symbol is visible to the linker and is required
235  /// in the symbol table, or whether it can be discarded by the assembler. This
236  /// also effects whether the assembler treats the label as potentially
237  /// defining a separate atom.
238  bool isSymbolLinkerVisible(const MCSymbol &SD) const;
239 
240  /// Emit the section contents to \p OS.
241  void writeSectionData(raw_ostream &OS, const MCSection *Section,
242  const MCAsmLayout &Layout) const;
243 
244  /// Check whether a given symbol has been flagged with .thumb_func.
245  bool isThumbFunc(const MCSymbol *Func) const;
246 
247  /// Flag a function symbol as the target of a .thumb_func directive.
248  void setIsThumbFunc(const MCSymbol *Func) { ThumbFuncs.insert(Func); }
249 
250  /// ELF e_header flags
251  unsigned getELFHeaderEFlags() const { return ELFHeaderEFlags; }
252  void setELFHeaderEFlags(unsigned Flags) { ELFHeaderEFlags = Flags; }
253 
254  /// MachO deployment target version information.
255  const VersionInfoType &getVersionInfo() const { return VersionInfo; }
256  void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor,
257  unsigned Update,
258  VersionTuple SDKVersion = VersionTuple()) {
259  VersionInfo.EmitBuildVersion = false;
260  VersionInfo.TypeOrPlatform.Type = Type;
261  VersionInfo.Major = Major;
262  VersionInfo.Minor = Minor;
263  VersionInfo.Update = Update;
264  VersionInfo.SDKVersion = SDKVersion;
265  }
266  void setBuildVersion(MachO::PlatformType Platform, unsigned Major,
267  unsigned Minor, unsigned Update,
268  VersionTuple SDKVersion = VersionTuple()) {
269  VersionInfo.EmitBuildVersion = true;
270  VersionInfo.TypeOrPlatform.Platform = Platform;
271  VersionInfo.Major = Major;
272  VersionInfo.Minor = Minor;
273  VersionInfo.Update = Update;
274  VersionInfo.SDKVersion = SDKVersion;
275  }
276 
277  /// Reuse an assembler instance
278  ///
279  void reset();
280 
281  MCContext &getContext() const { return Context; }
282 
283  MCAsmBackend *getBackendPtr() const { return Backend.get(); }
284 
285  MCCodeEmitter *getEmitterPtr() const { return Emitter.get(); }
286 
287  MCObjectWriter *getWriterPtr() const { return Writer.get(); }
288 
289  MCAsmBackend &getBackend() const { return *Backend; }
290 
291  MCCodeEmitter &getEmitter() const { return *Emitter; }
292 
293  MCObjectWriter &getWriter() const { return *Writer; }
294 
295  MCDwarfLineTableParams getDWARFLinetableParams() const { return LTParams; }
297 
298  /// Finish - Do final processing and write the object to the output stream.
299  /// \p Writer is used for custom object writer (as the MCJIT does),
300  /// if not specified it is automatically created from backend.
301  void Finish();
302 
303  // Layout all section and prepare them for emission.
304  void layout(MCAsmLayout &Layout);
305 
306  // FIXME: This does not belong here.
307  bool getSubsectionsViaSymbols() const { return SubsectionsViaSymbols; }
308  void setSubsectionsViaSymbols(bool Value) { SubsectionsViaSymbols = Value; }
309 
311  return IncrementalLinkerCompatible;
312  }
314  IncrementalLinkerCompatible = Value;
315  }
316 
317  bool getRelaxAll() const { return RelaxAll; }
318  void setRelaxAll(bool Value) { RelaxAll = Value; }
319 
320  bool isBundlingEnabled() const { return BundleAlignSize != 0; }
321 
322  unsigned getBundleAlignSize() const { return BundleAlignSize; }
323 
324  void setBundleAlignSize(unsigned Size) {
325  assert((Size == 0 || !(Size & (Size - 1))) &&
326  "Expect a power-of-two bundle align size");
327  BundleAlignSize = Size;
328  }
329 
330  /// \name Section List Access
331  /// @{
332 
333  iterator begin() { return Sections.begin(); }
334  const_iterator begin() const { return Sections.begin(); }
335 
336  iterator end() { return Sections.end(); }
337  const_iterator end() const { return Sections.end(); }
338 
339  size_t size() const { return Sections.size(); }
340 
341  /// @}
342  /// \name Symbol List Access
343  /// @{
344  symbol_iterator symbol_begin() { return Symbols.begin(); }
345  const_symbol_iterator symbol_begin() const { return Symbols.begin(); }
346 
347  symbol_iterator symbol_end() { return Symbols.end(); }
348  const_symbol_iterator symbol_end() const { return Symbols.end(); }
349 
350  symbol_range symbols() { return make_range(symbol_begin(), symbol_end()); }
352  return make_range(symbol_begin(), symbol_end());
353  }
354 
355  size_t symbol_size() const { return Symbols.size(); }
356 
357  /// @}
358  /// \name Indirect Symbol List Access
359  /// @{
360 
361  // FIXME: This is a total hack, this should not be here. Once things are
362  // factored so that the streamer has direct access to the .o writer, it can
363  // disappear.
364  std::vector<IndirectSymbolData> &getIndirectSymbols() {
365  return IndirectSymbols;
366  }
367 
369  return IndirectSymbols.begin();
370  }
372  return IndirectSymbols.begin();
373  }
374 
376  return IndirectSymbols.end();
377  }
379  return IndirectSymbols.end();
380  }
381 
382  size_t indirect_symbol_size() const { return IndirectSymbols.size(); }
383 
384  /// @}
385  /// \name Linker Option List Access
386  /// @{
387 
388  std::vector<std::vector<std::string>> &getLinkerOptions() {
389  return LinkerOptions;
390  }
391 
392  /// @}
393  /// \name Data Region List Access
394  /// @{
395 
396  // FIXME: This is a total hack, this should not be here. Once things are
397  // factored so that the streamer has direct access to the .o writer, it can
398  // disappear.
399  std::vector<DataRegionData> &getDataRegions() { return DataRegions; }
400 
401  data_region_iterator data_region_begin() { return DataRegions.begin(); }
403  return DataRegions.begin();
404  }
405 
406  data_region_iterator data_region_end() { return DataRegions.end(); }
408  return DataRegions.end();
409  }
410 
411  size_t data_region_size() const { return DataRegions.size(); }
412 
413  /// @}
414  /// \name Data Region List Access
415  /// @{
416 
417  // FIXME: This is a total hack, this should not be here. Once things are
418  // factored so that the streamer has direct access to the .o writer, it can
419  // disappear.
420  MCLOHContainer &getLOHContainer() { return LOHContainer; }
422  return const_cast<MCAssembler *>(this)->getLOHContainer();
423  }
424 
425  struct CGProfileEntry {
428  uint64_t Count;
429  };
430  std::vector<CGProfileEntry> CGProfile;
431  /// @}
432  /// \name Backend Data Access
433  /// @{
434 
435  bool registerSection(MCSection &Section);
436 
437  void registerSymbol(const MCSymbol &Symbol, bool *Created = nullptr);
438 
439  ArrayRef<std::string> getFileNames() { return FileNames; }
440 
441  void addFileName(StringRef FileName) {
442  if (!is_contained(FileNames, FileName))
443  FileNames.push_back(FileName);
444  }
445 
446  /// Write the necessary bundle padding to \p OS.
447  /// Expects a fragment \p F containing instructions and its size \p FSize.
448  void writeFragmentPadding(raw_ostream &OS, const MCEncodedFragment &F,
449  uint64_t FSize) const;
450 
451  /// @}
452 
453  void dump() const;
454 };
455 
456 /// Compute the amount of padding required before the fragment \p F to
457 /// obey bundling restrictions, where \p FOffset is the fragment's offset in
458 /// its section and \p FSize is the fragment's size.
459 uint64_t computeBundlePadding(const MCAssembler &Assembler,
460  const MCEncodedFragment *F, uint64_t FOffset,
461  uint64_t FSize);
462 
463 } // end namespace llvm
464 
465 #endif // LLVM_MC_MCASSEMBLER_H
void setIsThumbFunc(const MCSymbol *Func)
Flag a function symbol as the target of a .thumb_func directive.
Definition: MCAssembler.h:248
void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
Definition: MCAssembler.h:256
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:252
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
LLVMContext & Context
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MCObjectWriter * getWriterPtr() const
Definition: MCAssembler.h:287
This represents an "assembler immediate".
Definition: MCValue.h:39
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
iterator begin()
Definition: MCAssembler.h:333
const_symbol_iterator symbol_end() const
Definition: MCAssembler.h:348
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
size_t symbol_size() const
Definition: MCAssembler.h:355
F(f)
std::vector< IndirectSymbolData > & getIndirectSymbols()
Definition: MCAssembler.h:364
const_data_region_iterator data_region_begin() const
Definition: MCAssembler.h:402
const_iterator end() const
Definition: MCAssembler.h:337
bool isBundlingEnabled() const
Definition: MCAssembler.h:320
Defines the object file and target independent interfaces used by the assembler backend to write nati...
symbol_iterator symbol_begin()
Definition: MCAssembler.h:344
std::vector< DataRegionData >::iterator data_region_iterator
Definition: MCAssembler.h:83
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:77
unsigned getBundleAlignSize() const
Definition: MCAssembler.h:322
const_indirect_symbol_iterator indirect_symbol_end() const
Definition: MCAssembler.h:378
MCContext & getContext() const
Definition: MCAssembler.h:281
Interface implemented by fragments that contain encoded instructions and/or data. ...
Definition: MCFragment.h:113
MCDwarfLineTableParams getDWARFLinetableParams() const
Definition: MCAssembler.h:295
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:28
MCCodeEmitter & getEmitter() const
Definition: MCAssembler.h:291
void setRelaxAll(bool Value)
Definition: MCAssembler.h:318
const MCSymbolRefExpr * From
Definition: MCAssembler.h:426
static bool isThumbFunc(object::symbol_iterator Symbol, const object::ObjectFile &Obj, object::section_iterator Section)
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:169
const MCLOHContainer & getLOHContainer() const
Definition: MCAssembler.h:421
MCObjectWriter & getWriter() const
Definition: MCAssembler.h:293
void setSubsectionsViaSymbols(bool Value)
Definition: MCAssembler.h:308
PlatformType
Definition: MachO.h:484
MCVersionMinType Type
Used when EmitBuildVersion==false.
Definition: MCAssembler.h:91
ArrayRef< std::string > getFileNames()
Definition: MCAssembler.h:439
Context object for machine code objects.
Definition: MCContext.h:65
void setDWARFLinetableParams(MCDwarfLineTableParams P)
Definition: MCAssembler.h:296
const_symbol_iterator symbol_begin() const
Definition: MCAssembler.h:345
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
void setBundleAlignSize(unsigned Size)
Definition: MCAssembler.h:324
const MCSymbolRefExpr * To
Definition: MCAssembler.h:427
const VersionInfoType & getVersionInfo() const
MachO deployment target version information.
Definition: MCAssembler.h:255
iterator end()
Definition: MCAssembler.h:336
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:258
#define P(N)
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:21
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:370
struct { bool EmitBuildVersion VersionInfoType
MachO specific deployment target version info.
Definition: MCAssembler.h:89
MachO::PlatformType Platform
Used when EmitBuildVersion==true.
Definition: MCAssembler.h:92
std::vector< DataRegionData >::const_iterator const_data_region_iterator
Definition: MCAssembler.h:82
std::vector< IndirectSymbolData >::const_iterator const_indirect_symbol_iterator
Definition: MCAssembler.h:78
data_region_iterator data_region_begin()
Definition: MCAssembler.h:401
unsigned getELFHeaderEFlags() const
ELF e_header flags.
Definition: MCAssembler.h:251
std::vector< const MCSymbol * > SymbolDataListType
Definition: MCAssembler.h:65
Fragment representing the .cv_def_range directive.
Definition: MCFragment.h:493
size_t data_region_size() const
Definition: MCAssembler.h:411
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
const_indirect_symbol_iterator indirect_symbol_begin() const
Definition: MCAssembler.h:371
Represents required padding such that a particular other set of fragments does not cross a particular...
Definition: MCFragment.h:523
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
std::vector< std::vector< std::string > > & getLinkerOptions()
Definition: MCAssembler.h:388
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
Definition: SmallPtrSet.h:443
indirect_symbol_iterator indirect_symbol_begin()
Definition: MCAssembler.h:368
MCAsmBackend * getBackendPtr() const
Definition: MCAssembler.h:283
void setIncrementalLinkerCompatible(bool Value)
Definition: MCAssembler.h:313
MCAsmBackend & getBackend() const
Definition: MCAssembler.h:289
An iterator type that allows iterating over the pointees via some other iterator. ...
Definition: iterator.h:286
bool getSubsectionsViaSymbols() const
Definition: MCAssembler.h:307
size_t indirect_symbol_size() const
Definition: MCAssembler.h:382
MCLOHContainer & getLOHContainer()
Definition: MCAssembler.h:420
void addFileName(StringRef FileName)
Definition: MCAssembler.h:441
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, where FOffset is the fragment&#39;s offset in its section and FSize is the fragment&#39;s size.
Definition: MCFragment.cpp:190
VersionTuple SDKVersion
An optional version of the SDK that was used to build the source.
Definition: MCAssembler.h:98
bool getRelaxAll() const
Definition: MCAssembler.h:317
A range adaptor for a pair of iterators.
Target - Wrapper for Target specific information.
const_iterator begin() const
Definition: MCAssembler.h:334
Fragment representing the binary annotations produced by the .cv_inline_linetable directive...
Definition: MCFragment.h:460
std::vector< CGProfileEntry > CGProfile
Definition: MCAssembler.h:430
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:26
const_data_region_iterator data_region_end() const
Definition: MCAssembler.h:407
static LocationDescriptor layout(BlobAllocator &File, yaml::BinaryRef Data)
uint32_t Size
Definition: Profile.cpp:46
symbol_range symbols()
Definition: MCAssembler.h:350
data_region_iterator data_region_end()
Definition: MCAssembler.h:406
size_t size() const
Definition: MCAssembler.h:339
std::vector< IndirectSymbolData >::iterator indirect_symbol_iterator
Definition: MCAssembler.h:79
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isIncrementalLinkerCompatible() const
Definition: MCAssembler.h:310
MCVersionMinType
Definition: MCDirectives.h:65
LLVM Value Representation.
Definition: Value.h:74
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:38
indirect_symbol_iterator indirect_symbol_end()
Definition: MCAssembler.h:375
Defines the llvm::VersionTuple class, which represents a version in the form major[.minor[.subminor]].
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
const_symbol_range symbols() const
Definition: MCAssembler.h:351
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54
std::vector< DataRegionData > & getDataRegions()
Definition: MCAssembler.h:399
std::vector< MCSection * > SectionListType
Definition: MCAssembler.h:64
void setBuildVersion(MachO::PlatformType Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
Definition: MCAssembler.h:266
std::vector< std::pair< StringRef, const MCSymbol * > > Symvers
Definition: MCAssembler.h:210
MCCodeEmitter * getEmitterPtr() const
Definition: MCAssembler.h:285
symbol_iterator symbol_end()
Definition: MCAssembler.h:347
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Definition: STLExtras.h:1241