llvm-project/lldb/source/Plugins/Language/CPlusPlus
Raphael Isemann 785df61680 [lldb] Let TypeSystemClang::GetDisplayTypeName remove anonymous and inline namespaces.
Summary:
Currently when printing data types we include implicit scopes such as inline namespaces or anonymous namespaces.
This leads to command output like this (for `std::set<X>` with X being in an anonymous namespace):

```
(lldb) print my_set
(std::__1::set<(anonymous namespace)::X, std::__1::less<(anonymous namespace)::X>, std::__1::allocator<(anonymous namespace)::X> >) $0 = size=0 {}
```

This patch removes all the implicit scopes when printing type names in TypeSystemClang::GetDisplayTypeName
so that our output now looks like this:

```
(lldb) print my_set
(std::set<X, std::less<X>, std::allocator<X> >) $0 = size=0 {}
```

As previously GetDisplayTypeName and GetTypeName had the same output we actually often used the
two as if they are the same method (they were in fact using the same implementation), so this patch also
fixes the places where we actually want the display type name and not the actual type name.

Note that this doesn't touch the `GetTypeName` class that for example the data formatters use, so this patch
is only changes the way we display types to the user. The full type name can also still be found when passing
'-R' to see the raw output of a variable in case someone is somehow interested in that.

Partly fixes rdar://problem/59292534

Reviewers: shafik, jingham

Reviewed By: shafik

Subscribers: christof, JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74478
2020-02-19 10:30:11 +01:00
..
BlockPointer.cpp [lldb] Remove clang classes from lldb-forward.h 2020-02-04 14:23:58 -08:00
BlockPointer.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
CMakeLists.txt [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
CPlusPlusLanguage.cpp [lldb/Plugin] s/LLDB_PLUGIN/LLDB_PLUGIN_DEFINE/ (NFC) 2020-02-14 09:58:24 -08:00
CPlusPlusLanguage.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
CPlusPlusNameParser.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CPlusPlusNameParser.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
CxxStringTypes.cpp [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
CxxStringTypes.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
LibCxx.cpp [lldb/LibCxx] Have ExtractLibcxxStringInfo return an Optional result, NFC 2020-02-12 11:24:03 -08:00
LibCxx.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
LibCxxAtomic.cpp [lldb] Don't model std::atomic as a transparent data structure in the data formatter 2020-02-18 11:22:12 +01:00
LibCxxAtomic.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
LibCxxBitset.cpp [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
LibCxxInitializerList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LibCxxList.cpp [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
LibCxxMap.cpp [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
LibCxxOptional.cpp [lldb][NFC] Don't hide a bool in LibCxxOptional's OptionalFrontend::m_size 2020-02-10 13:03:06 +01:00
LibCxxQueue.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LibCxxTuple.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LibCxxUnorderedMap.cpp [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
LibCxxVariant.cpp [lldb] Let TypeSystemClang::GetDisplayTypeName remove anonymous and inline namespaces. 2020-02-19 10:30:11 +01:00
LibCxxVariant.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
LibCxxVector.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LibStdcpp.cpp [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
LibStdcpp.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
LibStdcppTuple.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LibStdcppUniquePointer.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
MSVCUndecoratedNameParser.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
MSVCUndecoratedNameParser.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00