LLVM  13.0.0git
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.
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.
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:
102  MCContext &Context;
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::pair<std::string, size_t>> 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  /// Perform relaxation on a single fragment - returns true if the fragment
194  /// changes as a result of relaxation.
195  bool relaxFragment(MCAsmLayout &Layout, MCFragment &F);
196  bool relaxInstruction(MCAsmLayout &Layout, MCRelaxableFragment &IF);
197  bool relaxLEB(MCAsmLayout &Layout, MCLEBFragment &IF);
198  bool relaxBoundaryAlign(MCAsmLayout &Layout, MCBoundaryAlignFragment &BF);
199  bool relaxDwarfLineAddr(MCAsmLayout &Layout, MCDwarfLineAddrFragment &DF);
200  bool relaxDwarfCallFrameFragment(MCAsmLayout &Layout,
202  bool relaxCVInlineLineTable(MCAsmLayout &Layout,
204  bool relaxCVDefRange(MCAsmLayout &Layout, MCCVDefRangeFragment &DF);
205  bool relaxPseudoProbeAddr(MCAsmLayout &Layout, MCPseudoProbeAddrFragment &DF);
206 
207  /// finishLayout - Finalize a layout, including fragment lowering.
208  void finishLayout(MCAsmLayout &Layout);
209 
210  std::tuple<MCValue, uint64_t, bool>
211  handleFixup(const MCAsmLayout &Layout, MCFragment &F, const MCFixup &Fixup);
212 
213 public:
214  struct Symver {
216  const MCSymbol *Sym;
218  // True if .symver *, *@@@* or .symver *, *, remove.
220  };
221  std::vector<Symver> Symvers;
222 
223  /// Construct a new assembler instance.
224  //
225  // FIXME: How are we going to parameterize this? Two obvious options are stay
226  // concrete and require clients to pass in a target like object. The other
227  // option is to make this abstract, and have targets provide concrete
228  // implementations as we do with AsmParser.
229  MCAssembler(MCContext &Context, std::unique_ptr<MCAsmBackend> Backend,
230  std::unique_ptr<MCCodeEmitter> Emitter,
231  std::unique_ptr<MCObjectWriter> Writer);
232  MCAssembler(const MCAssembler &) = delete;
233  MCAssembler &operator=(const MCAssembler &) = delete;
234  ~MCAssembler();
235 
236  /// Compute the effective fragment size assuming it is laid out at the given
237  /// \p SectionAddress and \p FragmentOffset.
238  uint64_t computeFragmentSize(const MCAsmLayout &Layout,
239  const MCFragment &F) const;
240 
241  /// Find the symbol which defines the atom containing the given symbol, or
242  /// null if there is no such symbol.
243  const MCSymbol *getAtom(const MCSymbol &S) const;
244 
245  /// Check whether a particular symbol is visible to the linker and is required
246  /// in the symbol table, or whether it can be discarded by the assembler. This
247  /// also effects whether the assembler treats the label as potentially
248  /// defining a separate atom.
249  bool isSymbolLinkerVisible(const MCSymbol &SD) const;
250 
251  /// Emit the section contents to \p OS.
253  const MCAsmLayout &Layout) const;
254 
255  /// Check whether a given symbol has been flagged with .thumb_func.
256  bool isThumbFunc(const MCSymbol *Func) const;
257 
258  /// Flag a function symbol as the target of a .thumb_func directive.
259  void setIsThumbFunc(const MCSymbol *Func) { ThumbFuncs.insert(Func); }
260 
261  /// ELF e_header flags
262  unsigned getELFHeaderEFlags() const { return ELFHeaderEFlags; }
263  void setELFHeaderEFlags(unsigned Flags) { ELFHeaderEFlags = Flags; }
264 
265  /// MachO deployment target version information.
266  const VersionInfoType &getVersionInfo() const { return VersionInfo; }
267  void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor,
268  unsigned Update,
270  VersionInfo.EmitBuildVersion = false;
271  VersionInfo.TypeOrPlatform.Type = Type;
272  VersionInfo.Major = Major;
273  VersionInfo.Minor = Minor;
274  VersionInfo.Update = Update;
275  VersionInfo.SDKVersion = SDKVersion;
276  }
278  unsigned Minor, unsigned Update,
280  VersionInfo.EmitBuildVersion = true;
281  VersionInfo.TypeOrPlatform.Platform = Platform;
282  VersionInfo.Major = Major;
283  VersionInfo.Minor = Minor;
284  VersionInfo.Update = Update;
285  VersionInfo.SDKVersion = SDKVersion;
286  }
287 
288  /// Reuse an assembler instance
289  ///
290  void reset();
291 
292  MCContext &getContext() const { return Context; }
293 
294  MCAsmBackend *getBackendPtr() const { return Backend.get(); }
295 
296  MCCodeEmitter *getEmitterPtr() const { return Emitter.get(); }
297 
298  MCObjectWriter *getWriterPtr() const { return Writer.get(); }
299 
300  MCAsmBackend &getBackend() const { return *Backend; }
301 
302  MCCodeEmitter &getEmitter() const { return *Emitter; }
303 
304  MCObjectWriter &getWriter() const { return *Writer; }
305 
306  MCDwarfLineTableParams getDWARFLinetableParams() const { return LTParams; }
308 
309  /// Finish - Do final processing and write the object to the output stream.
310  /// \p Writer is used for custom object writer (as the MCJIT does),
311  /// if not specified it is automatically created from backend.
312  void Finish();
313 
314  // Layout all section and prepare them for emission.
315  void layout(MCAsmLayout &Layout);
316 
317  // FIXME: This does not belong here.
318  bool getSubsectionsViaSymbols() const { return SubsectionsViaSymbols; }
319  void setSubsectionsViaSymbols(bool Value) { SubsectionsViaSymbols = Value; }
320 
322  return IncrementalLinkerCompatible;
323  }
325  IncrementalLinkerCompatible = Value;
326  }
327 
328  bool getRelaxAll() const { return RelaxAll; }
329  void setRelaxAll(bool Value) { RelaxAll = Value; }
330 
331  bool isBundlingEnabled() const { return BundleAlignSize != 0; }
332 
333  unsigned getBundleAlignSize() const { return BundleAlignSize; }
334 
335  void setBundleAlignSize(unsigned Size) {
336  assert((Size == 0 || !(Size & (Size - 1))) &&
337  "Expect a power-of-two bundle align size");
338  BundleAlignSize = Size;
339  }
340 
341  /// \name Section List Access
342  /// @{
343 
344  iterator begin() { return Sections.begin(); }
345  const_iterator begin() const { return Sections.begin(); }
346 
347  iterator end() { return Sections.end(); }
348  const_iterator end() const { return Sections.end(); }
349 
350  size_t size() const { return Sections.size(); }
351 
352  /// @}
353  /// \name Symbol List Access
354  /// @{
355  symbol_iterator symbol_begin() { return Symbols.begin(); }
356  const_symbol_iterator symbol_begin() const { return Symbols.begin(); }
357 
358  symbol_iterator symbol_end() { return Symbols.end(); }
359  const_symbol_iterator symbol_end() const { return Symbols.end(); }
360 
363  return make_range(symbol_begin(), symbol_end());
364  }
365 
366  size_t symbol_size() const { return Symbols.size(); }
367 
368  /// @}
369  /// \name Indirect Symbol List Access
370  /// @{
371 
372  // FIXME: This is a total hack, this should not be here. Once things are
373  // factored so that the streamer has direct access to the .o writer, it can
374  // disappear.
375  std::vector<IndirectSymbolData> &getIndirectSymbols() {
376  return IndirectSymbols;
377  }
378 
380  return IndirectSymbols.begin();
381  }
383  return IndirectSymbols.begin();
384  }
385 
387  return IndirectSymbols.end();
388  }
390  return IndirectSymbols.end();
391  }
392 
393  size_t indirect_symbol_size() const { return IndirectSymbols.size(); }
394 
395  /// @}
396  /// \name Linker Option List Access
397  /// @{
398 
399  std::vector<std::vector<std::string>> &getLinkerOptions() {
400  return LinkerOptions;
401  }
402 
403  /// @}
404  /// \name Data Region List Access
405  /// @{
406 
407  // FIXME: This is a total hack, this should not be here. Once things are
408  // factored so that the streamer has direct access to the .o writer, it can
409  // disappear.
410  std::vector<DataRegionData> &getDataRegions() { return DataRegions; }
411 
412  data_region_iterator data_region_begin() { return DataRegions.begin(); }
414  return DataRegions.begin();
415  }
416 
417  data_region_iterator data_region_end() { return DataRegions.end(); }
419  return DataRegions.end();
420  }
421 
422  size_t data_region_size() const { return DataRegions.size(); }
423 
424  /// @}
425  /// \name Data Region List Access
426  /// @{
427 
428  // FIXME: This is a total hack, this should not be here. Once things are
429  // factored so that the streamer has direct access to the .o writer, it can
430  // disappear.
431  MCLOHContainer &getLOHContainer() { return LOHContainer; }
433  return const_cast<MCAssembler *>(this)->getLOHContainer();
434  }
435 
436  struct CGProfileEntry {
439  uint64_t Count;
440  };
441  std::vector<CGProfileEntry> CGProfile;
442  /// @}
443  /// \name Backend Data Access
444  /// @{
445 
447 
448  void registerSymbol(const MCSymbol &Symbol, bool *Created = nullptr);
449 
451  return FileNames;
452  }
453 
454  void addFileName(StringRef FileName) {
455  FileNames.emplace_back(std::string(FileName), Symbols.size());
456  }
457 
458  /// Write the necessary bundle padding to \p OS.
459  /// Expects a fragment \p F containing instructions and its size \p FSize.
461  uint64_t FSize) const;
462 
463  /// @}
464 
465  void dump() const;
466 };
467 
468 /// Compute the amount of padding required before the fragment \p F to
469 /// obey bundling restrictions, where \p FOffset is the fragment's offset in
470 /// its section and \p FSize is the fragment's size.
471 uint64_t computeBundlePadding(const MCAssembler &Assembler,
472  const MCEncodedFragment *F, uint64_t FOffset,
473  uint64_t FSize);
474 
475 } // end namespace llvm
476 
477 #endif // LLVM_MC_MCASSEMBLER_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::MCAssembler::getBackend
MCAsmBackend & getBackend() const
Definition: MCAssembler.h:300
llvm::MCAssembler::begin
iterator begin()
Definition: MCAssembler.h:344
llvm::DataRegionData::Data
@ Data
Definition: MCAssembler.h:55
llvm::MCAssembler::indirect_symbol_end
indirect_symbol_iterator indirect_symbol_end()
Definition: MCAssembler.h:386
llvm::MCAssembler::getELFHeaderEFlags
unsigned getELFHeaderEFlags() const
ELF e_header flags.
Definition: MCAssembler.h:262
llvm::MCVersionMinType
MCVersionMinType
Definition: MCDirectives.h:66
llvm::MCAssembler::data_region_begin
data_region_iterator data_region_begin()
Definition: MCAssembler.h:412
MCDwarf.h
llvm
Definition: AllocatorList.h:23
llvm::MCAssembler::SymbolDataListType
std::vector< const MCSymbol * > SymbolDataListType
Definition: MCAssembler.h:65
llvm::MCAssembler::Finish
void Finish()
Finish - Do final processing and write the object to the output stream.
Definition: MCAssembler.cpp:945
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::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition: iterator_range.h:53
llvm::MCCVInlineLineTableFragment
Fragment representing the binary annotations produced by the .cv_inline_linetable directive.
Definition: MCFragment.h:503
llvm::MCAssembler::Symvers
std::vector< Symver > Symvers
Definition: MCAssembler.h:221
llvm::MCAssembler::data_region_size
size_t data_region_size() const
Definition: MCAssembler.h:422
llvm::DataRegionData::Start
MCSymbol * Start
Definition: MCAssembler.h:56
llvm::MCAssembler::registerSymbol
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
Definition: MCAssembler.cpp:463
llvm::MCDwarfCallFrameFragment
Definition: MCFragment.h:468
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:71
StringRef.h
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::MCAssembler::symbol_begin
const_symbol_iterator symbol_begin() const
Definition: MCAssembler.h:356
MCDirectives.h
llvm::Target
Target - Wrapper for Target specific information.
Definition: TargetRegistry.h:124
llvm::MCAssembler::operator=
MCAssembler & operator=(const MCAssembler &)=delete
llvm::MCAssembler::getLinkerOptions
std::vector< std::vector< std::string > > & getLinkerOptions()
Definition: MCAssembler.h:399
llvm::AMDGPUISD::IF
@ IF
Definition: AMDGPUISelLowering.h:347
llvm::DataRegionData::JumpTable32
@ JumpTable32
Definition: MCAssembler.h:55
VersionTuple.h
MCFragment.h
llvm::MCAssembler::setIsThumbFunc
void setIsThumbFunc(const MCSymbol *Func)
Flag a function symbol as the target of a .thumb_func directive.
Definition: MCAssembler.h:259
llvm::MCAssembler::indirect_symbol_end
const_indirect_symbol_iterator indirect_symbol_end() const
Definition: MCAssembler.h:389
llvm::DataRegionData::JumpTable8
@ JumpTable8
Definition: MCAssembler.h:55
llvm::MCAssembler::data_region_end
data_region_iterator data_region_end()
Definition: MCAssembler.h:417
llvm::MCAssembler::computeFragmentSize
uint64_t computeFragmentSize(const MCAsmLayout &Layout, const MCFragment &F) const
Compute the effective fragment size assuming it is laid out at the given SectionAddress and FragmentO...
Definition: MCAssembler.cpp:289
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
llvm::MCAssembler::reset
void reset()
Reuse an assembler instance.
Definition: MCAssembler.cpp:96
llvm::DataRegionData::KindTy
KindTy
Definition: MCAssembler.h:55
llvm::MCAssembler::Symver::Loc
SMLoc Loc
Definition: MCAssembler.h:215
llvm::MCAssembler::indirect_symbol_begin
indirect_symbol_iterator indirect_symbol_begin()
Definition: MCAssembler.h:379
llvm::MCAssembler::setIncrementalLinkerCompatible
void setIncrementalLinkerCompatible(bool Value)
Definition: MCAssembler.h:324
llvm::MCAssembler::CGProfileEntry::From
const MCSymbolRefExpr * From
Definition: MCAssembler.h:437
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
STLExtras.h
llvm::MCAssembler::symbols
const_symbol_range symbols() const
Definition: MCAssembler.h:362
llvm::MCAssembler::SDKVersion
VersionTuple SDKVersion
An optional version of the SDK that was used to build the source.
Definition: MCAssembler.h:98
llvm::MCAssembler::TypeOrPlatform
union llvm::MCAssembler::@284 TypeOrPlatform
llvm::MCAssembler::writeSectionData
void writeSectionData(raw_ostream &OS, const MCSection *Section, const MCAsmLayout &Layout) const
Emit the section contents to OS.
Definition: MCAssembler.cpp:722
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::MCAssembler::isThumbFunc
bool isThumbFunc(const MCSymbol *Func) const
Check whether a given symbol has been flagged with .thumb_func.
Definition: MCAssembler.cpp:131
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::MCAssembler::data_region_begin
const_data_region_iterator data_region_begin() const
Definition: MCAssembler.h:413
llvm::MCFragment
Definition: MCFragment.h:31
llvm::MCLOHContainer
Definition: MCLinkerOptimizationHint.h:136
llvm::MCAssembler::symbol_begin
symbol_iterator symbol_begin()
Definition: MCAssembler.h:355
llvm::MCAsmBackend
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:36
llvm::MCAssembler::Symver::Sym
const MCSymbol * Sym
Definition: MCAssembler.h:216
llvm::MutableArrayRef
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Definition: ArrayRef.h:305
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
llvm::MCAssembler::getContext
MCContext & getContext() const
Definition: MCAssembler.h:292
llvm::MCDwarfLineTableParams
Definition: MCDwarf.h:206
llvm::MCAssembler::CGProfileEntry::Count
uint64_t Count
Definition: MCAssembler.h:439
MCSymbol.h
llvm::DataRegionData::End
MCSymbol * End
Definition: MCAssembler.h:57
llvm::MCAssembler::symbols
symbol_range symbols()
Definition: MCAssembler.h:361
llvm::DataRegionData
Definition: MCAssembler.h:52
llvm::MCAssembler::symbol_end
const_symbol_iterator symbol_end() const
Definition: MCAssembler.h:359
llvm::MCAssembler::getLOHContainer
const MCLOHContainer & getLOHContainer() const
Definition: MCAssembler.h:432
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:50
llvm::MachO::PlatformType
PlatformType
Definition: MachO.h:491
llvm::VersionTuple
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:27
SmallPtrSet.h
llvm::MCAssembler::getEmitterPtr
MCCodeEmitter * getEmitterPtr() const
Definition: MCAssembler.h:296
llvm::MCAssembler::Minor
unsigned Minor
Definition: MCAssembler.h:95
llvm::MCAssembler::setBundleAlignSize
void setBundleAlignSize(unsigned Size)
Definition: MCAssembler.h:335
DF
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
llvm::MCAssembler::const_indirect_symbol_iterator
std::vector< IndirectSymbolData >::const_iterator const_indirect_symbol_iterator
Definition: MCAssembler.h:78
llvm::MCDwarfLineAddrFragment
Definition: MCFragment.h:444
llvm::MCAssembler::getDataRegions
std::vector< DataRegionData > & getDataRegions()
Definition: MCAssembler.h:410
llvm::IndirectSymbolData::Symbol
MCSymbol * Symbol
Definition: MCAssembler.h:46
llvm::MCAssembler::getWriterPtr
MCObjectWriter * getWriterPtr() const
Definition: MCAssembler.h:298
llvm::MCEncodedFragment
Interface implemented by fragments that contain encoded instructions and/or data.
Definition: MCFragment.h:125
llvm::MCAssembler
Definition: MCAssembler.h:60
llvm::MCAssembler::getEmitter
MCCodeEmitter & getEmitter() const
Definition: MCAssembler.h:302
llvm::MCPseudoProbeAddrFragment
Definition: MCFragment.h:597
llvm::MCAssembler::data_region_end
const_data_region_iterator data_region_end() const
Definition: MCAssembler.h:418
llvm::MCAssembler::symbol_end
symbol_iterator symbol_end()
Definition: MCAssembler.h:358
llvm::MCAssembler::Update
unsigned Update
Definition: MCAssembler.h:96
llvm::MCAssembler::getBundleAlignSize
unsigned getBundleAlignSize() const
Definition: MCAssembler.h:333
iterator.h
llvm::MCAssembler::isSymbolLinkerVisible
bool isSymbolLinkerVisible(const MCSymbol &SD) const
Check whether a particular symbol is visible to the linker and is required in the symbol table,...
Definition: MCAssembler.cpp:162
llvm::MCAssembler::MCAssembler
MCAssembler(MCContext &Context, std::unique_ptr< MCAsmBackend > Backend, std::unique_ptr< MCCodeEmitter > Emitter, std::unique_ptr< MCObjectWriter > Writer)
Construct a new assembler instance.
Definition: MCAssembler.cpp:83
ArrayRef.h
llvm::MCAssembler::getAtom
const MCSymbol * getAtom(const MCSymbol &S) const
Find the symbol which defines the atom containing the given symbol, or null if there is no such symbo...
Definition: MCAssembler.cpp:173
llvm::MCAssembler::setELFHeaderEFlags
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:263
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCAssembler::indirect_symbol_size
size_t indirect_symbol_size() const
Definition: MCAssembler.h:393
llvm::MCAssembler::CGProfileEntry::To
const MCSymbolRefExpr * To
Definition: MCAssembler.h:438
llvm::MCAssembler::begin
const_iterator begin() const
Definition: MCAssembler.h:345
llvm::MCAssembler::isIncrementalLinkerCompatible
bool isIncrementalLinkerCompatible() const
Definition: MCAssembler.h:321
llvm::MCAssembler::getRelaxAll
bool getRelaxAll() const
Definition: MCAssembler.h:328
iterator_range.h
llvm::MCAssembler::setRelaxAll
void setRelaxAll(bool Value)
Definition: MCAssembler.h:329
llvm::MCAssembler::~MCAssembler
~MCAssembler()
llvm::MCAssembler::const_data_region_iterator
std::vector< DataRegionData >::const_iterator const_data_region_iterator
Definition: MCAssembler.h:82
llvm::MCSymbolRefExpr
Represent a reference to a symbol from inside an expression.
Definition: MCExpr.h:192
llvm::MCAssembler::getIndirectSymbols
std::vector< IndirectSymbolData > & getIndirectSymbols()
Definition: MCAssembler.h:375
llvm::MCAssembler::symbol_size
size_t symbol_size() const
Definition: MCAssembler.h:366
llvm::MCAssembler::Type
MCVersionMinType Type
Used when EmitBuildVersion==false.
Definition: MCAssembler.h:91
llvm::IndirectSymbolData
Definition: MCAssembler.h:45
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::MCAssembler::Major
unsigned Major
Definition: MCAssembler.h:94
llvm::MCAssembler::Symver
Definition: MCAssembler.h:214
llvm::DataRegionData::Kind
enum llvm::DataRegionData::KindTy Kind
MCFixup.h
llvm::MCObjectWriter
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Definition: MCObjectWriter.h:33
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::MCAssembler::getFileNames
MutableArrayRef< std::pair< std::string, size_t > > getFileNames()
Definition: MCAssembler.h:450
llvm::MCAssembler::setVersionMin
void setVersionMin(MCVersionMinType Type, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
Definition: MCAssembler.h:267
llvm::DataRegionData::JumpTable16
@ JumpTable16
Definition: MCAssembler.h:55
llvm::MCAssembler::Symver::KeepOriginalSym
bool KeepOriginalSym
Definition: MCAssembler.h:219
llvm::MCAssembler::layout
void layout(MCAsmLayout &Layout)
Definition: MCAssembler.cpp:819
llvm::MCAssembler::addFileName
void addFileName(StringRef FileName)
Definition: MCAssembler.h:454
llvm::MCAsmLayout
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:28
llvm::MCCodeEmitter
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:21
llvm::MCAssembler::getLOHContainer
MCLOHContainer & getLOHContainer()
Definition: MCAssembler.h:431
llvm::MCAssembler::Platform
MachO::PlatformType Platform
Used when EmitBuildVersion==true.
Definition: MCAssembler.h:92
llvm::MCAssembler::VersionInfoType
struct { bool EmitBuildVersion VersionInfoType
MachO specific deployment target version info.
Definition: MCAssembler.h:89
llvm::MCAssembler::Symver::Name
StringRef Name
Definition: MCAssembler.h:217
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::MCAssembler::setDWARFLinetableParams
void setDWARFLinetableParams(MCDwarfLineTableParams P)
Definition: MCAssembler.h:307
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79
llvm::MCAssembler::registerSection
bool registerSection(MCSection &Section)
Definition: MCAssembler.cpp:123
MCLinkerOptimizationHint.h
llvm::MCAssembler::end
iterator end()
Definition: MCAssembler.h:347
llvm::MCLEBFragment
Definition: MCFragment.h:415
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::MCAssembler::getVersionInfo
const VersionInfoType & getVersionInfo() const
MachO deployment target version information.
Definition: MCAssembler.h:266
llvm::MCAssembler::setBuildVersion
void setBuildVersion(MachO::PlatformType Platform, unsigned Major, unsigned Minor, unsigned Update, VersionTuple SDKVersion=VersionTuple())
Definition: MCAssembler.h:277
llvm::MCAssembler::end
const_iterator end() const
Definition: MCAssembler.h:348
llvm::IndirectSymbolData::Section
MCSection * Section
Definition: MCAssembler.h:47
llvm::MCAssembler::SectionListType
std::vector< MCSection * > SectionListType
Definition: MCAssembler.h:64
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::MCAssembler::dump
void dump() const
Definition: MCAssembler.cpp:1277
llvm::MCAssembler::setSubsectionsViaSymbols
void setSubsectionsViaSymbols(bool Value)
Definition: MCAssembler.h:319
llvm::MCAssembler::data_region_iterator
std::vector< DataRegionData >::iterator data_region_iterator
Definition: MCAssembler.h:83
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::MCValue
This represents an "assembler immediate".
Definition: MCValue.h:37
llvm::MCAssembler::size
size_t size() const
Definition: MCAssembler.h:350
llvm::MCAssembler::indirect_symbol_begin
const_indirect_symbol_iterator indirect_symbol_begin() const
Definition: MCAssembler.h:382
MachO.h
llvm::MCAssembler::getBackendPtr
MCAsmBackend * getBackendPtr() const
Definition: MCAssembler.h:294
llvm::pointee_iterator
An iterator type that allows iterating over the pointees via some other iterator.
Definition: iterator.h:296
llvm::MCAssembler::getSubsectionsViaSymbols
bool getSubsectionsViaSymbols() const
Definition: MCAssembler.h:318
llvm::MCAssembler::getDWARFLinetableParams
MCDwarfLineTableParams getDWARFLinetableParams() const
Definition: MCAssembler.h:306
llvm::MCAssembler::indirect_symbol_iterator
std::vector< IndirectSymbolData >::iterator indirect_symbol_iterator
Definition: MCAssembler.h:79
llvm::MCAssembler::isBundlingEnabled
bool isBundlingEnabled() const
Definition: MCAssembler.h:331
llvm::MCFixup
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
Definition: MCFixup.h:81
llvm::MCCVDefRangeFragment
Fragment representing the .cv_def_range directive.
Definition: MCFragment.h:536
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::MCAssembler::CGProfileEntry
Definition: MCAssembler.h:436
llvm::SmallPtrSetImpl::insert
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:364
llvm::MCBoundaryAlignFragment
Represents required padding such that a particular other set of fragments does not cross a particular...
Definition: MCFragment.h:566
llvm::MCAssembler::getWriter
MCObjectWriter & getWriter() const
Definition: MCAssembler.h:304
llvm::MCAssembler::CGProfile
std::vector< CGProfileEntry > CGProfile
Definition: MCAssembler.h:441