summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/utils/clang.natvis44
-rw-r--r--clang/utils/clangVisualizers.txt391
2 files changed, 44 insertions, 391 deletions
diff --git a/clang/utils/clang.natvis b/clang/utils/clang.natvis
new file mode 100644
index 00000000000..1f956f19771
--- /dev/null
+++ b/clang/utils/clang.natvis
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Visual Studio 2012 Native Debugging Visualizers for LLVM
+
+Put this file into "%USERPROFILE%\Documents\Visual Studio 2012\Visualizers"
+or create a symbolic link so it updates automatically.
+-->
+<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
+ <Type Name="clang::IdentifierInfo">
+ <DisplayString Condition="Entry != 0">({((llvm::StringMapEntry&lt;clang::IdentifierInfo *&gt;*)Entry)+1,s})</DisplayString>
+ <Expand>
+ <Item Condition="Entry != 0" Name="[Identifier]">((llvm::StringMapEntry&lt;clang::IdentifierInfo *&gt;*)Entry)+1,s</Item>
+ <Item Name="Token Kind">(clang::tok::TokenKind)TokenID</Item>
+ </Expand>
+ </Type>
+ <Type Name="clang::DeclarationName">
+ <DisplayString Condition="Ptr == 0">Empty</DisplayString>
+ <DisplayString Condition="(Ptr &amp; PtrMask) == StoredIdentifier">{{Identifier ({(clang::IdentifierInfo *)(Ptr &amp; ~PtrMask)})}}</DisplayString>
+ <DisplayString Condition="(Ptr &amp; PtrMask) == StoredObjCZeroArgSelector">{{ObjC Zero Arg Selector ({(clang::IdentifierInfo *)(Ptr &amp; ~PtrMask)})}}</DisplayString>
+ <DisplayString Condition="(Ptr &amp; PtrMask) == StoredObjCOneArgSelector">{{ObjC One Arg Selector ({(clang::IdentifierInfo *)(Ptr &amp; ~PtrMask)})}}</DisplayString>
+ <DisplayString Condition="(Ptr &amp; PtrMask) == StoredDeclarationNameExtra">{{Extra ({(clang::DeclarationNameExtra::ExtraKind)((clang::DeclarationNameExtra *)(Ptr &amp; ~PtrMask))-&gt;ExtraKindOrNumArgs})}}</DisplayString>
+ <Expand>
+ <Item Condition="(Ptr &amp; PtrMask) == StoredIdentifier" Name="[Identifier]">(clang::IdentifierInfo *)(Ptr &amp; ~PtrMask)</Item>
+ <Item Condition="(Ptr &amp; PtrMask) == StoredObjCZeroArgSelector" Name="[ObjC Zero Arg Selector]">(clang::IdentifierInfo *)(Ptr &amp; ~PtrMask)</Item>
+ <Item Condition="(Ptr &amp; PtrMask) == StoredObjCOneArgSelector" Name="[ObjC One Arg Selector]">(clang::IdentifierInfo *)(Ptr &amp; ~PtrMask)</Item>
+ <Item Condition="(Ptr &amp; PtrMask) == StoredDeclarationNameExtra" Name="[Extra]">(clang::DeclarationNameExtra::ExtraKind)((clang::DeclarationNameExtra *)(Ptr &amp; ~PtrMask))-&gt;ExtraKindOrNumArgs</Item>
+ </Expand>
+ </Type>
+ <Type Name="clang::Token">
+ <DisplayString>{(clang::tok::TokenKind)Kind}</DisplayString>
+ </Type>
+ <Type Name="clang::DeclSpec">
+ <DisplayString>[{(clang::DeclSpec::SCS)StorageClassSpec}], [{(clang::TypeSpecifierType)TypeSpecType}]</DisplayString>
+ </Type>
+ <Type Name="clang::PragmaHandler">
+ <DisplayString>{Name,s}</DisplayString>
+ </Type>
+ <Type Name="clang::FileEntry">
+ <DisplayString>{Name,s}</DisplayString>
+ </Type>
+ <Type Name="clang::DirectoryEntry">
+ <DisplayString>{Name,s}</DisplayString>
+ </Type>
+</AutoVisualizer>
diff --git a/clang/utils/clangVisualizers.txt b/clang/utils/clangVisualizers.txt
deleted file mode 100644
index 8019b9cc16e..00000000000
--- a/clang/utils/clangVisualizers.txt
+++ /dev/null
@@ -1,391 +0,0 @@
-
-[Visualizer]
-
-llvm::SmallVector<*,*>{
- preview (
- #if ((($T1*)$e.EndX - ($T1*)$e.BeginX) == 0) ( "empty" )
- #else (
- #(
- "[",
- ($T1*)$e.EndX - ($T1*)$e.BeginX,
- "](",
- #array(
- expr: (($T1*)$e.BeginX)[$i],
- size: ($T1*)$e.EndX - ($T1*)$e.BeginX
- ),
- ")"
- )
- )
- )
-
- children (
- #(
- #([size] : ($T1*)$e.EndX - ($T1*)$e.BeginX),
- #([capacity] : ($T1*)$e.CapacityX - ($T1*)$e.BeginX),
- #array(
- expr: (($T1*)$e.BeginX)[$i],
- size: ($T1*)$e.EndX - ($T1*)$e.BeginX
- )
- )
- )
-}
-
-llvm::SmallVectorImpl<*>{
- preview (
- #if ((($T1*)$e.EndX - ($T1*)$e.BeginX) == 0) ( "empty" )
- #else (
- #(
- "[",
- ($T1*)$e.EndX - ($T1*)$e.BeginX,
- "](",
- #array(
- expr: (($T1*)$e.BeginX)[$i],
- size: ($T1*)$e.EndX - ($T1*)$e.BeginX
- ),
- ")"
- )
- )
- )
-
- children (
- #(
- #([size] : ($T1*)$e.EndX - ($T1*)$e.BeginX),
- #([capacity] : ($T1*)$e.CapacityX - ($T1*)$e.BeginX),
- #array(
- expr: (($T1*)$e.BeginX)[$i],
- size: ($T1*)$e.EndX - ($T1*)$e.BeginX
- )
- )
- )
-}
-
-llvm::SmallString<*>{
- preview ([$e.BeginX,s])
- stringview ([$e.BeginX,sb])
-}
-
-llvm::StringRef{
- preview ([$e.Data,s])
- stringview ([$e.Data,sb])
-
- children (
- #(
- #([size] : $e.Length),
- #array(expr: $e.Data[$i], size: $e.Length)
- )
- )
-}
-
-clang::Token{
- preview((clang::tok::TokenKind)(int)$e.Kind)
-}
-
-llvm::PointerIntPair<*,*,*,*>{
- preview (
- #(
- ($T1*)($e.Value & $e.PointerBitMask),
- " [",
- ($T3)(($e.Value >> $e.IntShift) & $e.IntMask),
- "]"
- )
- )
-
- children (
- #(
- #([raw members] : [$e,!]),
- #([ptr] : ($T1*)($e.Value & $e.PointerBitMask)),
- #([int] : ($T3)($e.Value >> $e.IntShift) & $e.IntMask)
- )
- )
-}
-
-llvm::PointerUnion<*,*>{
- preview (
- #if ((($e.Val.Value >> $e.Val.IntShift) & $e.Val.IntMask) == 0) ( "PT1" )
- #else ( "PT2" )
- )
-
- children (
- #(
- #([raw members] : [$e,!]),
- #if ((($e.Val.Value >> $e.Val.IntShift) & $e.Val.IntMask) == 0) (
- #([ptr] : ($T1)($e.Val.Value & $e.Val.PointerBitMask))
- ) #else (
- #([ptr] : ($T2)($e.Val.Value & $e.Val.PointerBitMask))
- )
- )
- )
-}
-
-llvm::PointerUnion3<*,*,*>{
- preview (
- #if (($e.Val.Val.Value & 0x2) == 2) ( "PT2" )
- #elif (($e.Val.Val.Value & 0x1) == 1) ( "PT3" )
- #else ( "PT1" )
- )
-
- children (
- #(
- #if (($e.Val.Val.Value & 0x2) == 2) (
- #([ptr] : ($T2)(($e.Val.Val.Value >> 2) << 2))
- ) #elif (($e.Val.Val.Value & 0x1) == 1) (
- #([ptr] : ($T3)(($e.Val.Val.Value >> 2) << 2))
- ) #else (
- #([ptr] : ($T1)(($e.Val.Val.Value >> 2) << 2))
- )
- )
- )
-}
-
-llvm::PointerUnion4<*,*,*,*>{
- preview (
- #if (($e.Val.Val.Value & 0x3) == 3) ( "PT4" )
- #elif (($e.Val.Val.Value & 0x2) == 2) ( "PT2" )
- #elif (($e.Val.Val.Value & 0x1) == 1) ( "PT3" )
- #else ( "PT1" )
- )
-
- children (
- #(
- #if (($e.Val.Val.Value & 0x3) == 3) (
- #([ptr] : ($T4)(($e.Val.Val.Value >> 2) << 2))
- ) #elif (($e.Val.Val.Value & 0x2) == 2) (
- #([ptr] : ($T2)(($e.Val.Val.Value >> 2) << 2))
- ) #elif (($e.Val.Val.Value & 0x1) == 1) (
- #([ptr] : ($T3)(($e.Val.Val.Value >> 2) << 2))
- ) #else (
- #([ptr] : ($T1)(($e.Val.Val.Value >> 2) << 2))
- )
- )
- )
-}
-
-llvm::IntrusiveRefCntPtr<*>{
- preview (
- #if ($e.Obj == 0) ( "empty" )
- #else (
- #(
- "[RefCnt=", $e.Obj->ref_cnt,
- ", ",
- "Obj=", $e.Obj,
- "]"
- )
- )
- )
-
- children (
- #if ($e.Obj == 0) ( #array(expr: 0, size: 0) )
- #else (
- #(
- #(RefCnt : $e.Obj->ref_cnt),
- #(Obj : $e.Obj)
- )
- )
- )
-}
-
-llvm::OwningPtr<*>{
- preview (
- #if ($e.Ptr == 0) ( "empty" )
- #else ( $e.Ptr )
- )
-
- children (
- #if ($e.Ptr == 0) ( #array(expr: 0, size: 0) )
- #else ( #(Ptr : $e.Ptr) )
- )
-}
-
-llvm::SmallPtrSet<*,*>{
- preview (
- #(
- #if (($e.CurArray) == ($e.SmallArray)) ( "[Small Mode] " )
- #else ( "[Big Mode] " ),
- "NumElements=", $e.NumElements,
- " CurArraySize=", $e.CurArraySize
- )
- )
-
- children (
- #(
- #([raw members] : [$c,!]),
- #(NumElements : $e.NumElements),
- #(CurArraySize : $e.CurArraySize),
- #array(
- expr: $e.CurArray[$i],
- size: $e.CurArraySize + 1
- ) : ($T1*)&$e
- )
- )
-}
-
-llvm::DenseMap<*,*,*>{
- preview (
- #if ($e.NumEntries == 0) ( "empty" )
- #else (
- #(
- "[NumEntries=", $e.NumEntries,
- " NumBuckets=", $e.NumBuckets,
- "]"
- )
- )
- )
-
- children (
- #if ($e.NumEntries == 0) ( #array(expr: 0, size: 0) )
- #else (
- #(
- #([raw members] : [$c,!]),
- #(NumEntries : $e.NumEntries),
- #(NumBuckets : $e.NumBuckets),
- #array(
- expr: $e.Buckets[$i],
- size: $e.NumBuckets
- )
- )
- )
- )
-}
-
-llvm::StringMap<*,*>{
- preview (
- #(
- "[NumBuckets=", $e.NumBuckets,
- " ItemSize=", $e.ItemSize,
- "]"
- )
- )
-
- children (
- #(
- #([raw members] : [$c,!]),
- #(NumBuckets : $e.NumBuckets),
- #(ItemSize : $e.ItemSize),
- #array(
- expr: $e.TheTable[$i],
- size: $e.NumBuckets,
- ) : (llvm::StringMapEntry<$T1>*)&$e
- )
- )
-}
-
-llvm::StringMapEntry<*>{
- preview (
- #if ($e.StrLen == 0) ( "empty" )
- #else ( #(Entry : $e.second) )
- )
-
- children (
- #if ($e.StrLen == 0) ( "empty" )
- #else ( #(Entry : $e.second) )
- )
-}
-
-clang::DirectoryEntry|clang::FileEntry|clang::PragmaHandler{
- preview ( [$e.Name,s] )
- children (
- #(
- #([raw members] : [$c,!]),
- #(Name : [$e.Name,s])
- )
- )
-}
-
-clang::DeclarationName{
- preview (
- ; enum values from clang::DeclarationName::StoredNameKind
- #if ($e.Ptr == 0) (
- "empty"
- ) #elif (($e.Ptr & $e.PtrMask) == $e.StoredIdentifier) (
- #else ( #("Identifier, ", (clang::IdentifierInfo*)($e.Ptr & ~$e.PtrMask)) )
- ) #elif (($e.Ptr & $e.PtrMask) == $e.StoredObjCZeroArgSelector) (
- #("ZeroArgSelector, ", (clang::IdentifierInfo*)($e.Ptr & ~$e.PtrMask))
- ) #elif (($e.Ptr & $e.PtrMask) == $e.StoredObjCOneArgSelector) (
- #("OneArgSelector, ", (clang::IdentifierInfo*)($e.Ptr & ~$e.PtrMask))
- ) #elif (($e.Ptr & $e.PtrMask) == $e.StoredDeclarationNameExtra) (
- #switch (((clang::DeclarationNameExtra*)($e.Ptr & ~$e.PtrMask)).ExtraKindOrNumArgs)
- #case 0 ( ;DeclarationNameExtra::CXXConstructor
- #("CXXConstructorName, ", (clang::CXXSpecialName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 1 ( ;DeclarationNameExtra::CXXDestructor
- #("CXXDestructorName, ", (clang::CXXSpecialName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 2 ( ;DeclarationNameExtra::CXXConversionFunction
- #("CXXConversionFunctionName, ", (clang::CXXSpecialName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 46 ( ;DeclarationNameExtra::CXXLiteralOperator
- #("CXXLiteralOperatorName, ", (clang::CXXLiteralOperatorIdName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 47 ( ;DeclarationNameExtra::CXXUsingDirective
- #("CXXUsingDirective") ;TODO What to add here?
- )
- #default (
- #if (((clang::DeclarationNameExtra*)($e.Ptr & ~$e.PtrMask)).ExtraKindOrNumArgs < 47) (
- #("CXXOperatorName, ", (clang::CXXOperatorIdName*)($e.Ptr & ~$e.PtrMask))
- ) #else (
- #("ObjCMultiArgSelector, ", (clang::MultiKeywordSelector*)($e.Ptr & ~$e.PtrMask))
- )
- )
- )
- )
-
- children (
- #(
- ; enum values from clang::DeclarationName::StoredNameKind
- #if ($e.Ptr == 0) (
- #array( expr: 0, size: 0 )
- ) #else (
- #(
- #([raw members] : [$e.Ptr,!]),
- if (($e.Ptr & $e.PtrMask) == $e.StoredIdentifier) (
- #(Ptr : (clang::IdentifierInfo*)($e.Ptr & ~$e.PtrMask))
- ) #elif (($e.Ptr & $e.PtrMask) == $e.StoredObjCZeroArgSelector) (
- #(Ptr : (clang::IdentifierInfo*)($e.Ptr & ~$e.PtrMask))
- ) #elif (($e.Ptr & $e.PtrMask) == $e.StoredObjCOneArgSelector) (
- #(Ptr : (clang::IdentifierInfo*)($e.Ptr & ~$e.PtrMask))
- ) #elif (($e.Ptr & $e.PtrMask) == $e.StoredDeclarationNameExtra) (
- #switch (((clang::DeclarationNameExtra*)($e.Ptr & ~$e.PtrMask)).ExtraKindOrNumArgs)
- #case 0 ( ;DeclarationNameExtra::CXXConstructor
- #(Ptr : (clang::CXXSpecialName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 1 ( ;DeclarationNameExtra::CXXDestructor
- #(Ptr : (clang::CXXSpecialName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 2 ( ;DeclarationNameExtra::CXXConversionFunction
- #(Ptr : (clang::CXXSpecialName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 46 ( ;DeclarationNameExtra::CXXLiteralOperator
- #(Ptr : (clang::CXXLiteralOperatorIdName*)($e.Ptr & ~$e.PtrMask))
- )
- #case 47 ( ;DeclarationNameExtra::CXXUsingDirective
- #(Ptr : $e.Ptr) ;TODO What to add here?
- )
- #default (
- #if (((clang::DeclarationNameExtra*)($e.Ptr & ~$e.PtrMask)).ExtraKindOrNumArgs < 47) (
- #(Ptr : (CXXOperatorIdName*)($e.Ptr & ~$e.PtrMask))
- ) #else (
- #(Ptr : (clang::MultiKeywordSelector*)($e.Ptr & ~$e.PtrMask))
- )
- )
- )
- )
- )
- )
- )
-}
-
-clang::DeclSpec{
- preview (
- #(
- "[",
- (clang::DeclSpec::SCS)$e.StorageClassSpec,
- ", ",
- (clang::TypeSpecifierType)$e.TypeSpecType,
- "]"
- )
- )
-}
-
-llvm::Triple{
- preview ( $e.Data )
-}
OpenPOWER on IntegriCloud