diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVElement.h @@ -15,7 +15,6 @@ #define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVELEMENT_H #include "llvm/DebugInfo/LogicalView/Core/LVObject.h" -#include "llvm/DebugInfo/LogicalView/Core/LVStringPool.h" #include "llvm/Support/Casting.h" #include #include diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVStringPool.h @@ -71,11 +71,6 @@ return (Index >= Entries.size()) ? StringRef() : Entries[Index]->getKey(); } - static LVStringPool &getInstance() { - static LVStringPool Instance; - return Instance; - } - void print(raw_ostream &OS) const { if (!Entries.empty()) { OS << "\nString Pool:\n"; @@ -90,8 +85,6 @@ #endif }; -inline LVStringPool &getStringPool() { return LVStringPool::getInstance(); } - } // namespace logicalview } // end namespace llvm diff --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h --- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h +++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSupport.h @@ -16,6 +16,7 @@ #include "llvm/ADT/SmallBitVector.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" +#include "llvm/DebugInfo/LogicalView/Core/LVStringPool.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Format.h" #include "llvm/Support/Path.h" @@ -27,6 +28,9 @@ namespace llvm { namespace logicalview { +// Returns the unique string pool instance. +LVStringPool &getStringPool(); + template using TypeIsValid = std::bool_constant::value>; diff --git a/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp --- a/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp +++ b/llvm/lib/DebugInfo/LogicalView/Core/LVSupport.cpp @@ -20,6 +20,12 @@ #define DEBUG_TYPE "Support" +namespace { +// Unique string pool instance used by all logical readers. +LVStringPool StringPool; +} // namespace +LVStringPool &llvm::logicalview::getStringPool() { return StringPool; } + // Perform the following transformations to the given 'Path': // - all characters to lowercase. // - '\\' into '/' (Platform independent).