class DeclContext

Declaration

class DeclContext { /* full declaration omitted */ };

Description

A DeclContext is a named program scope that is used for ODR uniquing of types. The set of DeclContext for the ODR-subject parts of a Dwarf link is expanded (and uniqued) with each new object file processed. We need to determine the context of each DIE in an linked object file to see if the corresponding type has already been emitted. The contexts are conceptually organized as a tree (eg. a function scope is contained in a namespace scope that contains other scopes), but storing/accessing them in an actual tree is too inefficient: we need to be able to very quickly query a context for a given child context by name. Storing a StringMap in each DeclContext would be too space inefficient. The solution here is to give each DeclContext a link to its parent (this allows to walk up the tree), but to query the existence of a specific DeclContext using a separate DenseMap keyed on the hash of the fully qualified name of the context.

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:73

Method Overview

Methods

DeclContext()

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:77

DeclContext(
    unsigned int Hash,
    uint32_t Line,
    uint32_t ByteSize,
    uint16_t Tag,
    llvm::StringRef Name,
    llvm::StringRef File,
    const llvm::DeclContext& Parent,
    llvm::DWARFDie LastSeenDIE = llvm::DWARFDie(),
    unsigned int CUId = 0)

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:79

Parameters

unsigned int Hash
uint32_t Line
uint32_t ByteSize
uint16_t Tag
llvm::StringRef Name
llvm::StringRef File
const llvm::DeclContext& Parent
llvm::DWARFDie LastSeenDIE = llvm::DWARFDie()
unsigned int CUId = 0

uint32_t getCanonicalDIEOffset() const

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:90

llvm::StringRef getName() const

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:97

uint32_t getQualifiedNameHash() const

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:86

uint16_t getTag() const

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:96

bool isDefinedInClangModule() const

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:93

void setCanonicalDIEOffset(uint32_t Offset)

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:91

Parameters

uint32_t Offset

void setDefinedInClangModule(bool Val)

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:94

Parameters

bool Val

bool setLastSeenDIE(llvm::CompileUnit& U,
                    const llvm::DWARFDie& Die)

Declared at: llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h:88

Parameters

llvm::CompileUnit& U
const llvm::DWARFDie& Die