Re: [PATCH] D18163: Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
mspertus added a comment. Committed as revision 263638. At Chandler's suggestion, I am going to send an announcement to cfe-dev letting people know of all of the recent improvements to native visualizers http://reviews.llvm.org/D18163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D18163: Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
mspertus updated this revision to Diff 50820. mspertus added a comment. Added reference types and a more accurate AttributedType enum. I am working on additional items for the future (class members, function types, etc.) but those will take longer, and I think it is worthwhile to get this revision committed unless there are defects in it. Agree? http://reviews.llvm.org/D18163 Files: clang.natvis Index: clang.natvis === --- clang.natvis +++ clang.natvis @@ -6,46 +6,112 @@ or create a symbolic link so it updates automatically. --> http://schemas.microsoft.com/vstudio/debugger/natvis/2010;> + -{(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 + +{(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 *)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,22 +136,21 @@ (clang::BuiltinType::Kind)BuiltinTypeBits.Kind - -{Name} - + {(clang::TemplateDecl *)((Template.Storage.Val.Val.Value 2) 2)} {Template.Storage} -({((llvm::StringMapEntryclang::IdentifierInfo **)Entry)+1,s}) +{((llvm::StringMapEntryclang::IdentifierInfo **)Entry)+1,sb} ((llvm::StringMapEntryclang::IdentifierInfo **)Entry)+1,s (clang::tok::TokenKind)TokenID 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)})}} ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D18163: Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
mspertus closed this revision. mspertus added a comment. Forgot to close the revision http://reviews.llvm.org/D18163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D18163: Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. In http://reviews.llvm.org/D18163#376358, @mspertus wrote: > Added reference types and a more accurate AttributedType enum. I am working > on additional items for the future (class members, function types, etc.) but > those will take longer, and I think it is worthwhile to get this revision > committed unless there are defects in it. Agree? Definitely agree. This LGTM now, thank you! http://reviews.llvm.org/D18163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D18163: Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
aaron.ballman added inline comments. Comment at: clang.natvis:25 @@ +24,3 @@ +{*(clang::BuiltinType *)this} +{*(clang::PointerType *)this} +{*(clang::AttributedType *)this} If we're handling pointers, perhaps we should also do references similarly? Also, perhaps functions as well (bonus points if you can suss out the function prototype and display it!)? Comment at: clang.natvis:26 @@ +25,3 @@ +{*(clang::PointerType *)this} +{*(clang::AttributedType *)this} +{*(clang::TemplateTypeParmType *)this} I think this should be `TypeBits.TC==clang::Type::TypeClass::Attributed` instead. http://reviews.llvm.org/D18163 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D18163: Add visualizers for more clang types. Create more C++-like visualizations for existing Clang types
mspertus created this revision. mspertus added reviewers: aaron.ballman, zturner. mspertus added a subscriber: cfe-commits. Herald added a subscriber: aemerson. This adds visualizers for PointerType and TemplateTypeParmType. As I have been using these visualizers, I have found the DisplayStrings to be too verbose to cleanly see in the Locals Window, so I have changed the Display Strings to display in a more C++-like style. For example, instead of a SubstTemplateTypeParmType displaying as 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 http://reviews.llvm.org/D18163 Files: clang.natvis Index: clang.natvis === --- clang.natvis +++ clang.natvis @@ -6,46 +6,91 @@ or create a symbolic link so it updates automatically. --> http://schemas.microsoft.com/vstudio/debugger/natvis/2010;> + -{(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 + +{(clang::Type::TypeClass)TypeBits.TC, en}Type + +{*(clang::BuiltinType *)this} +{*(clang::PointerType *)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::AttributedType *)this + (clang::TemplateTypeParmType *)this + (clang::SubstTemplateTypeParmType *)this + (clang::RecordType *)this + + + +{PointeeType, view(poly)} * + + *(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,22 +115,21 @@ (clang::BuiltinType::Kind)BuiltinTypeBits.Kind - -{Name} - + {(clang::TemplateDecl *)((Template.Storage.Val.Val.Value 2) 2)} {Template.Storage} -({((llvm::StringMapEntryclang::IdentifierInfo **)Entry)+1,s}) +{((llvm::StringMapEntryclang::IdentifierInfo **)Entry)+1,sb} ((llvm::StringMapEntryclang::IdentifierInfo **)Entry)+1,s (clang::tok::TokenKind)TokenID 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)})}} ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits