or create a symbolic link so it updates automatically.\r
-->\r
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">\r
+\r
<Type Name="clang::Type">\r
- <DisplayString IncludeView="BaseOnly">{(clang::Type::TypeClass)TypeBits.TC, en}</DisplayString>\r
- <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Builtin">Builtin Type={*(clang::BuiltinType *)this}</DisplayString>\r
- <DisplayString Condition="TypeBits.TC==clang::Type::Attributed">Modified Type={((clang::AttributedType*)this)->ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind}</DisplayString>\r
- <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::SubstTemplateTypeParm">{*(clang::SubstTemplateTypeParmType *)this}</DisplayString>\r
- <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Record">{*(clang::RecordType *)this}</DisplayString>\r
- <DisplayString>{(clang::Type::TypeClass)TypeBits.TC, en}</DisplayString>\r
+ <!-- To visualize clang::Types, we need to look at TypeBits.TC to determine the actual\r
+ type subclass and manually dispatch accordingly (Visual Studio can't identify the real type\r
+ because clang::Type has no virtual members hence no RTTI). \r
+ \r
+ Views:\r
+ "cmn": Visualization that is common to all clang::Type subclasses\r
+ "poly": Visualization that is specific to the actual clang::Type subclass. The subtype-specific\r
+ <DisplayString> is typically as C++-like as possible (like in dump()) with <Expand>\r
+ containing all the gory details.\r
+ "cpp": Only occasionally used when we need to distinguish between an ordinary view and a C++-like view.\r
+ -->\r
+ <DisplayString IncludeView="cmn">{(clang::Type::TypeClass)TypeBits.TC, en}Type</DisplayString>\r
+ <!-- Dispatch to visualizers for the actual Type subclass -->\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Builtin" IncludeView="poly">{*(clang::BuiltinType *)this}</DisplayString>\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Pointer" IncludeView="poly">{*(clang::PointerType *)this}</DisplayString>\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::LValueReference" IncludeView="poly">{*(clang::LValueReferenceType *)this}</DisplayString>\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::RValueReference" IncludeView="poly">{*(clang::RValueReferenceType *)this}</DisplayString>\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Attributed" IncludeView="poly">{*(clang::AttributedType *)this}</DisplayString>\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::TemplateTypeParm" IncludeView="poly">{*(clang::TemplateTypeParmType *)this}</DisplayString>\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::SubstTemplateTypeParm" IncludeView="poly">{*(clang::SubstTemplateTypeParmType *)this}</DisplayString>\r
+ <DisplayString Condition="TypeBits.TC==clang::Type::TypeClass::Record" IncludeView="poly">{*(clang::RecordType *)this}</DisplayString>\r
+ <DisplayString IncludeView="cpp">{*this,view(poly)}</DisplayString>\r
+ <DisplayString IncludeView="poly">{*this,view(cmn)}"</DisplayString> <!-- Not yet implemented Type subclass -->\r
+ <DisplayString>{*this,view(cmn)} {{{*this,view(poly)}}}</DisplayString>\r
+ <Expand>\r
+ <Item Name="TypeClass" IncludeView="cmn">(clang::Type::TypeClass)TypeBits.TC</Item>\r
+ <Item Name="Flags" IncludeView="cmn">TypeBits</Item>\r
+ <Item Name="Canonical" IncludeView="cmn">CanonicalType</Item>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::Builtin">*(clang::BuiltinType *)this</ExpandedItem>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::Pointer">*(clang::PointerType *)this</ExpandedItem>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::LValueReference">*(clang::LValueReferenceType *)this</ExpandedItem>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::RValueReference">*(clang::RValueReferenceType *)this</ExpandedItem>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::Attributed">*(clang::AttributedType *)this</ExpandedItem>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::TemplateTypeParm">(clang::TemplateTypeParmType *)this</ExpandedItem>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::SubstTemplateTypeParm">(clang::SubstTemplateTypeParmType *)this</ExpandedItem>\r
+ <ExpandedItem ExcludeView="cmn" Condition="TypeBits.TC==clang::Type::TypeClass::Record">(clang::RecordType *)this</ExpandedItem>\r
+ </Expand>\r
+ </Type>\r
+ <Type Name="clang::PointerType">\r
+ <DisplayString>{PointeeType, view(poly)} *</DisplayString>\r
+ <Expand>\r
+ <ExpandedItem>*(clang::Type *)this, view(cmn)</ExpandedItem>\r
+ <Item Name="PointeeType">PointeeType</Item>\r
+ </Expand>\r
+ </Type>\r
+ <!-- We visualize all inner types for clang reference types. So a rvalue reference to an lvalue reference\r
+ to an int would visual as int & && This is a little different than GetPointeeType(),\r
+ but more clearly displays the data structure and seems natural -->\r
+ <Type Name="clang::LValueReferenceType">\r
+ <DisplayString>{((clang::ReferenceType *)this)->PointeeType,view(cpp)} &</DisplayString>\r
+ <Expand>\r
+ <ExpandedItem>*(clang::Type *)this, view(cmn)</ExpandedItem>\r
+ <Item Name="PointeeType">PointeeType</Item>\r
+ </Expand>\r
+ </Type>\r
+ <Type Name="clang::RValueReferenceType">\r
+ <DisplayString>{((clang::ReferenceType *)this)->PointeeType,view(cpp)} &&</DisplayString>\r
<Expand>\r
- <Item Name="TypeClass" IncludeView="BaseOnly">(clang::Type::TypeClass)TypeBits.TC</Item>\r
- <Item Name="Flags" IncludeView="BaseOnly">TypeBits</Item>\r
- <Item Name="Canonical" IncludeView="BaseOnly">CanonicalType</Item>\r
- <ExpandedItem ExcludeView="BaseOnly" Condition="TypeBits.TC==clang::Type::TypeClass::Builtin">*(clang::BuiltinType *)this</ExpandedItem>\r
- <ExpandedItem ExcludeView="BaseOnly" Condition="TypeBits.TC==clang::Type::TypeClass::SubstTemplateTypeParm">(clang::SubstTemplateTypeParmType *)this</ExpandedItem>\r
- <ExpandedItem ExcludeView="BaseOnly" Condition="TypeBits.TC==clang::Type::TypeClass::Record">(clang::RecordType *)this</ExpandedItem>\r
+ <ExpandedItem>*(clang::Type *)this, view(cmn)</ExpandedItem>\r
+ <Item Name="PointeeType">PointeeType</Item>\r
</Expand>\r
</Type>\r
+ <Type Name="clang::AttributedType">\r
+ <DisplayString>{ModifiedType} Attribute={(clang::AttributedType::Kind)AttributedTypeBits.AttrKind}</DisplayString>\r
+ </Type>\r
+ <Type Name="clang::NamedDecl" >\r
+ <DisplayString IncludeView="cpp">{Name,view(cpp)}</DisplayString>\r
+ <DisplayString>{Name}</DisplayString>\r
+ </Type>\r
+ <Type Name="clang::TagDecl">\r
+ <DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Struct">struct {Name,view(cpp)}</DisplayString>\r
+ <DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Interface">interface {Name,view(cpp)}</DisplayString>\r
+ <DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Union">union {Name,view(cpp)}</DisplayString>\r
+ <DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Class">class {Name,view(cpp)}</DisplayString>\r
+ <DisplayString Condition="TagDeclKind==clang::TagTypeKind::TTK_Enum">enum {Name,view(cpp)}</DisplayString>\r
+ </Type>\r
<Type Name="clang::TagType">\r
<DisplayString>{*decl}</DisplayString>\r
<Expand>\r
+ <ExpandedItem>*(clang::Type *)this, view(cmn)</ExpandedItem>\r
<Item Name="decl">decl</Item>\r
</Expand>\r
</Type>\r
<Type Name="clang::RecordType">\r
- <DisplayString>{*(clang::Type *)this, view(BaseOnly)}, {*(clang::TagType *)this}</DisplayString>\r
+ <DisplayString>{*(clang::TagType *)this}</DisplayString>\r
<Expand>\r
<Item Name="TagType">*(clang::TagType *)this</Item>\r
</Expand>\r
</Type>\r
+\r
<Type Name="clang::SubstTemplateTypeParmType">\r
- <DisplayString>{*(clang::Type *)this, view(BaseOnly)}: {*Replaced} => {CanonicalType}</DisplayString>\r
+ <DisplayString>{*Replaced,view(cpp)} <= {CanonicalType,view(cpp)}</DisplayString>\r
<Expand>\r
- <ExpandedItem>*(clang::Type *)this, view(BaseOnly)</ExpandedItem>\r
+ <ExpandedItem>*(clang::Type *)this, view(cmn)</ExpandedItem>\r
<Item Name="Replaced">*Replaced</Item>\r
</Expand>\r
</Type>\r
<Type Name="clang::TemplateTypeParmType">\r
- <DisplayString>{*TTPDecl}</DisplayString>\r
+ <DisplayString>typename {*TTPDecl,view(cpp)}</DisplayString>\r
</Type>\r
<Type Name="clang::QualType">\r
<!-- TODO: Qualifiers. Also, when VS2013 support is deprecated, change 4 to clang::TypeAlignmentInBits (not properly recognized by VS2013) -->\r
+ <DisplayString IncludeView="poly">{*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType,view(poly)}</DisplayString>\r
+ <DisplayString IncludeView="cpp">{*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType,view(cpp)}</DisplayString>\r
<DisplayString>{*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType}</DisplayString>\r
<Expand>\r
<Item Name="BaseType">*((clang::ExtQualsTypeCommonBase *)(((uintptr_t)Value.Value) & ~(uintptr_t)((1 << 4) - 1)))->BaseType</Item>\r
<Item Name="Kind">(clang::BuiltinType::Kind)BuiltinTypeBits.Kind</Item>\r
</Expand>\r
</Type>\r
- <Type Name="clang::NamedDecl">\r
- <DisplayString>{Name}</DisplayString>\r
- </Type>\r
+\r
<Type Name="clang::TemplateSpecializationType">\r
<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>\r
<DisplayString>{Template.Storage}</DisplayString>\r
</Type>\r
<Type Name="clang::IdentifierInfo">\r
- <DisplayString Condition="Entry != 0">({((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,s})</DisplayString>\r
+ <DisplayString Condition="Entry != 0">{((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,sb}</DisplayString>\r
<Expand>\r
<Item Condition="Entry != 0" Name="[Identifier]">((llvm::StringMapEntry<clang::IdentifierInfo *>*)Entry)+1,s</Item>\r
<Item Name="Token Kind">(clang::tok::TokenKind)TokenID</Item>\r
</Type>\r
<Type Name="clang::DeclarationName">\r
<DisplayString Condition="Ptr == 0">Empty</DisplayString>\r
+ <DisplayString Condition="(Ptr & PtrMask) == StoredIdentifier" IncludeView="cpp">{*(clang::IdentifierInfo *)(Ptr & ~PtrMask)}</DisplayString>\r
<DisplayString Condition="(Ptr & PtrMask) == StoredIdentifier">{{Identifier ({*(clang::IdentifierInfo *)(Ptr & ~PtrMask)})}}</DisplayString>\r
<DisplayString Condition="(Ptr & PtrMask) == StoredObjCZeroArgSelector">{{ObjC Zero Arg Selector (*{(clang::IdentifierInfo *)(Ptr & ~PtrMask)})}}</DisplayString>\r
<DisplayString Condition="(Ptr & PtrMask) == StoredObjCOneArgSelector">{{ObjC One Arg Selector (*{(clang::IdentifierInfo *)(Ptr & ~PtrMask)})}}</DisplayString>\r