From 958dbe1e34afd090e8df3ef93b06d6c5f00f12cc Mon Sep 17 00:00:00 2001 From: Nikola Smiljanic Date: Fri, 7 Feb 2014 22:57:20 +0000 Subject: [PATCH] Improve existing visualizers by: - Properly displaying non null terminated StringRef. - Auto expanding pointer types. - Displaying real type names for PointerUnions. - Using "size" and "capacity" across all containers. - Simplifying code where possible. llvm-svn: 201004 --- llvm/utils/llvm.natvis | 104 ++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 58 deletions(-) diff --git a/llvm/utils/llvm.natvis b/llvm/utils/llvm.natvis index 6b4ef83..373bf96 100644 --- a/llvm/utils/llvm.natvis +++ b/llvm/utils/llvm.natvis @@ -6,22 +6,10 @@ Put this file into "%USERPROFILE%\Documents\Visual Studio 2012\Visualizers" or create a symbolic link so it updates automatically. --> - - empty - {{ size={($T1*)EndX - ($T1*)BeginX} }} - - ($T1*)EndX - ($T1*)BeginX - ($T1*)CapacityX - ($T1*)BeginX - - ($T1*)EndX - ($T1*)BeginX - ($T1*)BeginX - - - empty - [{($T1*)EndX - ($T1*)BeginX}] + {{ size={($T1*)EndX - ($T1*)BeginX} }} ($T1*)EndX - ($T1*)BeginX ($T1*)CapacityX - ($T1*)BeginX @@ -46,10 +34,10 @@ or create a symbolic link so it updates automatically. - [{Length}] {Data,s} - Data,s + {Data,[Length]s} + Data,[Length]s - Length + Length Length Data @@ -58,43 +46,43 @@ or create a symbolic link so it updates automatically. - {Value & PointerBitMask} [{(Value >> IntShift) & IntMask}] + {(void*)(Value & PointerBitMask)} [{($T3)((Value >> IntShift) & IntMask)}] - Value & PointerBitMask - (Value >> IntShift) & IntMask + ($T1*)(Value & PointerBitMask) + ($T3)((Value >> IntShift) & IntMask) - [P1] {($T1)(Val.Value & Val.PointerBitMask)} - [P2] {($T2)(Val.Value & Val.PointerBitMask)} + {"$T1", s8b} {(void*)(Val.Value & Val.PointerBitMask)} + {"$T2", s8b} {(void*)(Val.Value & Val.PointerBitMask)} - ($T1)(Val.Value & Val.PointerBitMask) - ($T2)(Val.Value & Val.PointerBitMask) + ($T1)(Val.Value & Val.PointerBitMask) + ($T2)(Val.Value & Val.PointerBitMask) - [P1] {($T1)((Val.Val.Value >> 2) << 2)} - [P2] {($T2)((Val.Val.Value >> 2) << 2)} - [P3] {($T3)((Val.Val.Value >> 2) << 2)} + {"$T1", s8b} {(void*)((Val.Val.Value >> 2) << 2)} + {"$T2", s8b} {(void*)((Val.Val.Value >> 2) << 2)} + {"$T3", s8b} {(void*)((Val.Val.Value >> 2) << 2)} - ($T1)((Val.Val.Value >> 2) << 2) - ($T2)((Val.Val.Value >> 2) << 2) - ($T3)((Val.Val.Value >> 2) << 2) + ($T1)((Val.Val.Value >> 2) << 2) + ($T2)((Val.Val.Value >> 2) << 2) + ($T3)((Val.Val.Value >> 2) << 2) - [P1] {($T1)((Val.Val.Value >> 2) << 2)} - [P2] {($T2)((Val.Val.Value >> 2) << 2)} - [P3] {($T3)((Val.Val.Value >> 2) << 2)} - [P4] {($T4)((Val.Val.Value >> 2) << 2)} + {"$T1", s8b} {(void*)((Val.Val.Value >> 2) << 2)} + {"$T2", s8b} {(void*)((Val.Val.Value >> 2) << 2)} + {"$T3", s8b} {(void*)((Val.Val.Value >> 2) << 2)} + {"$T4", s8b} {(void*)((Val.Val.Value >> 2) << 2)} - ($T1)((Val.Val.Value >> 2) << 2) - ($T2)((Val.Val.Value >> 2) << 2) - ($T3)((Val.Val.Value >> 2) << 2) - ($T4)((Val.Val.Value >> 2) << 2) + ($T1)((Val.Val.Value >> 2) << 2) + ($T2)((Val.Val.Value >> 2) << 2) + ($T3)((Val.Val.Value >> 2) << 2) + ($T4)((Val.Val.Value >> 2) << 2) @@ -116,7 +104,7 @@ or create a symbolic link so it updates automatically. RefPtr [{Obj->ref_cnt} refs] {*Obj} Obj->ref_cnt - Obj + Obj @@ -124,29 +112,29 @@ or create a symbolic link so it updates automatically. empty OwningPtr {*Ptr} - Ptr + Ptr - {{ [Small Mode] elements={NumElements}, arraySize={CurArraySize} }} - {{ [Big Mode] elements={NumElements}, arraySize={CurArraySize} }} + {{ [Small Mode] size={NumElements}, capacity={CurArraySize} }} + {{ [Big Mode] size={NumElements}, capacity={CurArraySize} }} - NumElements - CurArraySize - - CurArraySize + 1 - ($T1*)&CurArray[$i] - + NumElements + CurArraySize + + CurArraySize + ($T1*)CurArray + empty - {{ entries={NumEntries}, buckets={NumBuckets} }} + {{ size={NumEntries}, buckets={NumBuckets} }} - NumEntries - NumBuckets + NumEntries + NumBuckets NumBuckets Buckets @@ -155,22 +143,22 @@ or create a symbolic link so it updates automatically. - {{ NumBuckets={NumBuckets}, ItemSize={ItemSize} }} + {{ size={ItemSize}, buckets={NumBuckets} }} - NumBuckets - ItemSize - + ItemSize + NumBuckets + NumBuckets - (llvm::StringMapEntry<$T1>*)TheTable[$i] - + (MapEntryTy**)TheTable + empty - ({((llvm::StringMapEntry<$T1>*)this)+1,s}, {second}) + ({this+1,s}, {second}) - ((llvm::StringMapEntry<$T1>*)this)+1,s + this+1,s second -- 2.7.4