LLVM  3.7.0
MCContext.cpp
Go to the documentation of this file.
1 //===- lib/MC/MCContext.cpp - Machine Code Context ------------------------===//
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/MC/MCContext.h"
11 #include "llvm/ADT/SmallString.h"
12 #include "llvm/ADT/Twine.h"
13 #include "llvm/MC/MCAssembler.h"
14 #include "llvm/MC/MCAsmInfo.h"
15 #include "llvm/MC/MCDwarf.h"
16 #include "llvm/MC/MCLabel.h"
18 #include "llvm/MC/MCRegisterInfo.h"
19 #include "llvm/MC/MCSectionCOFF.h"
20 #include "llvm/MC/MCSectionELF.h"
21 #include "llvm/MC/MCSectionMachO.h"
22 #include "llvm/MC/MCStreamer.h"
23 #include "llvm/MC/MCSymbolCOFF.h"
24 #include "llvm/MC/MCSymbolELF.h"
25 #include "llvm/MC/MCSymbolMachO.h"
26 #include "llvm/Support/ELF.h"
30 #include "llvm/Support/Signals.h"
31 #include "llvm/Support/SourceMgr.h"
32 #include <map>
33 
34 using namespace llvm;
35 
36 MCContext::MCContext(const MCAsmInfo *mai, const MCRegisterInfo *mri,
37  const MCObjectFileInfo *mofi, const SourceMgr *mgr,
38  bool DoAutoReset)
39  : SrcMgr(mgr), MAI(mai), MRI(mri), MOFI(mofi), Allocator(),
40  Symbols(Allocator), UsedNames(Allocator),
41  CurrentDwarfLoc(0, 0, 0, DWARF2_FLAG_IS_STMT, 0, 0), DwarfLocSeen(false),
42  GenDwarfForAssembly(false), GenDwarfFileNumber(0), DwarfVersion(4),
43  AllowTemporaryLabels(true), DwarfCompileUnitID(0),
44  AutoReset(DoAutoReset) {
45 
46  std::error_code EC = llvm::sys::fs::current_path(CompilationDir);
47  if (EC)
48  CompilationDir.clear();
49 
50  SecureLogFile = getenv("AS_SECURE_LOG_FILE");
51  SecureLog = nullptr;
52  SecureLogUsed = false;
53 
54  if (SrcMgr && SrcMgr->getNumBuffers())
55  MainFileName =
56  SrcMgr->getMemoryBuffer(SrcMgr->getMainFileID())->getBufferIdentifier();
57 }
58 
60  if (AutoReset)
61  reset();
62 
63  // NOTE: The symbols are all allocated out of a bump pointer allocator,
64  // we don't need to free them here.
65 
66  // If the stream for the .secure_log_unique directive was created free it.
67  delete (raw_ostream *)SecureLog;
68 }
69 
70 //===----------------------------------------------------------------------===//
71 // Module Lifetime Management
72 //===----------------------------------------------------------------------===//
73 
75  // Call the destructors so the fragments are freed
76  for (auto &I : ELFUniquingMap)
77  I.second->~MCSectionELF();
78  for (auto &I : COFFUniquingMap)
79  I.second->~MCSectionCOFF();
80  for (auto &I : MachOUniquingMap)
81  I.second->~MCSectionMachO();
82 
83  UsedNames.clear();
84  Symbols.clear();
85  Allocator.Reset();
86  Instances.clear();
87  CompilationDir.clear();
88  MainFileName.clear();
89  MCDwarfLineTablesCUMap.clear();
90  SectionsForRanges.clear();
91  MCGenDwarfLabelEntries.clear();
92  DwarfDebugFlags = StringRef();
93  DwarfCompileUnitID = 0;
94  CurrentDwarfLoc = MCDwarfLoc(0, 0, 0, DWARF2_FLAG_IS_STMT, 0, 0);
95 
96  MachOUniquingMap.clear();
97  ELFUniquingMap.clear();
98  COFFUniquingMap.clear();
99 
100  NextID.clear();
101  AllowTemporaryLabels = true;
102  DwarfLocSeen = false;
103  GenDwarfForAssembly = false;
104  GenDwarfFileNumber = 0;
105 }
106 
107 //===----------------------------------------------------------------------===//
108 // Symbol Manipulation
109 //===----------------------------------------------------------------------===//
110 
112  SmallString<128> NameSV;
113  StringRef NameRef = Name.toStringRef(NameSV);
114 
115  assert(!NameRef.empty() && "Normal symbols cannot be unnamed!");
116 
117  MCSymbol *&Sym = Symbols[NameRef];
118  if (!Sym)
119  Sym = createSymbol(NameRef, false, false);
120 
121  return Sym;
122 }
123 
125  MCSymbolELF *&Sym = SectionSymbols[&Section];
126  if (Sym)
127  return Sym;
128 
129  StringRef Name = Section.getSectionName();
130 
131  MCSymbol *&OldSym = Symbols[Name];
132  if (OldSym && OldSym->isUndefined()) {
133  Sym = cast<MCSymbolELF>(OldSym);
134  return Sym;
135  }
136 
137  auto NameIter = UsedNames.insert(std::make_pair(Name, true)).first;
138  Sym = new (&*NameIter, *this) MCSymbolELF(&*NameIter, /*isTemporary*/ false);
139 
140  if (!OldSym)
141  OldSym = Sym;
142 
143  return Sym;
144 }
145 
147  unsigned Idx) {
148  return getOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + FuncName +
149  "$frame_escape_" + Twine(Idx));
150 }
151 
153  return getOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + FuncName +
154  "$parent_frame_offset");
155 }
156 
158  return getOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + "__ehtable$" +
159  FuncName);
160 }
161 
162 MCSymbol *MCContext::createSymbolImpl(const StringMapEntry<bool> *Name,
163  bool IsTemporary) {
164  if (MOFI) {
165  switch (MOFI->getObjectFileType()) {
167  return new (Name, *this) MCSymbolCOFF(Name, IsTemporary);
169  return new (Name, *this) MCSymbolELF(Name, IsTemporary);
171  return new (Name, *this) MCSymbolMachO(Name, IsTemporary);
172  }
173  }
174  return new (Name, *this) MCSymbol(MCSymbol::SymbolKindUnset, Name,
175  IsTemporary);
176 }
177 
178 MCSymbol *MCContext::createSymbol(StringRef Name, bool AlwaysAddSuffix,
179  bool CanBeUnnamed) {
180  if (CanBeUnnamed && !UseNamesOnTempLabels)
181  return createSymbolImpl(nullptr, true);
182 
183  // Determine whether this is an user writter assembler temporary or normal
184  // label, if used.
185  bool IsTemporary = CanBeUnnamed;
186  if (AllowTemporaryLabels && !IsTemporary)
187  IsTemporary = Name.startswith(MAI->getPrivateGlobalPrefix());
188 
189  SmallString<128> NewName = Name;
190  bool AddSuffix = AlwaysAddSuffix;
191  unsigned &NextUniqueID = NextID[Name];
192  for (;;) {
193  if (AddSuffix) {
194  NewName.resize(Name.size());
195  raw_svector_ostream(NewName) << NextUniqueID++;
196  }
197  auto NameEntry = UsedNames.insert(std::make_pair(NewName, true));
198  if (NameEntry.second) {
199  // Ok, we found a name. Have the MCSymbol object itself refer to the copy
200  // of the string that is embedded in the UsedNames entry.
201  return createSymbolImpl(&*NameEntry.first, IsTemporary);
202  }
203  assert(IsTemporary && "Cannot rename non-temporary symbols");
204  AddSuffix = true;
205  }
206  llvm_unreachable("Infinite loop");
207 }
208 
209 MCSymbol *MCContext::createTempSymbol(const Twine &Name, bool AlwaysAddSuffix,
210  bool CanBeUnnamed) {
211  SmallString<128> NameSV;
212  raw_svector_ostream(NameSV) << MAI->getPrivateGlobalPrefix() << Name;
213  return createSymbol(NameSV, AlwaysAddSuffix, CanBeUnnamed);
214 }
215 
217  SmallString<128> NameSV;
218  raw_svector_ostream(NameSV) << MAI->getLinkerPrivateGlobalPrefix() << "tmp";
219  return createSymbol(NameSV, true, false);
220 }
221 
223  return createTempSymbol("tmp", true, CanBeUnnamed);
224 }
225 
226 unsigned MCContext::NextInstance(unsigned LocalLabelVal) {
227  MCLabel *&Label = Instances[LocalLabelVal];
228  if (!Label)
229  Label = new (*this) MCLabel(0);
230  return Label->incInstance();
231 }
232 
233 unsigned MCContext::GetInstance(unsigned LocalLabelVal) {
234  MCLabel *&Label = Instances[LocalLabelVal];
235  if (!Label)
236  Label = new (*this) MCLabel(0);
237  return Label->getInstance();
238 }
239 
240 MCSymbol *MCContext::getOrCreateDirectionalLocalSymbol(unsigned LocalLabelVal,
241  unsigned Instance) {
242  MCSymbol *&Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)];
243  if (!Sym)
244  Sym = createTempSymbol(false);
245  return Sym;
246 }
247 
249  unsigned Instance = NextInstance(LocalLabelVal);
250  return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
251 }
252 
254  bool Before) {
255  unsigned Instance = GetInstance(LocalLabelVal);
256  if (!Before)
257  ++Instance;
258  return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
259 }
260 
262  SmallString<128> NameSV;
263  StringRef NameRef = Name.toStringRef(NameSV);
264  return Symbols.lookup(NameRef);
265 }
266 
267 //===----------------------------------------------------------------------===//
268 // Section Management
269 //===----------------------------------------------------------------------===//
270 
272  unsigned TypeAndAttributes,
273  unsigned Reserved2, SectionKind Kind,
274  const char *BeginSymName) {
275 
276  // We unique sections by their segment/section pair. The returned section
277  // may not have the same flags as the requested section, if so this should be
278  // diagnosed by the client as an error.
279 
280  // Form the name to look up.
282  Name += Segment;
283  Name.push_back(',');
284  Name += Section;
285 
286  // Do the lookup, if we have a hit, return it.
287  MCSectionMachO *&Entry = MachOUniquingMap[Name];
288  if (Entry)
289  return Entry;
290 
291  MCSymbol *Begin = nullptr;
292  if (BeginSymName)
293  Begin = createTempSymbol(BeginSymName, false);
294 
295  // Otherwise, return a new section.
296  return Entry = new (*this) MCSectionMachO(Segment, Section, TypeAndAttributes,
297  Reserved2, Kind, Begin);
298 }
299 
301  StringRef GroupName;
302  if (const MCSymbol *Group = Section->getGroup())
303  GroupName = Group->getName();
304 
305  unsigned UniqueID = Section->getUniqueID();
306  ELFUniquingMap.erase(
307  ELFSectionKey{Section->getSectionName(), GroupName, UniqueID});
308  auto I = ELFUniquingMap.insert(std::make_pair(
309  ELFSectionKey{Name, GroupName, UniqueID},
310  Section))
311  .first;
312  StringRef CachedName = I->first.SectionName;
313  const_cast<MCSectionELF *>(Section)->setSectionName(CachedName);
314 }
315 
317  unsigned Flags, unsigned EntrySize,
318  const MCSymbolELF *Group,
319  const MCSectionELF *Associated) {
321  bool Inserted;
322  std::tie(I, Inserted) = ELFRelSecNames.insert(std::make_pair(Name, true));
323 
324  return new (*this)
326  EntrySize, Group, true, nullptr, Associated);
327 }
328 
330  unsigned Flags, unsigned EntrySize,
331  StringRef Group, unsigned UniqueID,
332  const char *BeginSymName) {
333  MCSymbolELF *GroupSym = nullptr;
334  if (!Group.empty())
335  GroupSym = cast<MCSymbolELF>(getOrCreateSymbol(Group));
336 
337  return getELFSection(Section, Type, Flags, EntrySize, GroupSym, UniqueID,
338  BeginSymName, nullptr);
339 }
340 
342  unsigned Flags, unsigned EntrySize,
343  const MCSymbolELF *GroupSym,
344  unsigned UniqueID,
345  const char *BeginSymName,
346  const MCSectionELF *Associated) {
347  StringRef Group = "";
348  if (GroupSym)
349  Group = GroupSym->getName();
350  // Do the lookup, if we have a hit, return it.
351  auto IterBool = ELFUniquingMap.insert(
352  std::make_pair(ELFSectionKey{Section, Group, UniqueID}, nullptr));
353  auto &Entry = *IterBool.first;
354  if (!IterBool.second)
355  return Entry.second;
356 
357  StringRef CachedName = Entry.first.SectionName;
358 
360  if (Flags & ELF::SHF_EXECINSTR)
361  Kind = SectionKind::getText();
362  else
363  Kind = SectionKind::getReadOnly();
364 
365  MCSymbol *Begin = nullptr;
366  if (BeginSymName)
367  Begin = createTempSymbol(BeginSymName, false);
368 
369  MCSectionELF *Result =
370  new (*this) MCSectionELF(CachedName, Type, Flags, Kind, EntrySize,
371  GroupSym, UniqueID, Begin, Associated);
372  Entry.second = Result;
373  return Result;
374 }
375 
377  MCSectionELF *Result = new (*this)
379  Group, ~0, nullptr, nullptr);
380  return Result;
381 }
382 
384  unsigned Characteristics,
386  StringRef COMDATSymName, int Selection,
387  const char *BeginSymName) {
388  MCSymbol *COMDATSymbol = nullptr;
389  if (!COMDATSymName.empty()) {
390  COMDATSymbol = getOrCreateSymbol(COMDATSymName);
391  COMDATSymName = COMDATSymbol->getName();
392  }
393 
394  // Do the lookup, if we have a hit, return it.
395  COFFSectionKey T{Section, COMDATSymName, Selection};
396  auto IterBool = COFFUniquingMap.insert(std::make_pair(T, nullptr));
397  auto Iter = IterBool.first;
398  if (!IterBool.second)
399  return Iter->second;
400 
401  MCSymbol *Begin = nullptr;
402  if (BeginSymName)
403  Begin = createTempSymbol(BeginSymName, false);
404 
405  StringRef CachedName = Iter->first.SectionName;
406  MCSectionCOFF *Result = new (*this) MCSectionCOFF(
407  CachedName, Characteristics, COMDATSymbol, Selection, Kind, Begin);
408 
409  Iter->second = Result;
410  return Result;
411 }
412 
414  unsigned Characteristics,
416  const char *BeginSymName) {
417  return getCOFFSection(Section, Characteristics, Kind, "", 0, BeginSymName);
418 }
419 
421  COFFSectionKey T{Section, "", 0};
422  auto Iter = COFFUniquingMap.find(T);
423  if (Iter == COFFUniquingMap.end())
424  return nullptr;
425  return Iter->second;
426 }
427 
429  const MCSymbol *KeySym) {
430  // Return the normal section if we don't have to be associative.
431  if (!KeySym)
432  return Sec;
433 
434  // Make an associative section with the same name and kind as the normal
435  // section.
436  unsigned Characteristics =
438  return getCOFFSection(Sec->getSectionName(), Characteristics, Sec->getKind(),
439  KeySym->getName(),
441 }
442 
443 //===----------------------------------------------------------------------===//
444 // Dwarf Management
445 //===----------------------------------------------------------------------===//
446 
447 /// getDwarfFile - takes a file name an number to place in the dwarf file and
448 /// directory tables. If the file number has already been allocated it is an
449 /// error and zero is returned and the client reports the error, else the
450 /// allocated file number is returned. The file numbers may be in any order.
451 unsigned MCContext::getDwarfFile(StringRef Directory, StringRef FileName,
452  unsigned FileNumber, unsigned CUID) {
453  MCDwarfLineTable &Table = MCDwarfLineTablesCUMap[CUID];
454  return Table.getFile(Directory, FileName, FileNumber);
455 }
456 
457 /// isValidDwarfFileNumber - takes a dwarf file number and returns true if it
458 /// currently is assigned and false otherwise.
459 bool MCContext::isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID) {
460  const SmallVectorImpl<MCDwarfFile> &MCDwarfFiles = getMCDwarfFiles(CUID);
461  if (FileNumber == 0 || FileNumber >= MCDwarfFiles.size())
462  return false;
463 
464  return !MCDwarfFiles[FileNumber].Name.empty();
465 }
466 
467 /// Remove empty sections from SectionStartEndSyms, to avoid generating
468 /// useless debug info for them.
470  SectionsForRanges.remove_if(
471  [&](MCSection *Sec) { return !MCOS.mayHaveInstructions(*Sec); });
472 }
473 
474 void MCContext::reportFatalError(SMLoc Loc, const Twine &Msg) const {
475  // If we have a source manager and a location, use it. Otherwise just
476  // use the generic report_fatal_error().
477  if (!SrcMgr || Loc == SMLoc())
478  report_fatal_error(Msg, false);
479 
480  // Use the source manager to print the message.
481  SrcMgr->PrintMessage(Loc, SourceMgr::DK_Error, Msg);
482 
483  // If we reached here, we are failing ungracefully. Run the interrupt handlers
484  // to make sure any special cleanups get done, in particular that we remove
485  // files registered with RemoveFileOnSignal.
487  exit(1);
488 }
MCSymbolELF * getOrCreateSectionSymbol(const MCSectionELF &Section)
Definition: MCContext.cpp:124
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
void push_back(const T &Elt)
Definition: SmallVector.h:222
MCSymbol * getDirectionalLocalSymbol(unsigned LocalLabelVal, bool Before)
Create and return a directional local symbol for numbered label (used for "1b" or 1f" references)...
Definition: MCContext.cpp:253
StringRef getSectionName() const
Definition: MCSectionELF.h:75
MCSectionMachO - This represents a section on a Mach-O system (used by Mac OS X). ...
size_t size() const
size - Get the string size.
Definition: StringRef.h:113
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
MCSectionELF * getELFSection(StringRef Section, unsigned Type, unsigned Flags)
Definition: MCContext.h:311
const SmallVectorImpl< MCDwarfFile > & getMCDwarfFiles(unsigned CUID=0)
Definition: MCContext.h:423
MCSymbol * getOrCreateFrameAllocSymbol(StringRef FuncName, unsigned Idx)
Gets a symbol that will be defined to the final stack offset of a local variable after codegen...
Definition: MCContext.cpp:146
void reset()
reset - return object to right after construction state to prepare to process a new module ...
Definition: MCContext.cpp:74
SourceMgr SrcMgr
const char * getPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:450
MCSymbol * createDirectionalLocalSymbol(unsigned LocalLabelVal)
Create the definition of a directional local symbol for numbered label (used for "1:" definitions)...
Definition: MCContext.cpp:248
LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L, const Twine &Msg) const
Definition: MCContext.cpp:474
unsigned getUniqueID() const
Definition: MCSectionELF.h:87
const char * getLinkerPrivateGlobalPrefix() const
Definition: MCAsmInfo.h:455
MCSymbol * getOrCreateParentFrameOffsetSymbol(StringRef FuncName)
Definition: MCContext.cpp:152
A raw_ostream that writes to an SmallVector or SmallString.
Definition: raw_ostream.h:488
std::error_code current_path(SmallVectorImpl< char > &result)
Get the current path.
MCSymbol * lookupSymbol(const Twine &Name) const
Get the symbol for Name, or null.
Definition: MCContext.cpp:261
unsigned getInstance() const
Get the current instance of this Directional Local Label.
Definition: MCLabel.h:39
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
MCSectionCOFF - This represents a section on Windows.
Definition: MCSectionCOFF.h:25
unsigned getMainFileID() const
Definition: SourceMgr.h:111
#define DWARF2_FLAG_IS_STMT
Definition: MCDwarf.h:68
MCSymbol * createLinkerPrivateTempSymbol()
Create and return a new linker temporary symbol with a unique but unspecified name.
Definition: MCContext.cpp:216
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79
void Reset()
Deallocate all but the current slab and reset the current pointer to the beginning of it...
Definition: Allocator.h:189
void renameELFSection(MCSectionELF *Section, StringRef Name)
Definition: MCContext.cpp:300
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:98
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APInt.h:33
void finalizeDwarfSections(MCStreamer &MCOS)
Remove empty sections from SectionStartEndSyms, to avoid generating useless debug info for them...
Definition: MCContext.cpp:469
virtual bool mayHaveInstructions(MCSection &Sec) const
Definition: MCStreamer.h:715
#define false
Definition: ConvertUTF.c:65
MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
Return the MCSection for the specified mach-o section.
Definition: MCContext.cpp:271
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
Definition: SmallVector.h:57
Environment getObjectFileType() const
Instances of this class represent the information from a dwarf .loc directive.
Definition: MCDwarf.h:56
static cl::opt< std::string > FuncName("cppfname", cl::desc("Specify the name of the generated function"), cl::value_desc("function name"))
const MCSymbolELF * getGroup() const
Definition: MCSectionELF.h:79
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:58
#define true
Definition: ConvertUTF.c:66
Streaming machine code generation interface.
Definition: MCStreamer.h:157
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
Definition: MCContext.cpp:222
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
unsigned getNumBuffers() const
Definition: SourceMgr.h:107
void RunInterruptHandlers()
This function runs all the registered interrupt handlers, including the removal of files registered b...
cl::opt< int > DwarfVersion("dwarf-version", cl::desc("Dwarf version"), cl::init(0))
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:28
MCSectionELF * createELFRelSection(StringRef Name, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, const MCSectionELF *Associated)
Definition: MCContext.cpp:316
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
Definition: SourceMgr.h:35
unsigned getCharacteristics() const
Definition: MCSectionCOFF.h:64
bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID=0)
isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and f...
Definition: MCContext.cpp:459
unsigned incInstance()
Increment the current instance of this Directional Local Label.
Definition: MCLabel.h:42
bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
Definition: StringRef.h:215
ValueTy lookup(StringRef Key) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: StringMap.h:279
SectionKind getKind() const
Definition: MCSection.h:109
MCSymbol * getOrCreateLSDASymbol(StringRef FuncName)
Definition: MCContext.cpp:157
StringRef getSectionName() const
Definition: MCSectionCOFF.h:63
StringRef toStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single StringRef if it can be represented as such.
Definition: Twine.h:454
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
Definition: StringMap.h:298
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:214
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:205
const MemoryBuffer * getMemoryBuffer(unsigned i) const
Definition: SourceMgr.h:102
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition: MCContext.cpp:111
MCSectionCOFF * getAssociativeCOFFSection(MCSectionCOFF *Sec, const MCSymbol *KeySym)
Gets or creates a section equivalent to Sec that is associated with the section containing KeySym...
Definition: MCContext.cpp:428
#define I(x, y, z)
Definition: MD5.cpp:54
COFFYAML::WeakExternalCharacteristics Characteristics
Definition: COFFYAML.cpp:268
MCSectionELF - This represents a section on linux, lots of unix variants and some bare metal systems...
Definition: MCSectionELF.h:30
MCSectionELF * createELFGroupSection(const MCSymbolELF *Group)
Definition: MCContext.cpp:376
MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, const char *BeginSymName=nullptr)
Definition: MCContext.cpp:383
Instances of this class represent a label name in the MC file, and MCLabel are created and uniqued by...
Definition: MCLabel.h:26
const ARM::ArchExtKind Kind
unsigned getDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, unsigned CUID)
Creates an entry in the dwarf file and directory tables.
Definition: MCContext.cpp:451
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:38
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
bool isUndefined() const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
Definition: MCSymbol.h:258
void PrintMessage(raw_ostream &OS, SMLoc Loc, DiagKind Kind, const Twine &Msg, ArrayRef< SMRange > Ranges=None, ArrayRef< SMFixIt > FixIts=None, bool ShowColors=true) const
Emit a message about the specified location with the specified string.
Definition: SourceMgr.cpp:215
Represents a location in source code.
Definition: SMLoc.h:23
unsigned getFile(StringRef &Directory, StringRef &FileName, unsigned FileNumber=0)
Definition: MCDwarf.cpp:344
static SectionKind getReadOnly()
Definition: SectionKind.h:208
bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:110
static SectionKind getText()
Definition: SectionKind.h:207
void resize(size_type N)
Definition: SmallVector.h:376