From: Mike Spertus Date: Tue, 8 Mar 2016 16:14:23 +0000 (+0000) Subject: Add Visual Studio native visualizers for several Clang types X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ac86c73e7fcb52593064d8ab84f1d5552a0e3e6;p=clang Add Visual Studio native visualizers for several Clang types This is one of a series of changes to improve the MSVC visualization of Clang types. This one focuses on Record and SubstTemplateTypeParmType meaning that, for example, a TemplateArgumentLoc no longer displays incomprehensibly in the locals window as {Argument={DeclArg={Kind=1 QT=0x033acb00 D=0xcccccccc {DeclType=???}}... but instead much more usefully as Type template parameter: SubstTemplateTypeParm: {Identifier (("T"))} => Record, {Identifier (("A"))} Additional types and improvements will be made in subsequent commits git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262933 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/clang.natvis b/utils/clang.natvis index a0004e9b01..6ff0123c16 100644 --- a/utils/clang.natvis +++ b/utils/clang.natvis @@ -1,18 +1,81 @@ - Builtin Type={(clang::BuiltinType::Kind)BuiltinTypeBits.Kind} - Modified Type={((clang::AttributedType*)this)->ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind} - Type Class={(clang::Type::TypeClass)TypeBits.TC} + {(clang::Type::TypeClass)TypeBits.TC, en} + Builtin Type={*(clang::BuiltinType *)this} + Modified Type={((clang::AttributedType*)this)->ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind} + {*(clang::SubstTemplateTypeParmType *)this} + {*(clang::RecordType *)this} + {(clang::Type::TypeClass)TypeBits.TC, en} + + (clang::Type::TypeClass)TypeBits.TC + TypeBits + CanonicalType + *(clang::BuiltinType *)this + (clang::SubstTemplateTypeParmType *)this + (clang::RecordType *)this + + + + {*decl} + + decl + + + + {*(clang::Type *)this, view(BaseOnly)}, {*(clang::TagType *)this} + + *(clang::TagType *)this + + + + {*(clang::Type *)this, view(BaseOnly)}: {*Replaced} => {CanonicalType} + + *(clang::Type *)this, view(BaseOnly) + *Replaced + + + + {*TTPDecl} - {((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << clang::TypeAlignmentInBits) - 1)))->BaseType} + + {*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType} + + *((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType + + + + {Argument} + + Argument + + + + {(clang::TemplateArgument::ArgKind)TypeOrValue.Kind,en} template parameter: {*(clang::QualType *)&TypeOrValue.V} + + *(clang::QualType *)&TypeOrValue.V + + + + + {(clang::BuiltinType::Kind)BuiltinTypeBits.Kind, en} + + (clang::BuiltinType::Kind)BuiltinTypeBits.Kind + + + + {Name} + + + {(clang::TemplateDecl *)((Template.Storage.Val.Val.Value >> 2) << 2)} + {Template.Storage} ({((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,s}) @@ -32,14 +95,14 @@ or create a symbolic link so it updates automatically. *(clang::IdentifierInfo *)(Ptr & ~PtrMask) *(clang::IdentifierInfo *)(Ptr & ~PtrMask) (clang::DeclarationNameExtra::ExtraKind)((clang::DeclarationNameExtra *)(Ptr & ~PtrMask))->ExtraKindOrNumArgs - - - - {(clang::tok::TokenKind)Kind} - {{Identifier ({*(clang::IdentifierInfo *)(PtrData)})}} - - - [{(clang::DeclSpec::SCS)StorageClassSpec}], [{(clang::TypeSpecifierType)TypeSpecType}] + + + + {(clang::tok::TokenKind)Kind,en} + {{Identifier ({*(clang::IdentifierInfo *)(PtrData)})}} + + + [{(clang::DeclSpec::SCS)StorageClassSpec}], [{(clang::TypeSpecifierType)TypeSpecType}] {Name,s} @@ -65,4 +128,10 @@ or create a symbolic link so it updates automatically. ParmVarDeclBits + + {($T1 *)Ptr + + ($T1 *)Ptr + +