14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H
27namespace logicalview {
87 IsMemberPointerResolved,
94 HasReferenceExtension,
95 HasReferenceSpecification,
113 size_t NameIndex = 0;
114 size_t QualifiedNameIndex = 0;
115 size_t FilenameIndex = 0;
128 void setFileLine(
LVElement *Specification);
131 void resolveQualifiedName();
138 void printFileIndex(
raw_ostream &
OS,
bool Full =
true)
const override;
142 :
LVObject(), SubclassID(
ID), AccessibilityCode(0), InlineCode(0),
182 bool isNamed()
const override {
return NameIndex != 0; }
183 bool isTyped()
const override {
return ElementType !=
nullptr; }
184 bool isFiled()
const override {
return FilenameIndex != 0; }
187 bool getIsKindType()
const {
return ElementType && ElementType->getIsType(); }
189 return ElementType && ElementType->getIsScope();
195 void setName(
StringRef ElementName)
override;
229 virtual bool isRoot()
const {
return false; }
248 void setFile(
LVElement *Reference =
nullptr);
250 virtual bool isBase()
const {
return false; }
265 virtual std::pair<unsigned, unsigned>
getBounds()
const {
return {}; }
266 virtual void setBounds(
unsigned Lower,
unsigned Upper) {}
281 accessibilityString(
uint32_t Access = dwarf::DW_ACCESS_private)
const;
286 if (std::optional<uint32_t> Code = getAccessibilityCode(
Access))
287 AccessibilityCode = Code.value();
299 virtualityString(
uint32_t Virtuality = dwarf::DW_VIRTUALITY_none)
const;
304 if (std::optional<uint32_t> Code = getVirtualityCode(Virtuality))
305 VirtualityCode = Code.value();
312 LVType *getTypeAsType()
const;
313 LVScope *getTypeAsScope()
const;
316 ElementType = Element;
319 Element->setIsReferencedType();
327 return ElementType ? ElementType->getQualifiedName() :
"";
331 std::string typeOffsetAsString()
const;
332 std::string discriminatorAsString()
const;
336 LVScope *getFunctionParent()
const;
337 virtual LVScope *getCompileUnitParent()
const;
351 void generateName(std::string &Prefix)
const;
355 virtual void updateLevel(
LVScope *Parent,
bool Moved =
false);
363 virtual void resolve();
365 virtual void resolveName();
367 void resolveParents();
369 bool referenceMatch(
const LVElement *Element)
const;
372 bool equals(
const LVElement *Element)
const;
static std::string getTypeName(OverloadKind Kind, Type *Ty)
static StringRef getName(Value *V)
Pass interface - Implemented by all 'passes'.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
PROPERTY(Property, IsTypedefReduced)
virtual void setCount(int64_t Value)
size_t getNameIndex() const
PROPERTY(Property, IsEnumClass)
void setAccessibilityCode(codeview::MemberAccess Access)
PROPERTY(Property, IsScoped)
virtual void setCallLineNumber(uint32_t Number)
PROPERTY(Property, HasReferenceSpecification)
virtual bool isTemplateParam() const
StringRef getQualifiedName() const
virtual void setReference(LVScope *Scope)
PROPERTY(Property, IsType)
virtual ~LVElement()=default
virtual void setReference(LVSymbol *Symbol)
PROPERTY(Property, IsMemberPointerResolved)
virtual void setBitSize(uint32_t Size)
PROPERTY(Property, IsInlinedAbstract)
virtual void setLinkageName(StringRef LinkageName)
virtual void setProducer(StringRef ProducerName)
static LVElementDispatch & getDispatch()
virtual void setUpperBound(int64_t Value)
virtual void setDiscriminator(uint32_t Value)
virtual bool isRoot() const
virtual size_t getCallFilenameIndex() const
virtual void setLowerBound(int64_t Value)
LVElement(LVSubclassID ID)
virtual int64_t getCount() const
LVElement(const LVElement &)=delete
bool isFiled() const override
uint32_t getInlineCode() const
virtual uint32_t getDiscriminator() const
virtual StringRef getValue() const
virtual bool isBase() const
virtual void setValue(StringRef Value)
void setInlineCode(uint32_t Code)
void setQualifiedName(StringRef Name)
PROPERTY(Property, InvalidFilename)
virtual void setReference(LVElement *Element)
bool getIsKindScope() const
PROPERTY(Property, IsLine)
PROPERTY(Property, HasAugmentedName)
virtual StringRef getLinkageName() const
virtual bool isCompileUnit() const
virtual size_t getValueIndex() const
PROPERTY(Property, IsSymbol)
PROPERTY(Property, HasReferenceExtension)
StringRef getName() const override
virtual int64_t getUpperBound() const
PROPERTY(Property, HasReference)
LVElement & operator=(const LVElement &)=delete
LVElement * getType() const
PROPERTY(Property, IsStatic)
PROPERTY(Property, IsArrayResolved)
virtual StringRef getProducer() const
PROPERTY(Property, IsAnonymous)
PROPERTY(Property, IsInlined)
void setAccessibilityCode(uint32_t Access)
virtual uint32_t getCallLineNumber() const
uint32_t getAccessibilityCode() const
PROPERTY(Property, IsNested)
virtual uint32_t getBitSize() const
PROPERTY(Property, HasType)
void setVirtualityCode(uint32_t Virtuality)
virtual void setReference(LVType *Type)
void setType(LVElement *Element=nullptr)
StringRef getTypeQualifiedName() const
PROPERTY(Property, IsReferencedType)
virtual void report(LVComparePass Pass)
PROPERTY(Property, IsSystem)
virtual int64_t getLowerBound() const
PROPERTY(Property, IsArtificial)
bool getIsKindType() const
void setFilenameIndex(size_t Index)
PROPERTY(Property, IncludeInPrint)
virtual std::pair< unsigned, unsigned > getBounds() const
uint32_t getVirtualityCode() const
PROPERTY(Property, QualifiedResolved)
size_t getFilenameIndex() const
bool isTyped() const override
virtual void setSourceLanguage(LVSourceLanguage SL)
PROPERTY(Property, HasReferenceAbstract)
virtual void setCallFilenameIndex(size_t Index)
StringRef getPathname() const
PROPERTY(Property, IsScope)
size_t getQualifiedNameIndex() const
virtual bool removeElement(LVElement *Element)
PROPERTY(Property, IsExternal)
void setVirtualityCode(codeview::MethodKind Virtuality)
virtual LVSourceLanguage getSourceLanguage() const
PROPERTY(Property, OffsetFromTypeIndex)
virtual size_t getLinkageNameIndex() const
PROPERTY(Property, TransformName)
PROPERTY(Property, IsScopedAlready)
uint32_t getStorageSizeInBytes() const
LVSubclassID getSubclassID() const
bool isNamed() const override
virtual void resolveExtra()
virtual void setBounds(unsigned Lower, unsigned Upper)
PROPERTY(Property, IsTemplateResolved)
virtual void resolveReferences()
StringRef getString(size_t Index) const
size_t getIndex(StringRef Key)
This class implements an extremely fast bulk output stream that can only output to a stream.
MethodKind
Part of member attribute flags. (CV_methodprop_e)
MemberAccess
Source-level access specifier. (CV_access_e)
LLVM_ABI LVStringPool & getStringPool()
std::set< LVElementKind > LVElementKindSet
LLVM_ABI StringRef emptyString()
constexpr unsigned int DWARF_CHAR_BIT
bool(LVScope::*)() const LVScopeGetFunction
@ LV_SCOPE_FUNCTION_INLINED
std::vector< LVElementGetFunction > LVElementRequest
std::map< LVElementKind, LVElementGetFunction > LVElementDispatch
This is an optimization pass for GlobalISel generic memory operations.
constexpr T divideCeil(U Numerator, V Denominator)
Returns the integer ceil(Numerator / Denominator).
A source language supported by any of the debug info representations.