From: Mike Spertus Date: Wed, 16 Mar 2016 14:27:50 +0000 (+0000) Subject: Add visualizers for more clang types. Create more C++-like visualizations for existin... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10d1e7a41eaa9450bbba385eddb1863509f72be1;p=clang Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types Created visualizer for PointerType, LValueReferenceType, RValueReferenceType, and TemplateParmType. In addition, cleaned up the display of existing types to be more C++-like. For example, instead of SubstTemplateTypeParmType: {Identifier (("T"))} => Record (25), {Identifier (("A"))} it now displays more readably as SubstTemplateTypeParmType: {typename T <= struct A} The sections still can be used for all the gory details if necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263638 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/clang.natvis b/utils/clang.natvis index 6ff0123c16..ef20a211eb 100644 --- a/utils/clang.natvis +++ b/utils/clang.natvis @@ -6,46 +6,112 @@ Put this file into "%USERPROFILE%\Documents\Visual Studio 20xx\Visualizers" or create a symbolic link so it updates automatically. --> + - {(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, en}Type + + {*(clang::BuiltinType *)this} + {*(clang::PointerType *)this} + {*(clang::LValueReferenceType *)this} + {*(clang::RValueReferenceType *)this} + {*(clang::AttributedType *)this} + {*(clang::TemplateTypeParmType *)this} + {*(clang::SubstTemplateTypeParmType *)this} + {*(clang::RecordType *)this} + {*this,view(poly)} + {*this,view(cmn)}" + {*this,view(cmn)} {{{*this,view(poly)}}} + + (clang::Type::TypeClass)TypeBits.TC + TypeBits + CanonicalType + *(clang::BuiltinType *)this + *(clang::PointerType *)this + *(clang::LValueReferenceType *)this + *(clang::RValueReferenceType *)this + *(clang::AttributedType *)this + (clang::TemplateTypeParmType *)this + (clang::SubstTemplateTypeParmType *)this + (clang::RecordType *)this + + + + {PointeeType, view(poly)} * + + *(clang::Type *)this, view(cmn) + PointeeType + + + + + {((clang::ReferenceType *)this)->PointeeType,view(cpp)} & + + *(clang::Type *)this, view(cmn) + PointeeType + + + + {((clang::ReferenceType *)this)->PointeeType,view(cpp)} && - (clang::Type::TypeClass)TypeBits.TC - TypeBits - CanonicalType - *(clang::BuiltinType *)this - (clang::SubstTemplateTypeParmType *)this - (clang::RecordType *)this + *(clang::Type *)this, view(cmn) + PointeeType + + {ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind} + + + {Name,view(cpp)} + {Name} + + + struct {Name,view(cpp)} + interface {Name,view(cpp)} + union {Name,view(cpp)} + class {Name,view(cpp)} + enum {Name,view(cpp)} + {*decl} + *(clang::Type *)this, view(cmn) decl - {*(clang::Type *)this, view(BaseOnly)}, {*(clang::TagType *)this} + {*(clang::TagType *)this} *(clang::TagType *)this + - {*(clang::Type *)this, view(BaseOnly)}: {*Replaced} => {CanonicalType} + {*Replaced,view(cpp)} <= {CanonicalType,view(cpp)} - *(clang::Type *)this, view(BaseOnly) + *(clang::Type *)this, view(cmn) *Replaced - {*TTPDecl} + typename {*TTPDecl,view(cpp)} + {*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType,view(poly)} + {*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType,view(cpp)} {*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType} *((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType @@ -70,15 +136,13 @@ or create a symbolic link so it updates automatically. (clang::BuiltinType::Kind)BuiltinTypeBits.Kind - - {Name} - + {(clang::TemplateDecl *)((Template.Storage.Val.Val.Value >> 2) << 2)} {Template.Storage} - ({((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,s}) + {((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,sb} ((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,s (clang::tok::TokenKind)TokenID @@ -86,6 +150,7 @@ or create a symbolic link so it updates automatically. Empty + {*(clang::IdentifierInfo *)(Ptr & ~PtrMask)} {{Identifier ({*(clang::IdentifierInfo *)(Ptr & ~PtrMask)})}} {{ObjC Zero Arg Selector (*{(clang::IdentifierInfo *)(Ptr & ~PtrMask)})}} {{ObjC One Arg Selector (*{(clang::IdentifierInfo *)(Ptr & ~PtrMask)})}}