Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions llvm/docs/CommandGuide/llvm-debuginfo-analyzer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,7 @@ INTERNAL
Typically these kind of options are available only in *debug* builds.

:program:`llvm-debuginfo-analyzer` supports these advanced options in
both *release* and *debug* builds, with the exception of the unique ID
that is generated only in *debug* builds.
both *release* and *debug* builds.

.. option:: --internal=<value[,value,...]>

Expand Down
4 changes: 0 additions & 4 deletions llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ class LLVM_ABI LVLine : public LVElement {

void print(raw_ostream &OS, bool Full = true) const override;
void printExtra(raw_ostream &OS, bool Full = true) const override {}

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const override { print(dbgs()); }
#endif
};

// Class to represent a DWARF line record object.
Expand Down
6 changes: 1 addition & 5 deletions llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LVOperation final {
LLVM_ABI void print(raw_ostream &OS, bool Full = true) const;

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() { print(dbgs()); }
void dump() const { print(dbgs()); }
#endif
};

Expand Down Expand Up @@ -159,10 +159,6 @@ class LLVM_ABI LVLocation : public LVObject {

void print(raw_ostream &OS, bool Full = true) const override;
void printExtra(raw_ostream &OS, bool Full = true) const override;

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const override { print(dbgs()); }
#endif
};

class LLVM_ABI LVLocationSymbol final : public LVLocation {
Expand Down
39 changes: 12 additions & 27 deletions llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace logicalview {
using LVSectionIndex = uint64_t;
using LVAddress = uint64_t;
using LVHalf = uint16_t;
using LVLevel = uint32_t;
using LVLevel = uint16_t;
using LVOffset = uint64_t;
using LVSigned = int64_t;
using LVUnsigned = uint64_t;
Expand Down Expand Up @@ -129,8 +129,6 @@ class LLVM_ABI LVObject {
HasCodeViewLocation, // CodeView object with debug location.
LastEntry
};
// Typed bitvector with properties for this object.
LVProperties<Property> Properties;

LVOffset Offset = 0;
uint32_t LineNumber = 0;
Expand All @@ -140,6 +138,14 @@ class LLVM_ABI LVObject {
dwarf::Attribute Attr;
LVSmall Opcode;
} TagAttrOpcode = {dwarf::DW_TAG_null};
// Typed bitvector with properties for this object.
LVProperties<Property> Properties;

// This is an internal ID used for debugging logical elements. It is used
// for cases where an unique offset within the binary input file is not
// available.
static uint32_t GID;
uint32_t ID = 0;

// The parent of this object (nullptr if the root scope). For locations,
// the parent is a symbol object; otherwise it is a scope object.
Expand All @@ -155,9 +161,7 @@ class LLVM_ABI LVObject {
// copy constructor to create that object; it is used to print a reference
// to another object and in the case of templates, to print its encoded args.
LVObject(const LVObject &Object) {
#ifndef NDEBUG
incID();
#endif
Properties = Object.Properties;
Offset = Object.Offset;
LineNumber = Object.LineNumber;
Expand All @@ -166,18 +170,10 @@ class LLVM_ABI LVObject {
Parent = Object.Parent;
}

#ifndef NDEBUG
// This is an internal ID used for debugging logical elements. It is used
// for cases where an unique offset within the binary input file is not
// available.
static uint64_t GID;
uint64_t ID = 0;

void incID() {
++GID;
ID = GID;
}
#endif

protected:
// Get a string representation for the given number and discriminator.
Expand All @@ -193,11 +189,7 @@ class LLVM_ABI LVObject {
virtual void printFileIndex(raw_ostream &OS, bool Full = true) const {}

public:
LVObject() {
#ifndef NDEBUG
incID();
#endif
};
LVObject() { incID(); };
LVObject &operator=(const LVObject &) = delete;
virtual ~LVObject() = default;

Expand Down Expand Up @@ -313,17 +305,10 @@ class LLVM_ABI LVObject {
virtual void printExtra(raw_ostream &OS, bool Full = true) const {}

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
virtual void dump() const { print(dbgs()); }
void dump() const { print(dbgs()); }
#endif

uint64_t getID() const {
return
#ifndef NDEBUG
ID;
#else
0;
#endif
}
uint32_t getID() const { return ID; }
};

} // end namespace logicalview
Expand Down
4 changes: 0 additions & 4 deletions llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ class LLVM_ABI LVRange final : public LVObject {

void print(raw_ostream &OS, bool Full = true) const override;
void printExtra(raw_ostream &OS, bool Full = true) const override {}

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const override { print(dbgs()); }
#endif
};

} // end namespace logicalview
Expand Down
4 changes: 0 additions & 4 deletions llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,6 @@ class LLVM_ABI LVScope : public LVElement {
void printExtra(raw_ostream &OS, bool Full = true) const override;
virtual void printWarnings(raw_ostream &OS, bool Full = true) const {}
virtual void printMatchedElements(raw_ostream &OS, bool UseMatchedElements) {}

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const override { print(dbgs()); }
#endif
};

// Class to represent a DWARF Union/Structure/Class.
Expand Down
4 changes: 0 additions & 4 deletions llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ class LLVM_ABI LVSymbol final : public LVElement {

void print(raw_ostream &OS, bool Full = true) const override;
void printExtra(raw_ostream &OS, bool Full = true) const override;

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const override { print(dbgs()); }
#endif
};

} // end namespace logicalview
Expand Down
4 changes: 0 additions & 4 deletions llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ class LLVM_ABI LVType : public LVElement {

void print(raw_ostream &OS, bool Full = true) const override;
void printExtra(raw_ostream &OS, bool Full = true) const override;

#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void dump() const override { print(dbgs()); }
#endif
};

// Class to represent DW_TAG_typedef_type.
Expand Down
6 changes: 1 addition & 5 deletions llvm/lib/DebugInfo/LogicalView/Core/LVObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ using namespace llvm::logicalview;

#define DEBUG_TYPE "Object"

#ifndef NDEBUG
uint64_t LVObject::GID = 0;
#endif
uint32_t LVObject::GID = 0;

StringRef llvm::logicalview::typeNone() { return StringRef(); }
StringRef llvm::logicalview::typeVoid() { return "void"; }
Expand Down Expand Up @@ -137,10 +135,8 @@ void LVObject::printAttributes(raw_ostream &OS, bool Full, StringRef Name,
}

void LVObject::printAttributes(raw_ostream &OS, bool Full) const {
#ifndef NDEBUG
if (options().getInternalID())
OS << hexSquareString(getID());
#endif
if (options().getCompareExecute() &&
(options().getAttributeAdded() || options().getAttributeMissing()))
OS << (getIsAdded() ? '+' : getIsMissing() ? '-' : ' ');
Expand Down
2 changes: 0 additions & 2 deletions llvm/lib/DebugInfo/LogicalView/Core/LVOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,10 @@ void LVOptions::resolveDependencies() {
}

void LVOptions::calculateIndentationSize() {
#ifndef NDEBUG
if (getInternalID()) {
std::string String = hexSquareString(0);
IndentationSize += String.length();
}
#endif
if (getCompareExecute() && (getAttributeAdded() || getAttributeMissing()))
++IndentationSize;
if (getAttributeOffset()) {
Expand Down