diff options
Diffstat (limited to 'source/Symbol/ClangASTContext.cpp')
-rw-r--r-- | source/Symbol/ClangASTContext.cpp | 56 |
1 files changed, 33 insertions, 23 deletions
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp index 49b28349fd15..482a08322663 100644 --- a/source/Symbol/ClangASTContext.cpp +++ b/source/Symbol/ClangASTContext.cpp @@ -14,7 +14,7 @@ // C Includes // C++ Includes -#include <mutex> // std::once +#include <mutex> #include <string> #include <vector> @@ -65,16 +65,17 @@ #endif #include "llvm/Support/Signals.h" +#include "llvm/Support/Threading.h" #include "Plugins/ExpressionParser/Clang/ClangFunctionCaller.h" #include "Plugins/ExpressionParser/Clang/ClangUserExpression.h" #include "Plugins/ExpressionParser/Clang/ClangUtilityFunction.h" #include "lldb/Core/ArchSpec.h" -#include "lldb/Core/Flags.h" -#include "lldb/Core/Log.h" +#include "lldb/Utility/Flags.h" + +#include "lldb/Core/DumpDataExtractor.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" -#include "lldb/Core/RegularExpression.h" #include "lldb/Core/Scalar.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/ThreadSafeDenseMap.h" @@ -92,7 +93,10 @@ #include "lldb/Target/ObjCLanguageRuntime.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/LLDBAssert.h" +#include "lldb/Utility/Log.h" +#include "lldb/Utility/RegularExpression.h" #include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h" #include "Plugins/SymbolFile/PDB/PDBASTParser.h" @@ -127,8 +131,8 @@ typedef lldb_private::ThreadSafeDenseMap<clang::ASTContext *, ClangASTContext *> static ClangASTMap &GetASTMap() { static ClangASTMap *g_map_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { + static llvm::once_flag g_once_flag; + llvm::call_once(g_once_flag, []() { g_map_ptr = new ClangASTMap(); // leaked on purpose to avoid spins }); return *g_map_ptr; @@ -954,8 +958,8 @@ ClangASTContext::GetBasicTypeEnumeration(const ConstString &name) { if (name) { typedef UniqueCStringMap<lldb::BasicType> TypeNameToBasicTypeMap; static TypeNameToBasicTypeMap g_type_map; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { + static llvm::once_flag g_once_flag; + llvm::call_once(g_once_flag, []() { // "void" g_type_map.Append(ConstString("void").GetStringRef(), eBasicTypeVoid); @@ -4314,6 +4318,8 @@ ClangASTContext::GetTypeClass(lldb::opaque_compiler_type_t type) { break; case clang::Type::TemplateSpecialization: break; + case clang::Type::DeducedTemplateSpecialization: + break; case clang::Type::Atomic: break; case clang::Type::Pipe: @@ -5039,7 +5045,6 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type, case clang::BuiltinType::Kind::OCLImage3dWO: case clang::BuiltinType::Kind::OCLImage3dRW: case clang::BuiltinType::Kind::OCLQueue: - case clang::BuiltinType::Kind::OCLNDRange: case clang::BuiltinType::Kind::OCLReserveID: case clang::BuiltinType::Kind::OCLSampler: case clang::BuiltinType::Kind::OMPArraySection: @@ -5123,6 +5128,7 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type, case clang::Type::TypeOf: case clang::Type::Decltype: case clang::Type::TemplateSpecialization: + case clang::Type::DeducedTemplateSpecialization: case clang::Type::Atomic: case clang::Type::Adjusted: case clang::Type::Pipe: @@ -5272,6 +5278,7 @@ lldb::Format ClangASTContext::GetFormat(lldb::opaque_compiler_type_t type) { case clang::Type::TypeOf: case clang::Type::Decltype: case clang::Type::TemplateSpecialization: + case clang::Type::DeducedTemplateSpecialization: case clang::Type::Atomic: case clang::Type::Adjusted: case clang::Type::Pipe: @@ -8821,7 +8828,7 @@ ClangASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type, void ClangASTContext::DumpValue( lldb::opaque_compiler_type_t type, ExecutionContext *exe_ctx, Stream *s, - lldb::Format format, const lldb_private::DataExtractor &data, + lldb::Format format, const DataExtractor &data, lldb::offset_t data_byte_offset, size_t data_byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, bool show_types, bool show_summary, bool verbose, uint32_t depth) { @@ -9029,8 +9036,9 @@ void ClangASTContext::DumpValue( if (is_array_of_characters) { s->PutChar('"'); - data.Dump(s, data_byte_offset, lldb::eFormatChar, element_byte_size, - element_count, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0); + DumpDataExtractor(data, s, data_byte_offset, lldb::eFormatChar, + element_byte_size, element_count, UINT32_MAX, + LLDB_INVALID_ADDRESS, 0, 0); s->PutChar('"'); return; } else { @@ -9186,8 +9194,9 @@ void ClangASTContext::DumpValue( default: // We are down to a scalar type that we just need to display. - data.Dump(s, data_byte_offset, format, data_byte_size, 1, UINT32_MAX, - LLDB_INVALID_ADDRESS, bitfield_bit_size, bitfield_bit_offset); + DumpDataExtractor(data, s, data_byte_offset, format, data_byte_size, 1, + UINT32_MAX, LLDB_INVALID_ADDRESS, bitfield_bit_size, + bitfield_bit_offset); if (show_summary) DumpSummary(type, exe_ctx, s, data, data_byte_offset, data_byte_size); @@ -9197,8 +9206,8 @@ void ClangASTContext::DumpValue( bool ClangASTContext::DumpTypeValue( lldb::opaque_compiler_type_t type, Stream *s, lldb::Format format, - const lldb_private::DataExtractor &data, lldb::offset_t byte_offset, - size_t byte_size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, + const DataExtractor &data, lldb::offset_t byte_offset, size_t byte_size, + uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset, ExecutionContextScope *exe_scope) { if (!type) return false; @@ -9336,9 +9345,10 @@ bool ClangASTContext::DumpTypeValue( byte_size = 4; break; } - return data.Dump(s, byte_offset, format, byte_size, item_count, - UINT32_MAX, LLDB_INVALID_ADDRESS, bitfield_bit_size, - bitfield_bit_offset, exe_scope); + return DumpDataExtractor(data, s, byte_offset, format, byte_size, + item_count, UINT32_MAX, LLDB_INVALID_ADDRESS, + bitfield_bit_size, bitfield_bit_offset, + exe_scope); } break; } @@ -9364,8 +9374,8 @@ void ClangASTContext::DumpSummary(lldb::opaque_compiler_type_t type, else buf.resize(256); - lldb_private::DataExtractor cstr_data(&buf.front(), buf.size(), - process->GetByteOrder(), 4); + DataExtractor cstr_data(&buf.front(), buf.size(), + process->GetByteOrder(), 4); buf.back() = '\0'; size_t bytes_read; size_t total_cstr_len = 0; @@ -9377,8 +9387,8 @@ void ClangASTContext::DumpSummary(lldb::opaque_compiler_type_t type, break; if (total_cstr_len == 0) s->PutCString(" \""); - cstr_data.Dump(s, 0, lldb::eFormatChar, 1, len, UINT32_MAX, - LLDB_INVALID_ADDRESS, 0, 0); + DumpDataExtractor(cstr_data, s, 0, lldb::eFormatChar, 1, len, + UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0); total_cstr_len += len; if (len < buf.size()) break; |