Remove use of STL collection class use of the "data()" method since it isn't
part of C++'98. Most of these were "std::vector<T>::data()" and
"std::string::data()".
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108957 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 8087953..754ab19 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -1944,7 +1944,7 @@
// TODO: Detect calling convention in DWARF?
return ast_context->getFunctionType(QualType::getFromOpaquePtr(result_type),
- qual_type_args.data(),
+ qual_type_args.empty() ? NULL : &qual_type_args.front(),
qual_type_args.size(),
isVariadic,
TypeQuals,
diff --git a/source/Symbol/Symtab.cpp b/source/Symbol/Symtab.cpp
index 87d5860..7cb7610 100644
--- a/source/Symbol/Symtab.cpp
+++ b/source/Symbol/Symtab.cpp
@@ -503,8 +503,11 @@
size_t
Symtab::CalculateSymbolSize (Symbol *symbol)
{
+ if (m_symbols.empty())
+ return 0;
+
// Make sure this symbol is from this symbol table...
- if (symbol < m_symbols.data() || symbol >= m_symbols.data() + m_symbols.size())
+ if (symbol < &m_symbols.front() || symbol > &m_symbols.back())
return 0;
// See if this symbol already has a byte size?
@@ -523,7 +526,7 @@
if (m_addr_indexes.empty())
InitAddressIndexes();
const size_t num_addr_indexes = m_addr_indexes.size();
- SymbolSearchInfo info = FindIndexPtrForSymbolContainingAddress(this, symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress(), m_addr_indexes.data(), num_addr_indexes);
+ SymbolSearchInfo info = FindIndexPtrForSymbolContainingAddress(this, symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress(), &m_addr_indexes.front(), num_addr_indexes);
if (info.match_index_ptr != NULL)
{
const lldb::addr_t curr_file_addr = symbol->GetAddressRangePtr()->GetBaseAddress().GetFileAddress();
@@ -531,7 +534,7 @@
// last one by taking the delta between the current symbol and
// the next symbol
- for (uint32_t addr_index = info.match_index_ptr - m_addr_indexes.data() + 1;
+ for (uint32_t addr_index = info.match_index_ptr - &m_addr_indexes.front() + 1;
addr_index < num_addr_indexes;
++addr_index)
{
diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp
index 41336a7..31a5bac 100644
--- a/source/Symbol/Type.cpp
+++ b/source/Symbol/Type.cpp
@@ -399,14 +399,14 @@
else
buf.resize (256);
- lldb_private::DataExtractor cstr_data(buf.data(), buf.size(), exe_ctx->process->GetByteOrder(), 4);
+ lldb_private::DataExtractor cstr_data(&buf.front(), buf.size(), exe_ctx->process->GetByteOrder(), 4);
buf.back() = '\0';
size_t bytes_read;
size_t total_cstr_len = 0;
Error error;
- while ((bytes_read = exe_ctx->process->ReadMemory (pointer_addresss, buf.data(), buf.size(), error)) > 0)
+ while ((bytes_read = exe_ctx->process->ReadMemory (pointer_addresss, &buf.front(), buf.size(), error)) > 0)
{
- const size_t len = strlen((const char *)buf.data());
+ const size_t len = strlen((const char *)&buf.front());
if (len == 0)
break;
if (total_cstr_len == 0)