10 #ifndef LLVM_MC_MCCONTEXT_H
11 #define LLVM_MC_MCCONTEXT_H
33 class MCObjectFileInfo;
79 unsigned NextUniqueID;
85 unsigned NextInstance(int64_t LocalLabelVal);
88 unsigned GetInstance(int64_t LocalLabelVal);
105 std::string MainFileName;
111 typedef std::map<unsigned, SmallVector<MCDwarfFile *, 4> > MCDwarfFilesMap;
112 MCDwarfFilesMap MCDwarfFilesCUMap;
113 std::map<unsigned, SmallVector<StringRef, 4> > MCDwarfDirsCUMap;
120 bool GenDwarfForAssembly;
124 unsigned GenDwarfFileNumber;
130 MCSymbol *GenDwarfSectionStartSym, *GenDwarfSectionEndSym;
134 std::vector<const MCGenDwarfLabelEntry *> MCGenDwarfLabelEntries;
147 bool AllowTemporaryLabels;
154 std::vector<const MCSection *> MCLineSectionOrder;
156 unsigned DwarfCompileUnitID;
160 void *MachOUniquingMap, *ELFUniquingMap, *COFFUniquingMap;
170 bool DoAutoReset =
true);
240 unsigned TypeAndAttributes,
245 unsigned TypeAndAttributes,
291 unsigned FileNumber,
unsigned CUID);
297 MCDwarfFilesMap::const_iterator MapB, MapE;
298 for (MapB = MCDwarfFilesCUMap.begin(), MapE = MCDwarfFilesCUMap.end();
299 MapB != MapE; MapB++)
300 if (!MapB->second.empty())
306 return MCDwarfFilesCUMap[CUID];
309 return MCDwarfDirsCUMap[CUID];
314 return MCLineSections;
317 return MCLineSectionOrder;
320 MCLineSections[Sec] = Line;
321 MCLineSectionOrder.push_back(Sec);
324 return DwarfCompileUnitID;
327 DwarfCompileUnitID = CUIndex;
330 return MCLineTableSymbols;
334 MCLineTableSymbols.find(ID);
335 if (CIter == MCLineTableSymbols.end())
337 return CIter->second;
340 MCLineTableSymbols[
ID] = Sym;
348 unsigned Flags,
unsigned Isa,
349 unsigned Discriminator) {
354 CurrentDwarfLoc.
setIsa(Isa);
371 GenDwarfSectionStartSym = Sym;
375 GenDwarfSectionEndSym = Sym;
377 const std::vector<const MCGenDwarfLabelEntry *>
379 return MCGenDwarfLabelEntries;
382 MCGenDwarfLabelEntries.push_back(E);
400 SecureLogUsed = Value;
442 size_t Alignment = 16)
throw () {
443 return C.Allocate(Bytes, Alignment);
476 size_t Alignment = 16)
throw () {
477 return C.Allocate(Bytes, Alignment);
const MCSectionELF * CreateELFGroupSection()
unsigned GetDwarfFile(StringRef Directory, StringRef FileName, unsigned FileNumber, unsigned CUID)
GetDwarfFile - creates an entry in the dwarf file and directory tables.
const MCAsmInfo * getAsmInfo() const
void setGenDwarfForAssembly(bool Value)
MCSymbol * getGenDwarfSectionStartSym()
MCSymbol * getGenDwarfSectionEndSym()
void setGenDwarfSection(const MCSection *Sec)
const MCSectionELF * getELFSection(StringRef Section, unsigned Type, unsigned Flags, SectionKind Kind)
bool hasDwarfFiles() const
unsigned getUniqueSymbolID()
void setGenDwarfSectionStartSym(MCSymbol *Sym)
std::string str() const
str - Get the contents as an std::string.
void setIsa(unsigned isa)
setIsa - Set the Isa of this MCDwarfLoc.
const DenseMap< unsigned, MCSymbol * > & getMCLineTableSymbols() const
StringRef getDwarfDebugFlags()
MCSymbol * getMCLineTableSymbol(unsigned ID) const
MCSectionCOFF - This represents a section on Windows.
MCSymbol * GetOrCreateSymbol(StringRef Name)
StringRef getDwarfDebugProducer()
MCSymbol * CreateTempSymbol()
const std::vector< const MCSection * > & getMCLineSectionOrder() const
ID
LLVM Calling Convention Representation.
const std::vector< const MCGenDwarfLabelEntry * > & getMCGenDwarfLabelEntries() const
const MCSection * getGenDwarfSection()
void setCompilationDir(StringRef S)
Set the compilation directory for DW_AT_comp_dir Override the default (CWD) compilation directory...
void setLine(unsigned line)
setLine - Set the Line of this MCDwarfLoc.
void addMCLineSection(const MCSection *Sec, MCLineSection *Line)
void setGenDwarfSectionEndSym(MCSymbol *Sym)
void setDwarfCompileUnitID(unsigned CUIndex)
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 ...
unsigned getDwarfCompileUnitID()
unsigned getGenDwarfFileNumber()
StringMap< MCSymbol *, BumpPtrAllocator & > SymbolTable
unsigned nextGenDwarfFileNumber()
const SmallVectorImpl< StringRef > & getMCDwarfDirs(unsigned CUID=0)
const DenseMap< const MCSection *, MCLineSection * > & getMCLineSections() const
void setAllowTemporaryLabels(bool Value)
const SymbolTable & getSymbols() const
void setDwarfDebugFlags(StringRef S)
MCSymbol * GetDirectionalLocalSymbol(int64_t LocalLabelVal, int bORf)
const MCDwarfLoc & getCurrentDwarfLoc()
const SourceMgr * getSourceManager() const
void setMCLineTableSymbol(MCSymbol *Sym, unsigned ID)
const MCSectionCOFF * getCOFFSection(StringRef Section, unsigned Characteristics, SectionKind Kind, int Selection=0, const MCSectionCOFF *Assoc=0)
bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID=0)
void Deallocate(void *Ptr)
bool getGenDwarfForAssembly()
void setMainFileName(StringRef S)
Set the main file name and override the default.
LLVM_ATTRIBUTE_NORETURN void FatalError(SMLoc L, const Twine &Msg)
const MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, SectionKind K)
void setDwarfDebugProducer(StringRef S)
#define LLVM_ATTRIBUTE_NORETURN
void addMCGenDwarfLabelEntry(const MCGenDwarfLabelEntry *E)
#define LLVM_DELETED_FUNCTION
void * Allocate(size_t Size, size_t Alignment)
void setSecureLog(raw_ostream *Value)
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)
void * Allocate(unsigned Size, unsigned Align=8)
const MCRegisterInfo * getRegisterInfo() const
StringRef getCompilationDir() const
Get the compilation directory for DW_AT_comp_dir This can be overridden by clients which want to cont...
raw_ostream * getSecureLog()
char * getSecureLogFile()
void setFileNum(unsigned fileNum)
setFileNum - Set the FileNum of this MCDwarfLoc.
void setFlags(unsigned flags)
setFlags - Set the Flags of this MCDwarfLoc.
void setCurrentDwarfLoc(unsigned FileNum, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator)
LLVM Value Representation.
const MCObjectFileInfo * getObjectFileInfo() const
MCSymbol * LookupSymbol(StringRef Name) const
LookupSymbol - Get the symbol for Name, or null.
const MCSectionMachO * getMachOSection(StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K)
void setColumn(unsigned column)
setColumn - Set the Column of this MCDwarfLoc.
COFF::SectionCharacteristics Characteristics
Represents a location in source code.
void setDiscriminator(unsigned discriminator)
setDiscriminator - Set the Discriminator of this MCDwarfLoc.
void setSecureLogUsed(bool Value)
MCSymbol * CreateDirectionalLocalSymbol(int64_t LocalLabelVal)