From d5fba0c8a6e46d722b7bef9658353a309ecef894 Mon Sep 17 00:00:00 2001 From: Mike Spertus Date: Mon, 13 Jun 2016 01:43:14 +0000 Subject: [PATCH] Improved Visual Studio 2015 visualization of SmallVectorImpl When visualizing small vectors in VS2015, show the first few elements in the DisplayString instead of the size. For example, a SmallVector of DeclAccessPair will visualize like {public typename ...Ts, public typename U} The visualization in VS2013 remains the same because we continue to include the old visualizer with a lower-than-default priority of MediumLow, and the same SmallVector would continue to be visualized as {size = 2} llvm-svn: 272525 --- utils/LLVMVisualizers/llvm.natvis | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/utils/LLVMVisualizers/llvm.natvis b/utils/LLVMVisualizers/llvm.natvis index 6d37fa01453..6d8475a1c72 100644 --- a/utils/LLVMVisualizers/llvm.natvis +++ b/utils/LLVMVisualizers/llvm.natvis @@ -8,8 +8,8 @@ For Visual Studio 2013 only, put this file into For later versions of Visual Studio, no setup is required. --> - - + + empty {{ size={($T1*)EndX - ($T1*)BeginX} }} @@ -21,6 +21,29 @@ For later versions of Visual Studio, no setup is required. + + + + {(($T1*)BeginX)[0]}{*this,view(elt1)} + + , {(($T1*)BeginX)[1]}{*this,view(elt2)} + + , {(($T1*)BeginX)[2]}{*this,view(elt3)} + + , {(($T1*)BeginX)[2]}{*this,view(elt4)} + + , /* {(($T1*)EndX - ($T1*)BeginX) - 4} more*/ + empty + {{{*this,view(elt0)}}} + + ($T1*)EndX - ($T1*)BeginX + ($T1*)CapacityX - ($T1*)BeginX + + ($T1*)EndX - ($T1*)BeginX + ($T1*)BeginX + + + empty {{ size={Length} }}