mspertus created this revision. mspertus added reviewers: aaron.ballman, zturner. mspertus added a subscriber: cfe-commits. Herald added a subscriber: aemerson.
This is the first of a series of patches to add additional Visual Studio native visualizers for subclasses of clang::Type. For example, a SubstTemplateTypeParmType where the template type parameter "T" is replaced by the class "A" will show as follows in the locals window: Type (1), SubstTemplateTypeParm (30): {Identifier (("T"))} => Record (25), {Identifier (("A"))} Once this is accepted, I will continue to add further clang Type subclasses http://reviews.llvm.org/D17908 Files: clang.natvis
Index: clang.natvis =================================================================== --- clang.natvis +++ clang.natvis @@ -1,18 +1,81 @@ <?xml version="1.0" encoding="utf-8"?> <!-- -Visual Studio 2012 Native Debugging Visualizers for LLVM +Visual Studio 2015 Native Debugging Visualizers for LLVM -Put this file into "%USERPROFILE%\Documents\Visual Studio 2012\Visualizers" +Put this file into "%USERPROFILE%\Documents\Visual Studio 2015\Visualizers" or create a symbolic link so it updates automatically. --> <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> <Type Name="clang::Type"> - <DisplayString Condition="(clang::Type::TypeClass)TypeBits.TC == clang::Type::Builtin">Builtin Type={(clang::BuiltinType::Kind)BuiltinTypeBits.Kind}</DisplayString> - <DisplayString Condition="(clang::Type::TypeClass)TypeBits.TC == clang::Type::Attributed">Modified Type={((clang::AttributedType*)this)->ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind}</DisplayString> - <DisplayString>Type Class={(clang::Type::TypeClass)TypeBits.TC}</DisplayString> + <DisplayString IncludeView="BaseOnly">{(clang::Type::TypeClass)TypeBits.TC}</DisplayString> + <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Builtin">Builtin Type={*(clang::BuiltinType *)this}</DisplayString> + <DisplayString Condition="TypeBits.TC==clang::Type::Attributed">Modified Type={((clang::AttributedType*)this)->ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind}</DisplayString> + <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::SubstTemplateTypeParm">{*(clang::SubstTemplateTypeParmType *)this}</DisplayString> + <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Record">{*(clang::RecordType *)this}</DisplayString> + <DisplayString>{(clang::Type::TypeClass)TypeBits.TC}</DisplayString> + <Expand> + <Item Name="TypeClass" IncludeView="BaseOnly">(clang::Type::TypeClass)TypeBits.TC</Item> + <Item Name="Flags" IncludeView="BaseOnly">TypeBits</Item> + <Item Name="Canonical" IncludeView="BaseOnly">CanonicalType</Item> + <ExpandedItem ExcludeView="BaseOnly" Condition="TypeBits.TC==clang::Type::TypeClass::Builtin">*(clang::BuiltinType *)this</ExpandedItem> + <ExpandedItem ExcludeView="BaseOnly" Condition="TypeBits.TC==clang::Type::TypeClass::SubstTemplateTypeParm">(clang::SubstTemplateTypeParmType *)this</ExpandedItem> + <ExpandedItem ExcludeView="BaseOnly" Condition="TypeBits.TC==clang::Type::TypeClass::Record">(clang::RecordType *)this</ExpandedItem> + </Expand> + </Type> + <Type Name="clang::TagType"> + <DisplayString>{*decl}</DisplayString> + <Expand> + <Item Name="decl">decl</Item> + </Expand> + </Type> + <Type Name="clang::RecordType"> + <DisplayString>{*(clang::Type *)this, view(BaseOnly)}, {*(clang::TagType *)this}</DisplayString> + <Expand> + <Item Name="TagType">*(clang::TagType *)this</Item> + </Expand> + </Type> + <Type Name="clang::SubstTemplateTypeParmType"> + <DisplayString>{*(clang::Type *)this, view(BaseOnly)}: {*Replaced} => {CanonicalType}</DisplayString> + <Expand> + <ExpandedItem>*(clang::Type *)this, view(BaseOnly)</ExpandedItem> + <Item Name="Replaced">*Replaced</Item> + </Expand> + </Type> + <Type Name="clang::TemplateTypeParmType"> + <DisplayString>{*TTPDecl}</DisplayString> </Type> <Type Name="clang::QualType"> - <DisplayString>{((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << clang::TypeAlignmentInBits) - 1)))->BaseType}</DisplayString> + <!-- TODO: Qualifiers --> + <DisplayString>{*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << clang::TypeAlignmentInBits) - 1)))->BaseType}</DisplayString> + <Expand> + <Item Name="BaseType">*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << clang::TypeAlignmentInBits) - 1)))->BaseType</Item> + </Expand> + </Type> + <Type Name="clang::TemplateArgumentLoc"> + <DisplayString>{Argument}</DisplayString> + <Expand> + <ExpandedItem>Argument</ExpandedItem> + </Expand> + </Type> + <Type Name="clang::TemplateArgument"> + <DisplayString>{(clang::TemplateArgument::ArgKind)TypeOrValue.Kind}, {*(clang::QualType *)&TypeOrValue.V}</DisplayString> + <Expand> + <Item Name="QualType" Condition="Integer.Kind == clang::TemplateArgument::ArgKind::Type">*(clang::QualType *)&TypeOrValue.V</Item> + <!-- TODO: Other kinds--> + </Expand> + </Type> + <Type Name="clang::BuiltinType"> + <DisplayString>{(clang::BuiltinType::Kind)BuiltinTypeBits.Kind}</DisplayString> + <Expand> + <Item Name="Kind">(clang::BuiltinType::Kind)BuiltinTypeBits.Kind</Item> + </Expand> + </Type> + <Type Name="clang::NamedDecl"> + <DisplayString>{Name}</DisplayString> + </Type> + <Type Name="clang::TemplateSpecializationType"> + <DisplayString Condition="(Template.Storage.Val.Val.Value & 3) != 3 && (Template.Storage.Val.Val.Value & 2) != 2 && (Template.Storage.Val.Val.Value & 1) != 1">{(clang::TemplateDecl *)((Template.Storage.Val.Val.Value >> 2) << 2)}</DisplayString> + <DisplayString>{Template.Storage}</DisplayString> </Type> <Type Name="clang::IdentifierInfo"> <DisplayString Condition="Entry != 0">({((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,s})</DisplayString> @@ -65,4 +128,10 @@ <Item Name="ParmVarDeclBits">ParmVarDeclBits</Item> </Expand> </Type> + <Type Name="clang::OpaquePtr<*>"> + <DisplayString>{($T1 *)Ptr</DisplayString> + <Expand> + <ExpandedItem>($T1 *)Ptr</ExpandedItem> + </Expand> + </Type> </AutoVisualizer>
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits