[Lldb-commits] [PATCH] D120718: Qualify DataExtractor with lldb_private

Emre Kultursay via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 1 05:59:03 PST 2022


emrekultursay created this revision.
emrekultursay requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

There are two DataExtractors in scope: one from the llvm namespace
and one from the lldb_private namespace. Some Microsoft Visual C++
compilers (I tested with MSVC 14.23 specifically) cannot handle this
situation, and generate ambiguous symbol errors. This change fixes
this compile error.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120718

Files:
  lldb/include/lldb/Core/DataFileCache.h
  lldb/source/Core/DataFileCache.cpp


Index: lldb/source/Core/DataFileCache.cpp
===================================================================
--- lldb/source/Core/DataFileCache.cpp
+++ lldb/source/Core/DataFileCache.cpp
@@ -219,7 +219,7 @@
   return true;
 }
 
-bool CacheSignature::Decode(const DataExtractor &data,
+bool CacheSignature::Decode(const lldb_private::DataExtractor &data,
                             lldb::offset_t *offset_ptr) {
   Clear();
   while (uint8_t sig_encoding = data.GetU8(offset_ptr)) {
@@ -284,7 +284,7 @@
   return true;
 }
 
-bool StringTableReader::Decode(const DataExtractor &data,
+bool StringTableReader::Decode(const lldb_private::DataExtractor &data,
                                lldb::offset_t *offset_ptr) {
   llvm::StringRef identifier((const char *)data.GetData(offset_ptr, 4), 4);
   if (identifier != kStringTableIdentifier)
Index: lldb/include/lldb/Core/DataFileCache.h
===================================================================
--- lldb/include/lldb/Core/DataFileCache.h
+++ lldb/include/lldb/Core/DataFileCache.h
@@ -161,7 +161,8 @@
   ///
   /// \return
   ///   True if the signature was successfully decoded, false otherwise.
-  bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr);
+  bool Decode(const lldb_private::DataExtractor &data,
+              lldb::offset_t *offset_ptr);
 };
 
 /// Many cache files require string tables to store data efficiently. This
@@ -204,7 +205,8 @@
 
   llvm::StringRef Get(uint32_t offset) const;
 
-  bool Decode(const DataExtractor &data, lldb::offset_t *offset_ptr);
+  bool Decode(const lldb_private::DataExtractor &data,
+              lldb::offset_t *offset_ptr);
 
 protected:
   /// All of the strings in the string table are contained in m_data.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120718.412072.patch
Type: text/x-patch
Size: 1738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220301/cc2d5879/attachment-0001.bin>


More information about the lldb-commits mailing list