9#ifndef LLVM_DWARFLINKER_CLASSIC_DWARFLINKERDECLCONTEXT_H
10#define LLVM_DWARFLINKER_CLASSIC_DWARFLINKERDECLCONTEXT_H
24namespace dwarf_linker {
45 auto [It, Inserted] = ResolvedPaths.
try_emplace(ParentPath);
49 It->second = std::string(RealPath);
89 : QualifiedNameHash(Hash), Line(Line), ByteSize(ByteSize), Tag(Tag),
90 DefinedInClangModule(0), Name(Name), File(File), Parent(Parent),
91 LastSeenDIE(LastSeenDIE), LastSeenCompileUnitID(CUId) {}
112 unsigned QualifiedNameHash = 0;
115 uint16_t Tag = dwarf::DW_TAG_compile_unit;
116 unsigned DefinedInClangModule : 1;
122 std::atomic<uint32_t> CanonicalDIEOffset = {0};
123 bool HasCanonicalDIE =
false;
157 ResolvedPathsMap ResolvedPaths;
175 return Ctxt->QualifiedNameHash;
179 if (
RHS == getEmptyKey() ||
RHS == getTombstoneKey())
181 return LHS->QualifiedNameHash ==
RHS->QualifiedNameHash &&
182 LHS->Line ==
RHS->Line &&
LHS->ByteSize ==
RHS->ByteSize &&
183 LHS->Name.data() ==
RHS->Name.data() &&
184 LHS->File.data() ==
RHS->File.data() &&
185 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.
A structured debug information entry.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
A string table that doesn't need relocations.
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",...
std::pair< iterator, bool > try_emplace(StringRef Key, ArgsTy &&...Args)
Emplace a new element for the specified key into the map if the key isn't already in the map.
StringRef - Represent a constant reference to a string, i.e.
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 ...
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 hasCanonicalDIE() const
uint32_t getCanonicalDIEOffset() const
uint32_t getQualifiedNameHash() const
bool isDefinedInClangModule() const
void setHasCanonicalDIE()
void setDefinedInClangModule(bool Val)
void setCanonicalDIEOffset(uint32_t Offset)
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)
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.
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.
An information struct used to provide DenseMap with the various necessary components for a given valu...
Info type for the DenseMap storing the DeclContext pointers.
static unsigned getHashValue(const DeclContext *Ctxt)
static bool isEqual(const DeclContext *LHS, const DeclContext *RHS)