LLVM  6.0.0svn
Classes | Public Types | Public Member Functions | List of all members
llvm::MCContext Class Reference

Context object for machine code objects. More...

#include "llvm/MC/MCContext.h"

Public Types

using SymbolTable = StringMap< MCSymbol *, BumpPtrAllocator & >
 

Public Member Functions

 MCContext (const MCAsmInfo *MAI, const MCRegisterInfo *MRI, const MCObjectFileInfo *MOFI, const SourceMgr *Mgr=nullptr, bool DoAutoReset=true)
 
 MCContext (const MCContext &)=delete
 
MCContextoperator= (const MCContext &)=delete
 
 ~MCContext ()
 
const SourceMgrgetSourceManager () const
 
void setInlineSourceManager (SourceMgr *SM)
 
const MCAsmInfogetAsmInfo () const
 
const MCRegisterInfogetRegisterInfo () const
 
const MCObjectFileInfogetObjectFileInfo () const
 
CodeViewContextgetCVContext ()
 
void setAllowTemporaryLabels (bool Value)
 
void setUseNamesOnTempLabels (bool Value)
 
chargetSecureLogFile ()
 
raw_fd_ostreamgetSecureLog ()
 
void setSecureLog (std::unique_ptr< raw_fd_ostream > Value)
 
bool getSecureLogUsed ()
 
void setSecureLogUsed (bool Value)
 
void * allocate (unsigned Size, unsigned Align=8)
 
void deallocate (void *Ptr)
 
bool hadError ()
 
void reportError (SMLoc L, const Twine &Msg)
 
LLVM_ATTRIBUTE_NORETURN void reportFatalError (SMLoc L, const Twine &Msg)
 
Module Lifetime Management
void reset ()
 reset - return object to right after construction state to prepare to process a new module More...
 
Symbol Management
MCSymbolcreateLinkerPrivateTempSymbol ()
 Create and return a new linker temporary symbol with a unique but unspecified name. More...
 
MCSymbolcreateTempSymbol (bool CanBeUnnamed=true)
 Create and return a new assembler temporary symbol with a unique but unspecified name. More...
 
MCSymbolcreateTempSymbol (const Twine &Name, bool AlwaysAddSuffix, bool CanBeUnnamed=true)
 
MCSymbolcreateDirectionalLocalSymbol (unsigned LocalLabelVal)
 Create the definition of a directional local symbol for numbered label (used for "1:" definitions). More...
 
MCSymbolgetDirectionalLocalSymbol (unsigned LocalLabelVal, bool Before)
 Create and return a directional local symbol for numbered label (used for "1b" or 1f" references). More...
 
MCSymbolgetOrCreateSymbol (const Twine &Name)
 Lookup the symbol inside with the specified Name. More...
 
MCSymbolgetOrCreateFrameAllocSymbol (StringRef FuncName, unsigned Idx)
 Gets a symbol that will be defined to the final stack offset of a local variable after codegen. More...
 
MCSymbolgetOrCreateParentFrameOffsetSymbol (StringRef FuncName)
 
MCSymbolgetOrCreateLSDASymbol (StringRef FuncName)
 
MCSymbollookupSymbol (const Twine &Name) const
 Get the symbol for Name, or null. More...
 
void setSymbolValue (MCStreamer &Streamer, StringRef Sym, uint64_t Val)
 Set value for a symbol. More...
 
const SymbolTablegetSymbols () const
 getSymbols - Get a reference for the symbol table for clients that want to, for example, iterate over all symbols. More...
 
Dwarf Management
StringRef getCompilationDir () const
 Get the compilation directory for DW_AT_comp_dir The compilation directory should be set with setCompilationDir before calling this function. More...
 
void setCompilationDir (StringRef S)
 Set the compilation directory for DW_AT_comp_dir. More...
 
const std::string & getMainFileName () const
 Get the main file name for use in error messages and debug info. More...
 
void setMainFileName (StringRef S)
 Set the main file name and override the default. More...
 
unsigned getDwarfFile (StringRef Directory, StringRef FileName, unsigned FileNumber, unsigned CUID)
 Creates an entry in the dwarf file and directory tables. More...
 
bool isValidDwarfFileNumber (unsigned FileNumber, unsigned CUID=0)
 isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and false otherwise. More...
 
const std::map< unsigned, MCDwarfLineTable > & getMCDwarfLineTables () const
 
MCDwarfLineTablegetMCDwarfLineTable (unsigned CUID)
 
const MCDwarfLineTablegetMCDwarfLineTable (unsigned CUID) const
 
const SmallVectorImpl< MCDwarfFile > & getMCDwarfFiles (unsigned CUID=0)
 
const SmallVectorImpl< std::string > & getMCDwarfDirs (unsigned CUID=0)
 
bool hasMCLineSections () const
 
unsigned getDwarfCompileUnitID ()
 
void setDwarfCompileUnitID (unsigned CUIndex)
 
void setMCLineTableCompilationDir (unsigned CUID, StringRef CompilationDir)
 
void setCurrentDwarfLoc (unsigned FileNum, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator)
 Saves the information from the currently parsed dwarf .loc directive and sets DwarfLocSeen. More...
 
void clearDwarfLocSeen ()
 
bool getDwarfLocSeen ()
 
const MCDwarfLocgetCurrentDwarfLoc ()
 
bool getGenDwarfForAssembly ()
 
void setGenDwarfForAssembly (bool Value)
 
unsigned getGenDwarfFileNumber ()
 
void setGenDwarfFileNumber (unsigned FileNumber)
 
const SetVector< MCSection * > & getGenDwarfSectionSyms ()
 
bool addGenDwarfSection (MCSection *Sec)
 
void finalizeDwarfSections (MCStreamer &MCOS)
 Remove empty sections from SectionStartEndSyms, to avoid generating useless debug info for them. More...
 
const std::vector< MCGenDwarfLabelEntry > & getMCGenDwarfLabelEntries () const
 
void addMCGenDwarfLabelEntry (const MCGenDwarfLabelEntry &E)
 
void setDwarfDebugFlags (StringRef S)
 
StringRef getDwarfDebugFlags ()
 
void setDwarfDebugProducer (StringRef S)
 
StringRef getDwarfDebugProducer ()
 
dwarf::DwarfFormat getDwarfFormat () const
 
void setDwarfVersion (uint16_t v)
 
uint16_t getDwarfVersion () const
 

Section Management

enum  : unsigned { GenericSectionID = ~0U }
 
MCSectionMachOgetMachOSection (StringRef Segment, StringRef Section, unsigned TypeAndAttributes, unsigned Reserved2, SectionKind K, const char *BeginSymName=nullptr)
 Return the MCSection for the specified mach-o section. More...
 
MCSectionMachOgetMachOSection (StringRef Segment, StringRef Section, unsigned TypeAndAttributes, SectionKind K, const char *BeginSymName=nullptr)
 
MCSectionELFgetELFSection (const Twine &Section, unsigned Type, unsigned Flags)
 
MCSectionELFgetELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const Twine &Group)
 
MCSectionELFgetELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const Twine &Group, unsigned UniqueID)
 
MCSectionELFgetELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const Twine &Group, unsigned UniqueID, const MCSymbolELF *Associated)
 
MCSectionELFgetELFSection (const Twine &Section, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, unsigned UniqueID, const MCSymbolELF *Associated)
 
MCSectionELFgetELFNamedSection (const Twine &Prefix, const Twine &Suffix, unsigned Type, unsigned Flags, unsigned EntrySize=0)
 Get a section with the provided group identifier. More...
 
MCSectionELFcreateELFRelSection (const Twine &Name, unsigned Type, unsigned Flags, unsigned EntrySize, const MCSymbolELF *Group, const MCSectionELF *RelInfoSection)
 
void renameELFSection (MCSectionELF *Section, StringRef Name)
 
MCSectionELFcreateELFGroupSection (const MCSymbolELF *Group)
 
MCSectionCOFFgetCOFFSection (StringRef Section, unsigned Characteristics, SectionKind Kind, StringRef COMDATSymName, int Selection, unsigned UniqueID=GenericSectionID, const char *BeginSymName=nullptr)
 
MCSectionCOFFgetCOFFSection (StringRef Section, unsigned Characteristics, SectionKind Kind, const char *BeginSymName=nullptr)
 
MCSectionCOFFgetCOFFSection (StringRef Section)
 
MCSectionCOFFgetAssociativeCOFFSection (MCSectionCOFF *Sec, const MCSymbol *KeySym, unsigned UniqueID=GenericSectionID)
 Gets or creates a section equivalent to Sec that is associated with the section containing KeySym. More...
 
MCSectionWasmgetWasmSection (const Twine &Section, unsigned Type, unsigned Flags)
 
MCSectionWasmgetWasmSection (const Twine &Section, unsigned Type, unsigned Flags, const char *BeginSymName)
 
MCSectionWasmgetWasmSection (const Twine &Section, unsigned Type, unsigned Flags, const Twine &Group)
 
MCSectionWasmgetWasmSection (const Twine &Section, unsigned Type, unsigned Flags, const Twine &Group, const char *BeginSymName)
 
MCSectionWasmgetWasmSection (const Twine &Section, unsigned Type, unsigned Flags, const Twine &Group, unsigned UniqueID)
 
MCSectionWasmgetWasmSection (const Twine &Section, unsigned Type, unsigned Flags, const Twine &Group, unsigned UniqueID, const char *BeginSymName)
 
MCSectionWasmgetWasmSection (const Twine &Section, unsigned Type, unsigned Flags, const MCSymbolWasm *Group, unsigned UniqueID, const char *BeginSymName)
 
MCSectionWasmgetWasmNamedSection (const Twine &Prefix, const Twine &Suffix, unsigned Type, unsigned Flags)
 Get a section with the provided group identifier. More...
 
MCSectionWasmcreateWasmRelSection (const Twine &Name, unsigned Type, unsigned Flags, const MCSymbolWasm *Group)
 
void renameWasmSection (MCSectionWasm *Section, StringRef Name)
 
MCSubtargetInfogetSubtargetCopy (const MCSubtargetInfo &STI)
 

Detailed Description

Context object for machine code objects.

This class owns all of the sections that it creates.

Definition at line 59 of file MCContext.h.

Member Typedef Documentation

◆ SymbolTable

Definition at line 61 of file MCContext.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned
Enumerator
GenericSectionID 

Pass this value as the UniqueID during section creation to get the generic section with the given name and characteristics.

The usual sections such as .text use this ID.

Definition at line 358 of file MCContext.h.

Constructor & Destructor Documentation

◆ MCContext() [1/2]

MCContext::MCContext ( const MCAsmInfo MAI,
const MCRegisterInfo MRI,
const MCObjectFileInfo MOFI,
const SourceMgr Mgr = nullptr,
bool  DoAutoReset = true 
)
explicit

◆ MCContext() [2/2]

llvm::MCContext::MCContext ( const MCContext )
delete

◆ ~MCContext()

MCContext::~MCContext ( )

Definition at line 70 of file MCContext.cpp.

References reset().

Member Function Documentation

◆ addGenDwarfSection()

bool llvm::MCContext::addGenDwarfSection ( MCSection Sec)
inline

◆ addMCGenDwarfLabelEntry()

void llvm::MCContext::addMCGenDwarfLabelEntry ( const MCGenDwarfLabelEntry E)
inline

Definition at line 604 of file MCContext.h.

Referenced by llvm::MCGenDwarfLabelEntry::Make().

◆ allocate()

void* llvm::MCContext::allocate ( unsigned  Size,
unsigned  Align = 8 
)
inline

◆ clearDwarfLocSeen()

void llvm::MCContext::clearDwarfLocSeen ( )
inline

◆ createDirectionalLocalSymbol()

MCSymbol * MCContext::createDirectionalLocalSymbol ( unsigned  LocalLabelVal)

Create the definition of a directional local symbol for numbered label (used for "1:" definitions).

Definition at line 241 of file MCContext.cpp.

Referenced by getGNUBinOpPrecedence(), and setUseNamesOnTempLabels().

◆ createELFGroupSection()

MCSectionELF * MCContext::createELFGroupSection ( const MCSymbolELF Group)

Definition at line 414 of file MCContext.cpp.

References llvm::SectionKind::getReadOnly(), and llvm::ELF::SHT_GROUP.

Referenced by getELFSection(), and isWeak().

◆ createELFRelSection()

MCSectionELF * MCContext::createELFRelSection ( const Twine Name,
unsigned  Type,
unsigned  Flags,
unsigned  EntrySize,
const MCSymbolELF Group,
const MCSectionELF RelInfoSection 
)

◆ createLinkerPrivateTempSymbol()

MCSymbol * MCContext::createLinkerPrivateTempSymbol ( )

Create and return a new linker temporary symbol with a unique but unspecified name.

Definition at line 209 of file MCContext.cpp.

References llvm::MCAsmInfo::getLinkerPrivateGlobalPrefix().

Referenced by llvm::AsmPrinter::EmitDebugThreadLocal(), and setUseNamesOnTempLabels().

◆ createTempSymbol() [1/2]

MCSymbol * MCContext::createTempSymbol ( bool  CanBeUnnamed = true)

Create and return a new assembler temporary symbol with a unique but unspecified name.

Definition at line 215 of file MCContext.cpp.

References llvm::MCLabel::getInstance(), and llvm::MCLabel::incInstance().

Referenced by llvm::ConstantPool::addEntry(), llvm::DebugHandlerBase::beginInstruction(), llvm::CodeViewDebug::beginInstruction(), llvm::AsmPrinter::createTempSymbol(), llvm::MCDwarfLineTableHeader::Emit(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFrameEmitter::Emit(), llvm::MCStreamer::emitAbsoluteSymbolDiff(), llvm::MCStreamer::EmitCFIEndProcImpl(), llvm::AsmPrinter::EmitDebugThreadLocal(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::MipsAsmPrinter::EmitEndOfAsmFile(), llvm::CodeViewContext::emitFileChecksums(), EmitGenDwarfInfo(), llvm::SystemZAsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitInstruction(), llvm::X86AsmPrinter::EmitInstruction(), llvm::CodeViewContext::emitLineTableForFunction(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), EmitNops(), emitNullTerminatedSymbolName(), llvm::AArch64FrameLowering::emitPrologue(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), llvm::CodeViewContext::emitStringTable(), EmitUnwindInfo(), llvm::MCObjectStreamer::EmitValueImpl(), llvm::AsmPrinter::emitXRayTable(), llvm::WinException::endFunclet(), llvm::DebugHandlerBase::endInstruction(), forceExpAbs(), getCIEVersion(), getCOFFSection(), getDwarfRegNum(), llvm::MCSection::getEndSymbol(), llvm::AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(), llvm::AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(), getMachOSection(), llvm::AArch64_MachoTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFile::getTTypeReference(), getWasmSection(), INITIALIZE_PASS(), llvm::HexagonFrameLowering::insertCFIInstructions(), IsSmallMemAccess(), llvm::LowerARMMachineInstrToMCInst(), llvm::SelectionDAGBuilder::lowerInvokable(), llvm::MCCVLineEntry::Make(), llvm::MCDwarfLineEntry::Make(), llvm::MCGenDwarfLabelEntry::Make(), nextReg(), llvm::FaultMaps::recordFaultingOp(), and setUseNamesOnTempLabels().

◆ createTempSymbol() [2/2]

MCSymbol * MCContext::createTempSymbol ( const Twine Name,
bool  AlwaysAddSuffix,
bool  CanBeUnnamed = true 
)

Definition at line 202 of file MCContext.cpp.

References llvm::MCAsmInfo::getPrivateGlobalPrefix(), and Name.

◆ createWasmRelSection()

MCSectionWasm * MCContext::createWasmRelSection ( const Twine Name,
unsigned  Type,
unsigned  Flags,
const MCSymbolWasm Group 
)

◆ deallocate()

void llvm::MCContext::deallocate ( void *  Ptr)
inline

Definition at line 638 of file MCContext.h.

◆ finalizeDwarfSections()

void MCContext::finalizeDwarfSections ( MCStreamer MCOS)

Remove empty sections from SectionStartEndSyms, to avoid generating useless debug info for them.

Definition at line 593 of file MCContext.cpp.

References llvm::MCStreamer::mayHaveInstructions().

Referenced by addGenDwarfSection(), and llvm::MCGenDwarfInfo::Emit().

◆ getAsmInfo()

const MCAsmInfo* llvm::MCContext::getAsmInfo ( ) const
inline

◆ getAssociativeCOFFSection()

MCSectionCOFF * MCContext::getAssociativeCOFFSection ( MCSectionCOFF Sec,
const MCSymbol KeySym,
unsigned  UniqueID = GenericSectionID 
)

Gets or creates a section equivalent to Sec that is associated with the section containing KeySym.

For example, to create a debug info section associated with an inline function, pass the normal debug info section as Sec and the function symbol as KeySym.

Definition at line 468 of file MCContext.cpp.

References Characteristics, GenericSectionID, llvm::MCSectionCOFF::getCharacteristics(), getCOFFSection(), llvm::MCSection::getKind(), llvm::MCSymbol::getName(), llvm::MCSectionCOFF::getSectionName(), llvm::COFF::IMAGE_COMDAT_SELECT_ASSOCIATIVE, and llvm::COFF::IMAGE_SCN_LNK_COMDAT.

Referenced by getELFSection(), llvm::TargetLoweringObjectFileCOFF::getStaticCtorSection(), llvm::TargetLoweringObjectFileCOFF::getStaticDtorSection(), and getWinCFISection().

◆ getCOFFSection() [1/3]

MCSectionCOFF * MCContext::getCOFFSection ( StringRef  Section,
unsigned  Characteristics,
SectionKind  Kind,
StringRef  COMDATSymName,
int  Selection,
unsigned  UniqueID = GenericSectionID,
const char BeginSymName = nullptr 
)

◆ getCOFFSection() [2/3]

MCSectionCOFF * MCContext::getCOFFSection ( StringRef  Section,
unsigned  Characteristics,
SectionKind  Kind,
const char BeginSymName = nullptr 
)

Definition at line 452 of file MCContext.cpp.

References GenericSectionID, and getCOFFSection().

◆ getCOFFSection() [3/3]

MCSectionCOFF * MCContext::getCOFFSection ( StringRef  Section)

Definition at line 460 of file MCContext.cpp.

References GenericSectionID, and llvm::ARMBuildAttrs::Section.

◆ getCompilationDir()

StringRef llvm::MCContext::getCompilationDir ( ) const
inline

Get the compilation directory for DW_AT_comp_dir The compilation directory should be set with setCompilationDir before calling this function.

If it is unset, an empty string will be returned.

Definition at line 503 of file MCContext.h.

Referenced by EmitGenDwarfAbbrev(), and EmitGenDwarfInfo().

◆ getCurrentDwarfLoc()

const MCDwarfLoc& llvm::MCContext::getCurrentDwarfLoc ( )
inline

Definition at line 580 of file MCContext.h.

Referenced by llvm::MCDwarfLineEntry::Make().

◆ getCVContext()

CodeViewContext & MCContext::getCVContext ( )

◆ getDirectionalLocalSymbol()

MCSymbol * MCContext::getDirectionalLocalSymbol ( unsigned  LocalLabelVal,
bool  Before 
)

Create and return a directional local symbol for numbered label (used for "1b" or 1f" references).

Definition at line 246 of file MCContext.cpp.

Referenced by setUseNamesOnTempLabels().

◆ getDwarfCompileUnitID()

unsigned llvm::MCContext::getDwarfCompileUnitID ( )
inline

Definition at line 551 of file MCContext.h.

Referenced by llvm::MCDwarfLineEntry::Make().

◆ getDwarfDebugFlags()

StringRef llvm::MCContext::getDwarfDebugFlags ( )
inline

Definition at line 609 of file MCContext.h.

Referenced by EmitGenDwarfAbbrev(), and EmitGenDwarfInfo().

◆ getDwarfDebugProducer()

StringRef llvm::MCContext::getDwarfDebugProducer ( )
inline

Definition at line 612 of file MCContext.h.

Referenced by EmitGenDwarfInfo().

◆ getDwarfFile()

unsigned MCContext::getDwarfFile ( StringRef  Directory,
StringRef  FileName,
unsigned  FileNumber,
unsigned  CUID 
)

Creates an entry in the dwarf file and directory tables.

getDwarfFile - takes a file name an number to place in the dwarf file and directory tables.

If the file number has already been allocated it is an error and zero is returned and the client reports the error, else the allocated file number is returned. The file numbers may be in any order.

Definition at line 575 of file MCContext.cpp.

References llvm::MCDwarfLineTable::getFile().

Referenced by llvm::MCStreamer::EmitDwarfFileDirective(), and setMainFileName().

◆ getDwarfFormat()

dwarf::DwarfFormat llvm::MCContext::getDwarfFormat ( ) const
inline

Definition at line 614 of file MCContext.h.

References llvm::dwarf::DWARF32.

◆ getDwarfLocSeen()

bool llvm::MCContext::getDwarfLocSeen ( )
inline

Definition at line 579 of file MCContext.h.

Referenced by llvm::MCDwarfLineEntry::Make().

◆ getDwarfVersion()

uint16_t llvm::MCContext::getDwarfVersion ( ) const
inline

◆ getELFNamedSection()

MCSectionELF * MCContext::getELFNamedSection ( const Twine Prefix,
const Twine Suffix,
unsigned  Type,
unsigned  Flags,
unsigned  EntrySize = 0 
)

Get a section with the provided group identifier.

This section is named by concatenating Prefix with '.' then Suffix. The Type describes the type of the section and Flags are used to further configure this named section.

Definition at line 364 of file MCContext.cpp.

References getELFSection().

Referenced by getELFSection().

◆ getELFSection() [1/5]

MCSectionELF* llvm::MCContext::getELFSection ( const Twine Section,
unsigned  Type,
unsigned  Flags 
)
inline

◆ getELFSection() [2/5]

MCSectionELF* llvm::MCContext::getELFSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
unsigned  EntrySize,
const Twine Group 
)
inline

Definition at line 384 of file MCContext.h.

References getELFSection().

◆ getELFSection() [3/5]

MCSectionELF* llvm::MCContext::getELFSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
unsigned  EntrySize,
const Twine Group,
unsigned  UniqueID 
)
inline

◆ getELFSection() [4/5]

MCSectionELF * MCContext::getELFSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
unsigned  EntrySize,
const Twine Group,
unsigned  UniqueID,
const MCSymbolELF Associated 
)

◆ getELFSection() [5/5]

MCSectionELF * MCContext::getELFSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
unsigned  EntrySize,
const MCSymbolELF Group,
unsigned  UniqueID,
const MCSymbolELF Associated 
)

◆ getGenDwarfFileNumber()

unsigned llvm::MCContext::getGenDwarfFileNumber ( )
inline

Definition at line 584 of file MCContext.h.

Referenced by llvm::MCGenDwarfLabelEntry::Make().

◆ getGenDwarfForAssembly()

bool llvm::MCContext::getGenDwarfForAssembly ( )
inline

Definition at line 582 of file MCContext.h.

◆ getGenDwarfSectionSyms()

const SetVector<MCSection *>& llvm::MCContext::getGenDwarfSectionSyms ( )
inline

◆ getMachOSection() [1/2]

MCSectionMachO * MCContext::getMachOSection ( StringRef  Segment,
StringRef  Section,
unsigned  TypeAndAttributes,
unsigned  Reserved2,
SectionKind  K,
const char BeginSymName = nullptr 
)

◆ getMachOSection() [2/2]

MCSectionMachO* llvm::MCContext::getMachOSection ( StringRef  Segment,
StringRef  Section,
unsigned  TypeAndAttributes,
SectionKind  K,
const char BeginSymName = nullptr 
)
inline

Definition at line 372 of file MCContext.h.

References getMachOSection().

◆ getMainFileName()

const std::string& llvm::MCContext::getMainFileName ( ) const
inline

Get the main file name for use in error messages and debug info.

This can be set to ensure we've got the correct file name after preprocessing or for -save-temps.

Definition at line 511 of file MCContext.h.

◆ getMCDwarfDirs()

const SmallVectorImpl<std::string>& llvm::MCContext::getMCDwarfDirs ( unsigned  CUID = 0)
inline

Definition at line 540 of file MCContext.h.

References llvm::MCDwarfLineTable::getMCDwarfDirs(), and getMCDwarfLineTable().

Referenced by EmitGenDwarfInfo().

◆ getMCDwarfFiles()

const SmallVectorImpl<MCDwarfFile>& llvm::MCContext::getMCDwarfFiles ( unsigned  CUID = 0)
inline

◆ getMCDwarfLineTable() [1/2]

MCDwarfLineTable& llvm::MCContext::getMCDwarfLineTable ( unsigned  CUID)
inline

◆ getMCDwarfLineTable() [2/2]

const MCDwarfLineTable& llvm::MCContext::getMCDwarfLineTable ( unsigned  CUID) const
inline

Definition at line 530 of file MCContext.h.

References assert(), and I.

◆ getMCDwarfLineTables()

const std::map<unsigned, MCDwarfLineTable>& llvm::MCContext::getMCDwarfLineTables ( ) const
inline

Definition at line 522 of file MCContext.h.

Referenced by llvm::MCDwarfLineTable::Emit().

◆ getMCGenDwarfLabelEntries()

const std::vector<MCGenDwarfLabelEntry>& llvm::MCContext::getMCGenDwarfLabelEntries ( ) const
inline

Definition at line 600 of file MCContext.h.

Referenced by EmitGenDwarfInfo().

◆ getObjectFileInfo()

const MCObjectFileInfo* llvm::MCContext::getObjectFileInfo ( ) const
inline

◆ getOrCreateFrameAllocSymbol()

MCSymbol * MCContext::getOrCreateFrameAllocSymbol ( StringRef  FuncName,
unsigned  Idx 
)

Gets a symbol that will be defined to the final stack offset of a local variable after codegen.

Parameters
Idx- The index of a local variable passed to .localescape.

Definition at line 134 of file MCContext.cpp.

References getOrCreateSymbol(), and llvm::MCAsmInfo::getPrivateGlobalPrefix().

Referenced by getUnderlyingArgReg(), and setUseNamesOnTempLabels().

◆ getOrCreateLSDASymbol()

MCSymbol * MCContext::getOrCreateLSDASymbol ( StringRef  FuncName)

◆ getOrCreateParentFrameOffsetSymbol()

MCSymbol * MCContext::getOrCreateParentFrameOffsetSymbol ( StringRef  FuncName)

◆ getOrCreateSymbol()

MCSymbol * MCContext::getOrCreateSymbol ( const Twine Name)

Lookup the symbol inside with the specified Name.

If it exists, return it. If not, create a forward reference and return it.

Parameters
Name- The symbol name, which must be unique across all symbols.

Definition at line 121 of file MCContext.cpp.

References assert(), llvm::StringRef::empty(), and llvm::Twine::toStringRef().

Referenced by llvm::AsmPrinter::doFinalization(), llvm::AMDGPUTargetELFStreamer::EmitAMDGPUSymbolType(), EmitCamlGlobal(), llvm::MipsTargetELFStreamer::emitDirectiveCpLoad(), llvm::MipsTargetELFStreamer::emitDirectiveCpsetup(), llvm::MipsTargetELFStreamer::emitDirectiveEnd(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::EHStreamer::emitExceptionTable(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::NVPTXAsmPrinter::emitLineNumberAsDotLoc(), EmitNops(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), llvm::WinException::endFunclet(), getCOFFSection(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::LanaiMCInstLower::GetConstantPoolIndexSymbol(), llvm::AsmPrinter::GetCPISymbol(), llvm::MCStreamer::getDwarfLineTableSymbol(), getELFSection(), llvm::AsmPrinter::GetExternalSymbolSymbol(), llvm::PPCFunctionInfo::getGlobalEPSymbol(), getGlobalOffsetTable(), llvm::MachineFunction::getJTISymbol(), llvm::AsmPrinter::GetJTSetSymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), llvm::LanaiMCInstLower::GetJumpTableSymbol(), llvm::PPCFunctionInfo::getLocalEPSymbol(), getModifierVariantKind(), getOrCreateFrameAllocSymbol(), getOrCreateLSDASymbol(), getOrCreateParentFrameOffsetSymbol(), getPICLabel(), llvm::PPCFunctionInfo::getPICOffsetSymbol(), getRetOpcode(), llvm::TargetMachine::getSymbol(), llvm::MachineBasicBlock::getSymbol(), GetSymbolFromOperand(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), getTLSGetOffset(), llvm::PPCFunctionInfo::getTOCOffsetSymbol(), getWasmSection(), IsSmallMemAccess(), llvm::FastISel::lowerCallTo(), llvm::AMDGPUMCInstLower::lowerOperand(), llvm::MCParserUtils::parseAssignmentExpression(), llvm::ARMAsmPrinter::printOperand(), printSymbolOperand(), llvm::FaultMaps::serializeToFaultMapSection(), llvm::StackMaps::serializeToStackMapSection(), llvm::FastISel::CallLoweringInfo::setCallee(), setSymbolValue(), setUseNamesOnTempLabels(), smallData(), llvm::AArch64ExternalSymbolizer::tryAddingSymbolicOperand(), and llvm::MCExternalSymbolizer::tryAddingSymbolicOperand().

◆ getRegisterInfo()

const MCRegisterInfo* llvm::MCContext::getRegisterInfo ( ) const
inline

◆ getSecureLog()

raw_fd_ostream* llvm::MCContext::getSecureLog ( )
inline

Definition at line 625 of file MCContext.h.

◆ getSecureLogFile()

char* llvm::MCContext::getSecureLogFile ( )
inline

Definition at line 624 of file MCContext.h.

◆ getSecureLogUsed()

bool llvm::MCContext::getSecureLogUsed ( )
inline

Definition at line 631 of file MCContext.h.

◆ getSourceManager()

const SourceMgr* llvm::MCContext::getSourceManager ( ) const
inline

◆ getSubtargetCopy()

MCSubtargetInfo & MCContext::getSubtargetCopy ( const MCSubtargetInfo STI)

◆ getSymbols()

const SymbolTable& llvm::MCContext::getSymbols ( ) const
inline

getSymbols - Get a reference for the symbol table for clients that want to, for example, iterate over all symbols.

'const' because we still want any modifications to the table itself to use the MCContext APIs.

Definition at line 351 of file MCContext.h.

◆ getWasmNamedSection()

MCSectionWasm * MCContext::getWasmNamedSection ( const Twine Prefix,
const Twine Suffix,
unsigned  Type,
unsigned  Flags 
)

Get a section with the provided group identifier.

This section is named by concatenating Prefix with '.' then Suffix. The Type describes the type of the section and Flags are used to further configure this named section.

Definition at line 517 of file MCContext.cpp.

References getWasmSection().

Referenced by getWasmSection().

◆ getWasmSection() [1/7]

MCSectionWasm* llvm::MCContext::getWasmSection ( const Twine Section,
unsigned  Type,
unsigned  Flags 
)
inline

◆ getWasmSection() [2/7]

MCSectionWasm* llvm::MCContext::getWasmSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
const char BeginSymName 
)
inline

Definition at line 449 of file MCContext.h.

References getWasmSection().

◆ getWasmSection() [3/7]

MCSectionWasm* llvm::MCContext::getWasmSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
const Twine Group 
)
inline

Definition at line 454 of file MCContext.h.

References getWasmSection().

◆ getWasmSection() [4/7]

MCSectionWasm* llvm::MCContext::getWasmSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
const Twine Group,
const char BeginSymName 
)
inline

Definition at line 459 of file MCContext.h.

References getWasmSection().

◆ getWasmSection() [5/7]

MCSectionWasm* llvm::MCContext::getWasmSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
const Twine Group,
unsigned  UniqueID 
)
inline

◆ getWasmSection() [6/7]

MCSectionWasm * MCContext::getWasmSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
const Twine Group,
unsigned  UniqueID,
const char BeginSymName 
)

◆ getWasmSection() [7/7]

MCSectionWasm * MCContext::getWasmSection ( const Twine Section,
unsigned  Type,
unsigned  Flags,
const MCSymbolWasm Group,
unsigned  UniqueID,
const char BeginSymName 
)

◆ hadError()

bool llvm::MCContext::hadError ( )
inline

Definition at line 640 of file MCContext.h.

References LLVM_ATTRIBUTE_NORETURN, reportError(), and reportFatalError().

◆ hasMCLineSections()

bool llvm::MCContext::hasMCLineSections ( ) const
inline

Definition at line 544 of file MCContext.h.

◆ isValidDwarfFileNumber()

bool MCContext::isValidDwarfFileNumber ( unsigned  FileNumber,
unsigned  CUID = 0 
)

isValidDwarfFileNumber - takes a dwarf file number and returns true if it currently is assigned and false otherwise.

Definition at line 583 of file MCContext.cpp.

References llvm::SmallVectorBase::empty(), getMCDwarfFiles(), and llvm::SmallVectorTemplateCommon< T >::size().

Referenced by setMainFileName().

◆ lookupSymbol()

MCSymbol * MCContext::lookupSymbol ( const Twine Name) const

◆ operator=()

MCContext& llvm::MCContext::operator= ( const MCContext )
delete

◆ renameELFSection()

void MCContext::renameELFSection ( MCSectionELF Section,
StringRef  Name 
)

◆ renameWasmSection()

void MCContext::renameWasmSection ( MCSectionWasm Section,
StringRef  Name 
)

◆ reportError()

void MCContext::reportError ( SMLoc  L,
const Twine Msg 
)

◆ reportFatalError()

void MCContext::reportFatalError ( SMLoc  L,
const Twine Msg 
)

Definition at line 622 of file MCContext.cpp.

References reportError(), and llvm::sys::RunInterruptHandlers().

Referenced by adjustFixupValue(), and hadError().

◆ reset()

void MCContext::reset ( )

◆ setAllowTemporaryLabels()

void llvm::MCContext::setAllowTemporaryLabels ( bool  Value)
inline

◆ setCompilationDir()

void llvm::MCContext::setCompilationDir ( StringRef  S)
inline

Set the compilation directory for DW_AT_comp_dir.

Definition at line 506 of file MCContext.h.

References llvm::StringRef::str().

◆ setCurrentDwarfLoc()

void llvm::MCContext::setCurrentDwarfLoc ( unsigned  FileNum,
unsigned  Line,
unsigned  Column,
unsigned  Flags,
unsigned  Isa,
unsigned  Discriminator 
)
inline

Saves the information from the currently parsed dwarf .loc directive and sets DwarfLocSeen.

When the next instruction is assembled an entry in the line number table with this information and the address of the instruction will be created.

Definition at line 565 of file MCContext.h.

References llvm::MCDwarfLoc::setColumn(), llvm::MCDwarfLoc::setDiscriminator(), llvm::MCDwarfLoc::setFileNum(), llvm::MCDwarfLoc::setFlags(), llvm::MCDwarfLoc::setIsa(), and llvm::MCDwarfLoc::setLine().

Referenced by llvm::MCStreamer::EmitDwarfLocDirective().

◆ setDwarfCompileUnitID()

void llvm::MCContext::setDwarfCompileUnitID ( unsigned  CUIndex)
inline

Definition at line 553 of file MCContext.h.

◆ setDwarfDebugFlags()

void llvm::MCContext::setDwarfDebugFlags ( StringRef  S)
inline

Definition at line 608 of file MCContext.h.

◆ setDwarfDebugProducer()

void llvm::MCContext::setDwarfDebugProducer ( StringRef  S)
inline

Definition at line 611 of file MCContext.h.

◆ setDwarfVersion()

void llvm::MCContext::setDwarfVersion ( uint16_t  v)
inline

Definition at line 619 of file MCContext.h.

◆ setGenDwarfFileNumber()

void llvm::MCContext::setGenDwarfFileNumber ( unsigned  FileNumber)
inline

Definition at line 586 of file MCContext.h.

◆ setGenDwarfForAssembly()

void llvm::MCContext::setGenDwarfForAssembly ( bool  Value)
inline

Definition at line 583 of file MCContext.h.

◆ setInlineSourceManager()

void llvm::MCContext::setInlineSourceManager ( SourceMgr SM)
inline

Definition at line 281 of file MCContext.h.

Referenced by srcMgrDiagHandler().

◆ setMainFileName()

void llvm::MCContext::setMainFileName ( StringRef  S)
inline

Set the main file name and override the default.

Definition at line 514 of file MCContext.h.

References getDwarfFile(), and isValidDwarfFileNumber().

◆ setMCLineTableCompilationDir()

void llvm::MCContext::setMCLineTableCompilationDir ( unsigned  CUID,
StringRef  CompilationDir 
)
inline

◆ setSecureLog()

void llvm::MCContext::setSecureLog ( std::unique_ptr< raw_fd_ostream Value)
inline

Definition at line 627 of file MCContext.h.

◆ setSecureLogUsed()

void llvm::MCContext::setSecureLogUsed ( bool  Value)
inline

Definition at line 632 of file MCContext.h.

◆ setSymbolValue()

void MCContext::setSymbolValue ( MCStreamer Streamer,
StringRef  Sym,
uint64_t  Val 
)

◆ setUseNamesOnTempLabels()

void llvm::MCContext::setUseNamesOnTempLabels ( bool  Value)
inline

The documentation for this class was generated from the following files: