summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language/CPlusPlus
diff options
context:
space:
mode:
authorAlex Langford <apl@fb.com>2019-11-14 13:41:52 -0800
committerAlex Langford <apl@fb.com>2019-12-12 11:53:24 -0800
commit3031818a2e9fca1e53cd882ccfcc3718699991b4 (patch)
tree4682f9ca1c9db4b7be7170e3faac6c09b6aa6544 /lldb/source/Plugins/Language/CPlusPlus
parent7a54f727a2a546ab34df29f48c8e1a10218d74a6 (diff)
downloadbcm5719-llvm-3031818a2e9fca1e53cd882ccfcc3718699991b4.tar.gz
bcm5719-llvm-3031818a2e9fca1e53cd882ccfcc3718699991b4.zip
[Target] Remove Target::GetScratchClangASTContext
Target doesn't really need to know about ClangASTContext more than any other TypeSystem. We can create a method ClangASTContext::GetScratch for anything who needs a ClangASTContext specifically instead of just a generic TypeSystem.
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus')
-rw-r--r--lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
index abe89035c53..ecadaef7a87 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
@@ -572,10 +572,13 @@ bool lldb_private::formatters::LibcxxWStringSummaryProvider(
location_sp->GetPointeeData(extractor, 0, size);
// std::wstring::size() is measured in 'characters', not bytes
- auto wchar_t_size = valobj.GetTargetSP()
- ->GetScratchClangASTContext()
- ->GetBasicType(lldb::eBasicTypeWChar)
- .GetByteSize(nullptr);
+ ClangASTContext *ast_context =
+ ClangASTContext::GetScratch(*valobj.GetTargetSP());
+ if (!ast_context)
+ return false;
+
+ auto wchar_t_size =
+ ast_context->GetBasicType(lldb::eBasicTypeWChar).GetByteSize(nullptr);
if (!wchar_t_size)
return false;
OpenPOWER on IntegriCloud