From: Mike Spertus Date: Sat, 11 Jun 2016 20:15:19 +0000 (+0000) Subject: Visual Studio Visualizers for ActionResult, LocInfoType, and and TypeSourceInfo X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13a66b76e40619c2f1cf47c6f88db1763bdf292f;p=clang Visual Studio Visualizers for ActionResult, LocInfoType, and and TypeSourceInfo Created a visualizer for ActionResult that displayed the validity and the pointer, but many of them initially displayed poorly. It turns out that the primary culprit is that LocInfoType is often passed in an action result, but it is not the same as other types. For example, LocInfoType is not in TypeNodes.def and clang::Type::TypeClass does not have a LocInfoType enum. After adding a special visualizer for LocInfoType, the display was more useful git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272487 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/ClangVisualizers/clang.natvis b/utils/ClangVisualizers/clang.natvis index 62cea41950..f5e13819e1 100644 --- a/utils/ClangVisualizers/clang.natvis +++ b/utils/ClangVisualizers/clang.natvis @@ -20,6 +20,7 @@ For later versions of Visual Studio, no setup is required--> containing all the gory details. "cpp": Only occasionally used when we need to distinguish between an ordinary view and a C++-like view. --> + LocInfoType {(clang::Type::TypeClass)TypeBits.TC, en}Type {*(clang::BuiltinType *)this} @@ -34,6 +35,7 @@ For later versions of Visual Studio, no setup is required--> {*(clang::FunctionProtoType *)this} {*(clang::TemplateSpecializationType *)this} {*(clang::InjectedClassNameType *)this} + {*(clang::LocInfoType *)this} {*this,view(poly)} {*this,view(cmn)} {*this,view(cmn)} {{{*this,view(poly)}}} @@ -52,6 +54,7 @@ For later versions of Visual Studio, no setup is required--> (clang::FunctionProtoType *)this (clang::TemplateSpecializationType *)this (clang::InjectedClassNameType *)this + (clang::LocInfoType *)this @@ -226,6 +229,16 @@ For later versions of Visual Studio, no setup is required--> *((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType + + {*DeclInfo} + + DeclInfo + *(clang::Type *)this, view(cmn) + + + + {Ty} + {Argument} @@ -499,4 +512,30 @@ For later versions of Visual Studio, no setup is required--> {Ambiguity,en}: {Decls} {ResultKind,en}: {Decls} + + Invalid + Valid + + + Invalid + Valid + + + {*this,view(packedValidity)}: {($T1 *)(PtrWithInvalid&~1)} + + (bool)(PtrWithInvalid&1) + ($T1 *)(PtrWithInvalid&~1) + + + + {*this,view(unpackedValidity)}: {Val} + + + {*this,view(packed)} + {*this,view(unpacked)} + + *this,view(packed) + *this,view(unpacked) + +