9#ifndef LLVM_DWARFLINKER_DWARFLINKERDECLCONTEXT_H
10#define LLVM_DWARFLINKER_DWARFLINKERDECLCONTEXT_H
43 if (!ResolvedPaths.
count(ParentPath)) {
47 {ParentPath, std::string(RealPath.
c_str(), RealPath.
size())});
87 : QualifiedNameHash(Hash), Line(Line), ByteSize(ByteSize),
Tag(
Tag),
88 DefinedInClangModule(0), Name(Name), File(File), Parent(Parent),
89 LastSeenDIE(LastSeenDIE), LastSeenCompileUnitID(CUId) {}
110 unsigned QualifiedNameHash = 0;
114 unsigned DefinedInClangModule : 1;
120 std::atomic<uint32_t> CanonicalDIEOffset = {0};
121 bool HasCanonicalDIE =
false;
155 ResolvedPathsMap ResolvedPaths;
173 return Ctxt->QualifiedNameHash;
177 if (
RHS == getEmptyKey() ||
RHS == getTombstoneKey())
179 return LHS->QualifiedNameHash ==
RHS->QualifiedNameHash &&
180 LHS->Line ==
RHS->Line &&
LHS->ByteSize ==
RHS->ByteSize &&
181 LHS->Name.data() ==
RHS->Name.data() &&
182 LHS->File.data() ==
RHS->File.data() &&
183 LHS->Parent.QualifiedNameHash ==
RHS->Parent.QualifiedNameHash;
This file defines DenseMapInfo traits for DenseMap.
This file defines the DenseMap class.
This file defines the DenseSet and SmallDenseSet classes.
Allocate memory in an ever growing pool, as if by bump-pointer.
Small helper that resolves and caches file paths.
StringRef resolve(const std::string &Path, NonRelocatableStringpool &StringPool)
Resolve a path by calling realpath and cache its result.
Stores all information relating to a compile unit, be it in its original instance in the object file ...
A structured debug information entry.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
This class gives a tree-like API to the DenseMap that stores the DeclContext objects.
PointerIntPair< DeclContext *, 1 > getChildDeclContext(DeclContext &Context, const DWARFDie &DIE, CompileUnit &Unit, bool InClangModule)
Get the child of Context described by DIE in Unit.
A DeclContext is a named program scope that is used for ODR uniquing of types.
bool isDefinedInClangModule() const
uint32_t getCanonicalDIEOffset() const
bool hasCanonicalDIE() const
void setDefinedInClangModule(bool Val)
void setHasCanonicalDIE()
uint32_t getQualifiedNameHash() const
DeclContext(unsigned Hash, uint32_t Line, uint32_t ByteSize, uint16_t Tag, StringRef Name, StringRef File, const DeclContext &Parent, DWARFDie LastSeenDIE=DWARFDie(), unsigned CUId=0)
void setCanonicalDIEOffset(uint32_t Offset)
bool setLastSeenDIE(CompileUnit &U, const DWARFDie &Die)
Set the last DIE/CU a context was seen in and, possibly invalidate the context if it is ambiguous.
A string table that doesn't need relocations.
StringRef internString(StringRef S)
Get permanent storage for S (but do not necessarily emit S in the output section).
PointerIntPair - This class implements a pair of a pointer and small integer.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
StringRef - Represent a constant reference to a string, i.e.
std::error_code real_path(const Twine &path, SmallVectorImpl< char > &output, bool expand_tilde=false)
Collapse all .
StringRef filename(StringRef path, Style style=Style::native)
Get filename.
StringRef parent_path(StringRef path, Style style=Style::native)
Get parent path.
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
This is an optimization pass for GlobalISel generic memory operations.
Info type for the DenseMap storing the DeclContext pointers.
static bool isEqual(const DeclContext *LHS, const DeclContext *RHS)
static unsigned getHashValue(const DeclContext *Ctxt)
An information struct used to provide DenseMap with the various necessary components for a given valu...