From 310a23fc9ae245bdedfe69f9ed0ab749717d50f2 Mon Sep 17 00:00:00 2001 From: Mike Spertus Date: Sat, 5 Jan 2019 17:01:34 +0000 Subject: [PATCH] Improve MSVC type visualizations Display TypeBits in a single line. Fix bit rot in template visualizations Rudimentary support for deduced types git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350470 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/ClangVisualizers/clang.natvis | 54 +++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/utils/ClangVisualizers/clang.natvis b/utils/ClangVisualizers/clang.natvis index 24c4715cca..a581a0d068 100644 --- a/utils/ClangVisualizers/clang.natvis +++ b/utils/ClangVisualizers/clang.natvis @@ -34,16 +34,37 @@ For later versions of Visual Studio, no setup is required--> {*(clang::RecordType *)this,view(cpp)} {*(clang::FunctionProtoType *)this} {*(clang::TemplateSpecializationType *)this} + {*(clang::DeducedTemplateSpecializationType *)this} {*(clang::InjectedClassNameType *)this} {*(clang::PackExpansionType *)this} {*(clang::LocInfoType *)this} {*this,view(poly)} No visualizer yet for {(clang::Type::TypeClass)TypeBits.TC,en}Type + Dependent + + InstantiationDependent + + VariablyModified + + ContainsUnexpandedParameterPack + + CachedLinkage: {(clang::Linkage)TypeBits.CachedLinkage,en} CachedLocalOrUnnamed + CachedLinkage: {(clang::Linkage)TypeBits.CachedLinkage,en} + + FromAST + + + No TypeBits set beyond TypeClass + + + {*this, view(Dependent)}{*this, view(InstantiationDependent)}{*this, view(VariablyModified)} + {*this, view(ContainsUnexpandedParameterPack)}{*this, view(Cache)}{*this, view(FromAST)} {*this,view(cmn)} {{{*this,view(poly)}}} (clang::Type::TypeClass)TypeBits.TC - TypeBits + *this,view(flags) CanonicalType + CanonicalType.Value.Value == this *(clang::BuiltinType *)this *(clang::PointerType *)this *(clang::LValueReferenceType *)this @@ -54,6 +75,7 @@ For later versions of Visual Studio, no setup is required--> (clang::RecordType *)this (clang::FunctionProtoType *)this (clang::TemplateSpecializationType *)this + (clang::DeducedTemplateSpecializationType *)this (clang::InjectedClassNameType *)this (clang::PackExpansionType *)this (clang::LocInfoType *)this @@ -125,7 +147,13 @@ For later versions of Visual Studio, no setup is required--> {*this,view(TorC)} {*this,view(MaybeEllipses)}{Name,view(cpp)} - template{*TemplateParams} {*TemplatedDecl}; + template{TemplateParams,view(deref)} {*TemplatedDecl}; + + + {Storage,view(deref)} + + Storage + {Name,view(cpp)} @@ -136,11 +164,11 @@ For later versions of Visual Studio, no setup is required--> {*this,view(implicit)} {*this,view(modifiers)}{Name,view(cpp)} - {*this,view(modifiers)}struct {Name,view(cpp)} - {*this,view(modifiers)}interface {Name,view(cpp)} - {*this,view(modifiers)}union {Name,view(cpp)} - {*this,view(modifiers)}class {Name,view(cpp)} - {*this,view(modifiers)}enum {Name,view(cpp)} + {*this,view(modifiers)}struct {Name,view(cpp)} + {*this,view(modifiers)}interface {Name,view(cpp)} + {*this,view(modifiers)}union {Name,view(cpp)} + {*this,view(modifiers)}class {Name,view(cpp)} + {*this,view(modifiers)}enum {Name,view(cpp)} (clang::DeclContext *)this @@ -381,6 +409,18 @@ For later versions of Visual Studio, no setup is required--> + + + (CanonicalType.Value.Value != this) || TypeBits.Dependent + *(clang::Type *)this,view(cmn) + + + + {Template} + + *(clang::DeducedType *)this + + {((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,sb} -- 2.40.0