diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h index c335c34e372b9..bacb55249fc16 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLine.h @@ -104,10 +104,6 @@ class 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. diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h index 3b556f9927832..0cf7f0956c62b 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVLocation.h @@ -50,7 +50,7 @@ class LVOperation final { 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 }; @@ -158,10 +158,6 @@ class 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 LVLocationSymbol final : public LVLocation { diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h index efc8db12a6972..c283e3caefd0b 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVObject.h @@ -15,6 +15,7 @@ #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVOBJECT_H #include "llvm/BinaryFormat/Dwarf.h" +#include "llvm/Config/abi-breaking.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/LogicalView/Core/LVSupport.h" @@ -154,7 +155,7 @@ class 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 +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS incID(); #endif Properties = Object.Properties; @@ -165,7 +166,7 @@ class LVObject { Parent = Object.Parent; } -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS // 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. @@ -193,7 +194,7 @@ class LVObject { public: LVObject() { -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS incID(); #endif }; @@ -312,12 +313,12 @@ class 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 +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS ID; #else 0; diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h index 3ec0ccb31168f..0d8a99d8ead72 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVRange.h @@ -86,10 +86,6 @@ class 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 diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h index 1b6d4e238f865..379bdc10b64d3 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h @@ -324,10 +324,6 @@ class 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. diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h index 25bfa9eb77d8a..a019847a9404e 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h @@ -182,10 +182,6 @@ class 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 diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h index 58d5bc48c3a72..b1d8511ad689d 100644 --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVType.h @@ -145,10 +145,6 @@ class 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. diff --git a/llvm/lib/DebugInfo/LogicalView/Core/LVObject.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVObject.cpp index 75acbf3225e08..3d5c2b26fef15 100644 --- a/llvm/lib/DebugInfo/LogicalView/Core/LVObject.cpp +++ b/llvm/lib/DebugInfo/LogicalView/Core/LVObject.cpp @@ -21,7 +21,7 @@ using namespace llvm::logicalview; #define DEBUG_TYPE "Object" -#ifndef NDEBUG +#if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS uint64_t LVObject::GID = 0; #endif