14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVOBJECT_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVOBJECT_H
34namespace logicalview {
118 enum class Property {
148 } TagAttrOpcode = {dwarf::DW_TAG_null};
150 LVProperties<Property> Properties;
164 } Parent = {
nullptr};
171 LVObject(
const LVObject &Object) {
173 Properties = Object.Properties;
175 LineNumber = Object.LineNumber;
176 ScopeLevel = Object.ScopeLevel;
177 TagAttrOpcode = Object.TagAttrOpcode;
178 Parent = Object.Parent;
188 std::string lineAsString(
uint32_t LineNumber, LVHalf Discriminator,
189 bool ShowZero)
const;
192 std::string referenceAsString(
uint32_t LineNumber,
bool Spaces)
const;
225 virtual bool isNamed()
const {
return false; }
226 virtual bool isTyped()
const {
return false; }
227 virtual bool isFiled()
const {
return false; }
228 bool isLined()
const {
return LineNumber != 0; }
250 assert((!Parent.Element ||
static_cast<LVElement *
>(Parent.Element)) &&
252 return Parent.Element;
255 assert((!Parent.Scope ||
static_cast<LVScope *
>(Parent.Scope)) &&
260 assert((!Parent.Symbol ||
static_cast<LVSymbol *
>(Parent.Symbol)) &&
262 return Parent.Symbol;
264 void setParent(
LVScope *Scope);
276 virtual const char *
kind()
const {
return nullptr; }
278 std::string indentAsString()
const;
279 std::string indentAsString(
LVLevel Level)
const;
282 virtual std::string noLineAsString(
bool ShowZero)
const;
287 return lineAsString(getLineNumber(), 0, ShowZero);
289 std::string lineNumberAsStringStripped(
bool ShowZero =
false)
const;
300 bool Full =
true)
const;
301 void printAttributes(
raw_ostream &
OS,
bool Full =
true)
const;
304 bool UseQuotes =
false,
bool PrintRef =
false)
const;
307 void markBranchAsMissing();
315#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static cl::opt< bool > PrintRef("print-ref", cl::ReallyHidden)
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
This file contains constants used for implementing Dwarf debug support.
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
PROPERTY(Property, IsDiscarded)
virtual StringRef getName() const
virtual bool isFiled() const
PROPERTY(Property, IsAdded)
virtual LVAddress getUpperAddress() const
PROPERTY(Property, IsGeneratedName)
virtual const char * kind() const
LVObject & operator=(const LVObject &)=delete
LVScope * getParentScope() const
dwarf::Tag getTag() const
LVSmall getOpcode() const
PROPERTY(Property, IsMissing)
virtual void setLowerAddress(LVAddress Address)
void setLevel(LVLevel Level)
dwarf::Attribute getAttr() const
virtual std::string lineNumberAsString(bool ShowZero=false) const
virtual void setName(StringRef ObjectName)
void setOpcode(LVSmall Opcode)
PROPERTY(Property, IsLineFromReference)
virtual void printExtra(raw_ostream &OS, bool Full=true) const
PROPERTY(Property, IsMissingLink)
virtual bool isNamed() const
virtual bool isTyped() const
PROPERTY(Property, IsReferenced)
PROPERTY(Property, HasMoved)
PROPERTY(Property, IsResolvedName)
void setAttr(dwarf::Attribute Attr)
PROPERTY(Property, IsLocation)
virtual ~LVObject()=default
virtual void printFileIndex(raw_ostream &OS, bool Full=true) const
PROPERTY(Property, IsMatched)
PROPERTY(Property, HasPattern)
LVSymbol * getParentSymbol() const
uint32_t getLineNumber() const
PROPERTY(Property, IsResolved)
void setOffset(LVOffset DieOffset)
LVOffset getOffset() const
PROPERTY(Property, IsFinalized)
PROPERTY(Property, HasCodeViewLocation)
void setLineNumber(uint32_t Number)
LVElement * getParent() const
void setTag(dwarf::Tag Tag)
PROPERTY(Property, IsFileFromReference)
PROPERTY(Property, IsInCompare)
PROPERTY(Property, IsOptimized)
virtual void setUpperAddress(LVAddress Address)
virtual LVAddress getLowerAddress() const
PROPERTY(Property, IsGlobalReference)
This class implements an extremely fast bulk output stream that can only output to a stream.
constexpr Tag DW_TAG_unaligned
bool(LVElement::*)() const LVElementGetFunction
bool(LVSymbol::*)() const LVSymbolGetFunction
void(LVType::*)() LVTypeSetFunction
LLVM_ABI StringRef typeUnknown()
LLVM_ABI StringRef emptyString()
bool(LVLine::*)() const LVLineGetFunction
LLVM_ABI StringRef typeNone()
const LVAddress MaxAddress
bool(LVObject::*)() const LVObjectGetFunction
bool(LVScope::*)() const LVScopeGetFunction
bool(LVLocation::*)() LVValidLocation
void(LVSymbol::*)() LVSymbolSetFunction
void(LVObject::*)() LVObjectSetFunction
LLVM_ABI StringRef typeInt()
void(LVLine::*)() LVLineSetFunction
bool(LVType::*)() const LVTypeGetFunction
LLVM_ABI StringRef typeVoid()
void(LVScope::*)() LVScopeSetFunction
void(LVElement::*)() LVElementSetFunction
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.