LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MCContext.h
Go to the documentation of this file.
1 //===- MCContext.h - Machine Code Context -----------------------*- C++ -*-===//
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 #ifndef LLVM_MC_MCCONTEXT_H
11 #define LLVM_MC_MCCONTEXT_H
12 
13 #include "llvm/ADT/DenseMap.h"
14 #include "llvm/ADT/SmallString.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/StringMap.h"
17 #include "llvm/MC/MCDwarf.h"
18 #include "llvm/MC/SectionKind.h"
19 #include "llvm/Support/Allocator.h"
20 #include "llvm/Support/Compiler.h"
22 #include <map>
23 #include <vector> // FIXME: Shouldn't be needed.
24 
25 namespace llvm {
26  class MCAsmInfo;
27  class MCExpr;
28  class MCSection;
29  class MCSymbol;
30  class MCLabel;
31  class MCDwarfFile;
32  class MCDwarfLoc;
33  class MCObjectFileInfo;
34  class MCRegisterInfo;
35  class MCLineSection;
36  class SMLoc;
37  class StringRef;
38  class Twine;
39  class MCSectionMachO;
40  class MCSectionELF;
41  class MCSectionCOFF;
42 
43  /// MCContext - Context object for machine code objects. This class owns all
44  /// of the sections that it creates.
45  ///
46  class MCContext {
48  MCContext &operator=(const MCContext&) LLVM_DELETED_FUNCTION;
49  public:
51  private:
52  /// The SourceMgr for this object, if any.
53  const SourceMgr *SrcMgr;
54 
55  /// The MCAsmInfo for this target.
56  const MCAsmInfo *MAI;
57 
58  /// The MCRegisterInfo for this target.
59  const MCRegisterInfo *MRI;
60 
61  /// The MCObjectFileInfo for this target.
62  const MCObjectFileInfo *MOFI;
63 
64  /// Allocator - Allocator object used for creating machine code objects.
65  ///
66  /// We use a bump pointer allocator to avoid the need to track all allocated
67  /// objects.
68  BumpPtrAllocator Allocator;
69 
70  /// Symbols - Bindings of names to symbols.
71  SymbolTable Symbols;
72 
73  /// UsedNames - Keeps tracks of names that were used both for used declared
74  /// and artificial symbols.
76 
77  /// NextUniqueID - The next ID to dole out to an unnamed assembler temporary
78  /// symbol.
79  unsigned NextUniqueID;
80 
81  /// Instances of directional local labels.
83  /// NextInstance() creates the next instance of the directional local label
84  /// for the LocalLabelVal and adds it to the map if needed.
85  unsigned NextInstance(int64_t LocalLabelVal);
86  /// GetInstance() gets the current instance of the directional local label
87  /// for the LocalLabelVal and adds it to the map if needed.
88  unsigned GetInstance(int64_t LocalLabelVal);
89 
90  /// The file name of the log file from the environment variable
91  /// AS_SECURE_LOG_FILE. Which must be set before the .secure_log_unique
92  /// directive is used or it is an error.
93  char *SecureLogFile;
94  /// The stream that gets written to for the .secure_log_unique directive.
95  raw_ostream *SecureLog;
96  /// Boolean toggled when .secure_log_unique / .secure_log_reset is seen to
97  /// catch errors if .secure_log_unique appears twice without
98  /// .secure_log_reset appearing between them.
99  bool SecureLogUsed;
100 
101  /// The compilation directory to use for DW_AT_comp_dir.
102  SmallString<128> CompilationDir;
103 
104  /// The main file name if passed in explicitly.
105  std::string MainFileName;
106 
107  /// The dwarf file and directory tables from the dwarf .file directive.
108  /// We now emit a line table for each compile unit. To reduce the prologue
109  /// size of each line table, the files and directories used by each compile
110  /// unit are separated.
111  typedef std::map<unsigned, SmallVector<MCDwarfFile *, 4> > MCDwarfFilesMap;
112  MCDwarfFilesMap MCDwarfFilesCUMap;
113  std::map<unsigned, SmallVector<StringRef, 4> > MCDwarfDirsCUMap;
114 
115  /// The current dwarf line information from the last dwarf .loc directive.
116  MCDwarfLoc CurrentDwarfLoc;
117  bool DwarfLocSeen;
118 
119  /// Generate dwarf debugging info for assembly source files.
120  bool GenDwarfForAssembly;
121 
122  /// The current dwarf file number when generate dwarf debugging info for
123  /// assembly source files.
124  unsigned GenDwarfFileNumber;
125 
126  /// The default initial text section that we generate dwarf debugging line
127  /// info for when generating dwarf assembly source files.
128  const MCSection *GenDwarfSection;
129  /// Symbols created for the start and end of this section.
130  MCSymbol *GenDwarfSectionStartSym, *GenDwarfSectionEndSym;
131 
132  /// The information gathered from labels that will have dwarf label
133  /// entries when generating dwarf assembly source files.
134  std::vector<const MCGenDwarfLabelEntry *> MCGenDwarfLabelEntries;
135 
136  /// The string to embed in the debug information for the compile unit, if
137  /// non-empty.
138  StringRef DwarfDebugFlags;
139 
140  /// The string to embed in as the dwarf AT_producer for the compile unit, if
141  /// non-empty.
142  StringRef DwarfDebugProducer;
143 
144  /// Honor temporary labels, this is useful for debugging semantic
145  /// differences between temporary and non-temporary labels (primarily on
146  /// Darwin).
147  bool AllowTemporaryLabels;
148 
149  /// The dwarf line information from the .loc directives for the sections
150  /// with assembled machine instructions have after seeing .loc directives.
152  /// We need a deterministic iteration order, so we remember the order
153  /// the elements were added.
154  std::vector<const MCSection *> MCLineSectionOrder;
155  /// The Compile Unit ID that we are currently processing.
156  unsigned DwarfCompileUnitID;
157  /// The line table start symbol for each Compile Unit.
158  DenseMap<unsigned, MCSymbol *> MCLineTableSymbols;
159 
160  void *MachOUniquingMap, *ELFUniquingMap, *COFFUniquingMap;
161 
162  /// Do automatic reset in destructor
163  bool AutoReset;
164 
165  MCSymbol *CreateSymbol(StringRef Name);
166 
167  public:
168  explicit MCContext(const MCAsmInfo *MAI, const MCRegisterInfo *MRI,
169  const MCObjectFileInfo *MOFI, const SourceMgr *Mgr = 0,
170  bool DoAutoReset = true);
171  ~MCContext();
172 
173  const SourceMgr *getSourceManager() const { return SrcMgr; }
174 
175  const MCAsmInfo *getAsmInfo() const { return MAI; }
176 
177  const MCRegisterInfo *getRegisterInfo() const { return MRI; }
178 
179  const MCObjectFileInfo *getObjectFileInfo() const { return MOFI; }
180 
181  void setAllowTemporaryLabels(bool Value) { AllowTemporaryLabels = Value; }
182 
183  /// @name Module Lifetime Management
184  /// @{
185 
186  /// reset - return object to right after construction state to prepare
187  /// to process a new module
188  void reset();
189 
190  /// @}
191 
192  /// @name Symbol Management
193  /// @{
194 
195  /// CreateTempSymbol - Create and return a new assembler temporary symbol
196  /// with a unique but unspecified name.
198 
199  /// getUniqueSymbolID() - Return a unique identifier for use in constructing
200  /// symbol names.
201  unsigned getUniqueSymbolID() { return NextUniqueID++; }
202 
203  /// CreateDirectionalLocalSymbol - Create the definition of a directional
204  /// local symbol for numbered label (used for "1:" definitions).
205  MCSymbol *CreateDirectionalLocalSymbol(int64_t LocalLabelVal);
206 
207  /// GetDirectionalLocalSymbol - Create and return a directional local
208  /// symbol for numbered label (used for "1b" or 1f" references).
209  MCSymbol *GetDirectionalLocalSymbol(int64_t LocalLabelVal, int bORf);
210 
211  /// GetOrCreateSymbol - Lookup the symbol inside with the specified
212  /// @p Name. If it exists, return it. If not, create a forward
213  /// reference and return it.
214  ///
215  /// @param Name - The symbol name, which must be unique across all symbols.
218 
219  /// LookupSymbol - Get the symbol for \p Name, or null.
221  MCSymbol *LookupSymbol(const Twine &Name) const;
222 
223  /// getSymbols - Get a reference for the symbol table for clients that
224  /// want to, for example, iterate over all symbols. 'const' because we
225  /// still want any modifications to the table itself to use the MCContext
226  /// APIs.
227  const SymbolTable &getSymbols() const {
228  return Symbols;
229  }
230 
231  /// @}
232 
233  /// @name Section Management
234  /// @{
235 
236  /// getMachOSection - Return the MCSection for the specified mach-o section.
237  /// This requires the operands to be valid.
240  unsigned TypeAndAttributes,
241  unsigned Reserved2,
242  SectionKind K);
245  unsigned TypeAndAttributes,
246  SectionKind K) {
247  return getMachOSection(Segment, Section, TypeAndAttributes, 0, K);
248  }
249 
251  unsigned Flags, SectionKind Kind);
252 
254  unsigned Flags, SectionKind Kind,
255  unsigned EntrySize, StringRef Group);
256 
258 
260  unsigned Characteristics,
261  SectionKind Kind, int Selection = 0,
262  const MCSectionCOFF *Assoc = 0);
263 
265 
266  /// @}
267 
268  /// @name Dwarf Management
269  /// @{
270 
271  /// \brief Get the compilation directory for DW_AT_comp_dir
272  /// This can be overridden by clients which want to control the reported
273  /// compilation directory and have it be something other than the current
274  /// working directory.
275  StringRef getCompilationDir() const { return CompilationDir; }
276 
277  /// \brief Set the compilation directory for DW_AT_comp_dir
278  /// Override the default (CWD) compilation directory.
279  void setCompilationDir(StringRef S) { CompilationDir = S.str(); }
280 
281  /// \brief Get the main file name for use in error messages and debug
282  /// info. This can be set to ensure we've got the correct file name
283  /// after preprocessing or for -save-temps.
284  const std::string &getMainFileName() const { return MainFileName; }
285 
286  /// \brief Set the main file name and override the default.
287  void setMainFileName(StringRef S) { MainFileName = S.str(); }
288 
289  /// GetDwarfFile - creates an entry in the dwarf file and directory tables.
290  unsigned GetDwarfFile(StringRef Directory, StringRef FileName,
291  unsigned FileNumber, unsigned CUID);
292 
293  bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID = 0);
294 
295  bool hasDwarfFiles() const {
296  // Traverse MCDwarfFilesCUMap and check whether each entry is empty.
297  MCDwarfFilesMap::const_iterator MapB, MapE;
298  for (MapB = MCDwarfFilesCUMap.begin(), MapE = MCDwarfFilesCUMap.end();
299  MapB != MapE; MapB++)
300  if (!MapB->second.empty())
301  return true;
302  return false;
303  }
304 
306  return MCDwarfFilesCUMap[CUID];
307  }
308  const SmallVectorImpl<StringRef> &getMCDwarfDirs(unsigned CUID = 0) {
309  return MCDwarfDirsCUMap[CUID];
310  }
311 
313  &getMCLineSections() const {
314  return MCLineSections;
315  }
316  const std::vector<const MCSection *> &getMCLineSectionOrder() const {
317  return MCLineSectionOrder;
318  }
319  void addMCLineSection(const MCSection *Sec, MCLineSection *Line) {
320  MCLineSections[Sec] = Line;
321  MCLineSectionOrder.push_back(Sec);
322  }
324  return DwarfCompileUnitID;
325  }
326  void setDwarfCompileUnitID(unsigned CUIndex) {
327  DwarfCompileUnitID = CUIndex;
328  }
330  return MCLineTableSymbols;
331  }
332  MCSymbol *getMCLineTableSymbol(unsigned ID) const {
334  MCLineTableSymbols.find(ID);
335  if (CIter == MCLineTableSymbols.end())
336  return NULL;
337  return CIter->second;
338  }
339  void setMCLineTableSymbol(MCSymbol *Sym, unsigned ID) {
340  MCLineTableSymbols[ID] = Sym;
341  }
342 
343  /// setCurrentDwarfLoc - saves the information from the currently parsed
344  /// dwarf .loc directive and sets DwarfLocSeen. When the next instruction
345  /// is assembled an entry in the line number table with this information and
346  /// the address of the instruction will be created.
347  void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column,
348  unsigned Flags, unsigned Isa,
349  unsigned Discriminator) {
350  CurrentDwarfLoc.setFileNum(FileNum);
351  CurrentDwarfLoc.setLine(Line);
352  CurrentDwarfLoc.setColumn(Column);
353  CurrentDwarfLoc.setFlags(Flags);
354  CurrentDwarfLoc.setIsa(Isa);
355  CurrentDwarfLoc.setDiscriminator(Discriminator);
356  DwarfLocSeen = true;
357  }
358  void ClearDwarfLocSeen() { DwarfLocSeen = false; }
359 
360  bool getDwarfLocSeen() { return DwarfLocSeen; }
361  const MCDwarfLoc &getCurrentDwarfLoc() { return CurrentDwarfLoc; }
362 
363  bool getGenDwarfForAssembly() { return GenDwarfForAssembly; }
364  void setGenDwarfForAssembly(bool Value) { GenDwarfForAssembly = Value; }
365  unsigned getGenDwarfFileNumber() { return GenDwarfFileNumber; }
366  unsigned nextGenDwarfFileNumber() { return ++GenDwarfFileNumber; }
367  const MCSection *getGenDwarfSection() { return GenDwarfSection; }
368  void setGenDwarfSection(const MCSection *Sec) { GenDwarfSection = Sec; }
369  MCSymbol *getGenDwarfSectionStartSym() { return GenDwarfSectionStartSym; }
371  GenDwarfSectionStartSym = Sym;
372  }
373  MCSymbol *getGenDwarfSectionEndSym() { return GenDwarfSectionEndSym; }
375  GenDwarfSectionEndSym = Sym;
376  }
377  const std::vector<const MCGenDwarfLabelEntry *>
379  return MCGenDwarfLabelEntries;
380  }
382  MCGenDwarfLabelEntries.push_back(E);
383  }
384 
385  void setDwarfDebugFlags(StringRef S) { DwarfDebugFlags = S; }
386  StringRef getDwarfDebugFlags() { return DwarfDebugFlags; }
387 
388  void setDwarfDebugProducer(StringRef S) { DwarfDebugProducer = S; }
389  StringRef getDwarfDebugProducer() { return DwarfDebugProducer; }
390 
391  /// @}
392 
393  char *getSecureLogFile() { return SecureLogFile; }
394  raw_ostream *getSecureLog() { return SecureLog; }
395  bool getSecureLogUsed() { return SecureLogUsed; }
397  SecureLog = Value;
398  }
399  void setSecureLogUsed(bool Value) {
400  SecureLogUsed = Value;
401  }
402 
403  void *Allocate(unsigned Size, unsigned Align = 8) {
404  return Allocator.Allocate(Size, Align);
405  }
406  void Deallocate(void *Ptr) {
407  }
408 
409  // Unrecoverable error has occurred. Display the best diagnostic we can
410  // and bail via exit(1). For now, most MC backend errors are unrecoverable.
411  // FIXME: We should really do something about that.
412  LLVM_ATTRIBUTE_NORETURN void FatalError(SMLoc L, const Twine &Msg);
413  };
414 
415 } // end namespace llvm
416 
417 // operator new and delete aren't allowed inside namespaces.
418 // The throw specifications are mandated by the standard.
419 /// @brief Placement new for using the MCContext's allocator.
420 ///
421 /// This placement form of operator new uses the MCContext's allocator for
422 /// obtaining memory. It is a non-throwing new, which means that it returns
423 /// null on error. (If that is what the allocator does. The current does, so if
424 /// this ever changes, this operator will have to be changed, too.)
425 /// Usage looks like this (assuming there's an MCContext 'Context' in scope):
426 /// @code
427 /// // Default alignment (16)
428 /// IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments);
429 /// // Specific alignment
430 /// IntegerLiteral *Ex2 = new (Context, 8) IntegerLiteral(arguments);
431 /// @endcode
432 /// Please note that you cannot use delete on the pointer; it must be
433 /// deallocated using an explicit destructor call followed by
434 /// @c Context.Deallocate(Ptr).
435 ///
436 /// @param Bytes The number of bytes to allocate. Calculated by the compiler.
437 /// @param C The MCContext that provides the allocator.
438 /// @param Alignment The alignment of the allocated memory (if the underlying
439 /// allocator supports it).
440 /// @return The allocated memory. Could be NULL.
441 inline void *operator new(size_t Bytes, llvm::MCContext &C,
442  size_t Alignment = 16) throw () {
443  return C.Allocate(Bytes, Alignment);
444 }
445 /// @brief Placement delete companion to the new above.
446 ///
447 /// This operator is just a companion to the new above. There is no way of
448 /// invoking it directly; see the new operator for more details. This operator
449 /// is called implicitly by the compiler if a placement new expression using
450 /// the MCContext throws in the object constructor.
451 inline void operator delete(void *Ptr, llvm::MCContext &C, size_t)
452  throw () {
453  C.Deallocate(Ptr);
454 }
455 
456 /// This placement form of operator new[] uses the MCContext's allocator for
457 /// obtaining memory. It is a non-throwing new[], which means that it returns
458 /// null on error.
459 /// Usage looks like this (assuming there's an MCContext 'Context' in scope):
460 /// @code
461 /// // Default alignment (16)
462 /// char *data = new (Context) char[10];
463 /// // Specific alignment
464 /// char *data = new (Context, 8) char[10];
465 /// @endcode
466 /// Please note that you cannot use delete on the pointer; it must be
467 /// deallocated using an explicit destructor call followed by
468 /// @c Context.Deallocate(Ptr).
469 ///
470 /// @param Bytes The number of bytes to allocate. Calculated by the compiler.
471 /// @param C The MCContext that provides the allocator.
472 /// @param Alignment The alignment of the allocated memory (if the underlying
473 /// allocator supports it).
474 /// @return The allocated memory. Could be NULL.
475 inline void *operator new[](size_t Bytes, llvm::MCContext& C,
476  size_t Alignment = 16) throw () {
477  return C.Allocate(Bytes, Alignment);
478 }
479 
480 /// @brief Placement delete[] companion to the new[] above.
481 ///
482 /// This operator is just a companion to the new[] above. There is no way of
483 /// invoking it directly; see the new[] operator for more details. This operator
484 /// is called implicitly by the compiler if a placement new[] expression using
485 /// the MCContext throws in the object constructor.
486 inline void operator delete[](void *Ptr, llvm::MCContext &C) throw () {
487  C.Deallocate(Ptr);
488 }
489 
490 #endif
const MCSectionELF * CreateELFGroupSection()
Definition: MCContext.cpp:276
unsigned GetDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, unsigned CUID)
GetDwarfFile - creates an entry in the dwarf file and directory tables.
Definition: MCContext.cpp:319
const MCAsmInfo * getAsmInfo() const
Definition: MCContext.h:175
void setGenDwarfForAssembly(bool Value)
Definition: MCContext.h:364
MCSymbol * getGenDwarfSectionStartSym()
Definition: MCContext.h:369
MCSymbol * getGenDwarfSectionEndSym()
Definition: MCContext.h:373
void setGenDwarfSection(const MCSection *Sec)
Definition: MCContext.h:368
const MCSectionELF * getELFSection(StringRef Section, unsigned Type, unsigned Flags, SectionKind Kind)
Definition: MCContext.cpp:244
bool hasDwarfFiles() const
Definition: MCContext.h:295
unsigned getUniqueSymbolID()
Definition: MCContext.h:201
void setGenDwarfSectionStartSym(MCSymbol *Sym)
Definition: MCContext.h:370
std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:181
void setIsa(unsigned isa)
setIsa - Set the Isa of this MCDwarfLoc.
Definition: MCDwarf.h:141
const DenseMap< unsigned, MCSymbol * > & getMCLineTableSymbols() const
Definition: MCContext.h:329
StringRef getDwarfDebugFlags()
Definition: MCContext.h:386
MCSymbol * getMCLineTableSymbol(unsigned ID) const
Definition: MCContext.h:332
MCSectionCOFF - This represents a section on Windows.
Definition: MCSectionCOFF.h:24
MCSymbol * GetOrCreateSymbol(StringRef Name)
Definition: MCContext.cpp:118
StringRef getDwarfDebugProducer()
Definition: MCContext.h:389
MCSymbol * CreateTempSymbol()
Definition: MCContext.cpp:165
void ClearDwarfLocSeen()
Definition: MCContext.h:358
const std::vector< const MCSection * > & getMCLineSectionOrder() const
Definition: MCContext.h:316
ID
LLVM Calling Convention Representation.
Definition: CallingConv.h:26
const std::vector< const MCGenDwarfLabelEntry * > & getMCGenDwarfLabelEntries() const
Definition: MCContext.h:378
const MCSection * getGenDwarfSection()
Definition: MCContext.h:367
void setCompilationDir(StringRef S)
Set the compilation directory for DW_AT_comp_dir Override the default (CWD) compilation directory...
Definition: MCContext.h:279
void setLine(unsigned line)
setLine - Set the Line of this MCDwarfLoc.
Definition: MCDwarf.h:132
void addMCLineSection(const MCSection *Sec, MCLineSection *Line)
Definition: MCContext.h:319
void setGenDwarfSectionEndSym(MCSymbol *Sym)
Definition: MCContext.h:374
void setDwarfCompileUnitID(unsigned CUIndex)
Definition: MCContext.h:326
const std::string & getMainFileName() const
Get the main file name for use in error messages and debug info. This can be set to ensure we've got ...
Definition: MCContext.h:284
unsigned getDwarfCompileUnitID()
Definition: MCContext.h:323
unsigned getGenDwarfFileNumber()
Definition: MCContext.h:365
StringMap< MCSymbol *, BumpPtrAllocator & > SymbolTable
Definition: MCContext.h:50
unsigned nextGenDwarfFileNumber()
Definition: MCContext.h:366
const SmallVectorImpl< StringRef > & getMCDwarfDirs(unsigned CUID=0)
Definition: MCContext.h:308
const DenseMap< const MCSection *, MCLineSection * > & getMCLineSections() const
Definition: MCContext.h:313
void setAllowTemporaryLabels(bool Value)
Definition: MCContext.h:181
const SymbolTable & getSymbols() const
Definition: MCContext.h:227
void setDwarfDebugFlags(StringRef S)
Definition: MCContext.h:385
MCSymbol * GetDirectionalLocalSymbol(int64_t LocalLabelVal, int bORf)
Definition: MCContext.cpp:192
const MCDwarfLoc & getCurrentDwarfLoc()
Definition: MCContext.h:361
bool getSecureLogUsed()
Definition: MCContext.h:395
const SourceMgr * getSourceManager() const
Definition: MCContext.h:173
void setMCLineTableSymbol(MCSymbol *Sym, unsigned ID)
Definition: MCContext.h:339
const MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, int Selection=0, const MCSectionCOFF *Assoc=0)
Definition: MCContext.cpp:283
bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID=0)
Definition: MCContext.cpp:386
void Deallocate(void *Ptr)
Definition: MCContext.h:406
bool getGenDwarfForAssembly()
Definition: MCContext.h:363
void setMainFileName(StringRef S)
Set the main file name and override the default.
Definition: MCContext.h:287
LLVM_ATTRIBUTE_NORETURN void FatalError(SMLoc L, const Twine &Msg)
Definition: MCContext.cpp:394
const MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, SectionKind K)
Definition: MCContext.h:243
void setDwarfDebugProducer(StringRef S)
Definition: MCContext.h:388
#define LLVM_ATTRIBUTE_NORETURN
Definition: Compiler.h:274
void addMCGenDwarfLabelEntry(const MCGenDwarfLabelEntry *E)
Definition: MCContext.h:381
bool getDwarfLocSeen()
Definition: MCContext.h:360
#define LLVM_DELETED_FUNCTION
Definition: Compiler.h:137
void * Allocate(size_t Size, size_t Alignment)
Definition: Allocator.cpp:95
void setSecureLog(raw_ostream *Value)
Definition: MCContext.h:396
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(DefaultAlign), cl::values(clEnumValN(DefaultAlign,"arm-default-align","Generate unaligned accesses only on hardware/OS ""combinations that are known to support them"), clEnumValN(StrictAlign,"arm-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"arm-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
const SmallVectorImpl< MCDwarfFile * > & getMCDwarfFiles(unsigned CUID=0)
Definition: MCContext.h:305
void * Allocate(unsigned Size, unsigned Align=8)
Definition: MCContext.h:403
const MCRegisterInfo * getRegisterInfo() const
Definition: MCContext.h:177
StringRef getCompilationDir() const
Get the compilation directory for DW_AT_comp_dir This can be overridden by clients which want to cont...
Definition: MCContext.h:275
raw_ostream * getSecureLog()
Definition: MCContext.h:394
char * getSecureLogFile()
Definition: MCContext.h:393
void setFileNum(unsigned fileNum)
setFileNum - Set the FileNum of this MCDwarfLoc.
Definition: MCDwarf.h:129
void setFlags(unsigned flags)
setFlags - Set the Flags of this MCDwarfLoc.
Definition: MCDwarf.h:138
void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator)
Definition: MCContext.h:347
LLVM Value Representation.
Definition: Value.h:66
const MCObjectFileInfo * getObjectFileInfo() const
Definition: MCContext.h:179
MCSymbol * LookupSymbol(StringRef Name) const
LookupSymbol - Get the symbol for Name, or null.
Definition: MCContext.cpp:200
const MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K)
Definition: MCContext.cpp:215
void setColumn(unsigned column)
setColumn - Set the Column of this MCDwarfLoc.
Definition: MCDwarf.h:135
COFF::SectionCharacteristics Characteristics
Definition: COFFYAML.cpp:196
Represents a location in source code.
Definition: SMLoc.h:23
void setDiscriminator(unsigned discriminator)
setDiscriminator - Set the Discriminator of this MCDwarfLoc.
Definition: MCDwarf.h:144
void setSecureLogUsed(bool Value)
Definition: MCContext.h:399
MCSymbol * CreateDirectionalLocalSymbol(int64_t LocalLabelVal)
Definition: MCContext.cpp:186