llvm-project/lldb/source/DataFormatters
Raphael Isemann 839e845277 [lldb] Remove assumption from Clang-based data formatters that their types are in the scratch AST
Several data formatters assume their types are in the Target's scratch AST and
build new types from that scratch AST instance. However, types from different
ASTs shouldn't be mixed, so this (unchecked) assumption may lead to problems if
we ever have more than one scratch AST or someone somehow invokes data
formatters on a type that are not in the scratch AST.

Instead we can use in all the formatters just the TypeSystem of the type we're
formatting. That's much simpler and avoids all the headache of finding the right
TypeSystem that matches the one of the formatted type.

Right now LLDB only has one scratch TypeSystemClang instance and we format only
types that are in the scratch AST, so this doesn't change anything in the
current way LLDB works. The intention here is to allow follow up refactorings
that introduce multiple scratch ASTs with the same Target.

Differential Revision: https://reviews.llvm.org/D92757
2020-12-10 17:35:03 +01:00
..
CMakeLists.txt Remove TypeValidators (NFC in terms of the testsuite) 2019-12-11 09:27:12 -08:00
CXXFunctionPointer.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DataVisualization.cpp [lldb][NFC] Remove FormatMap 2020-07-23 18:34:59 +02:00
DumpValueObjectOptions.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FormatCache.cpp [lldb][NFC] Always update m_cache_{hits/misses} in FormatCache 2020-03-24 20:16:43 +01:00
FormatClasses.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FormatManager.cpp Reland [lldb] Unify type name matching in FormattersContainer II 2020-07-23 18:17:42 +02:00
FormattersHelpers.cpp [DataFormatters] Add formatter for libc++ std::unique_ptr 2020-03-23 11:48:20 -07:00
LanguageCategory.cpp [LLDB] Fix compilation with GCC 5 2020-02-06 10:16:32 +02:00
StringPrinter.cpp [lldb/StringPrinter] Support strings with invalid utf8 sub-sequences 2020-06-03 12:24:23 -07:00
TypeCategory.cpp [lldb] Remove FormattersContainer's name member 2020-07-21 13:54:38 +02:00
TypeCategoryMap.cpp [lldb][NFC] Remove FormatterChoiceCriterion 2020-04-15 09:47:15 +02:00
TypeFormat.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeSummary.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
TypeSynthetic.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
ValueObjectPrinter.cpp [lldb/DataFormatters] Display null C++ pointers as nullptr 2020-11-12 15:24:06 -08:00
VectorType.cpp [lldb] Remove assumption from Clang-based data formatters that their types are in the scratch AST 2020-12-10 17:35:03 +01:00