[PATCH] D18498: Auto-install Clang Visual Studio visualizers for VS2015 and up

Mike Spertus via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 27 01:28:25 PDT 2016


mspertus created this revision.
mspertus added reviewers: ariccio, aaron.ballman, zturner.
mspertus added a subscriber: cfe-commits.

This change uses the [[ https://blogs.msdn.microsoft.com/vcblog/2014/06/12/project-support-for-natvis/ | Project Support for Natvis ]] added in VS2015 to eliminate the need to manually install natvis files. D18497 is a corresponding diff for LLVM. I want to acknowledge ariccio for extensive advice on this change.

http://reviews.llvm.org/D18498

Files:
  CMakeLists.txt
  utils/clang.natvis
  www/hacking.html

Index: www/hacking.html
===================================================================
--- www/hacking.html
+++ www/hacking.html
@@ -103,9 +103,11 @@
     <a href="http://llvm.org/svn/llvm-project/cfe/trunk/utils/clang.natvis">
       <tt>utils/clang.natvis</tt></a> provide debugger visualizers 
       that make debugging of more complex data types much easier.</p>
-  <p>Put the files into 
-    <tt>%USERPROFILE%\Documents\Visual Studio 2012\Visualizers</tt> or 
+  <p>For Visual Studio 2013 only, put the files into 
+    <tt>%USERPROFILE%\Documents\Visual Studio 2013\Visualizers</tt> or 
     create a symbolic link so they update automatically.</p>
+  <p>For later versions of Visual Studio, no installation is required.
+    Note also that later versions of Visual Studio also display better visualizations.</p>
 
   <!--=====================================================================-->
   <h2 id="testing">Testing</h2>
Index: utils/clang.natvis
===================================================================
--- utils/clang.natvis
+++ utils/clang.natvis
@@ -2,9 +2,10 @@
 <!--
 Visual Studio Native Debugging Visualizers for LLVM
 
-Put this file into "%USERPROFILE%\Documents\Visual Studio 20xx\Visualizers"
-or create a symbolic link so it updates automatically.
--->
+For Visual Studio 2013 only, put this file into 
+"%USERPROFILE%\Documents\Visual Studio 2013\Visualizers" or create a symbolic link so it updates automatically.
+
+For later versions of Visual Studio, no setup is required-->
 <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
 
   <Type Name="clang::Type">
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -817,3 +817,11 @@
     ExternalProject_Add_StepTargets(${NEXT_CLANG_STAGE} ${target})
   endforeach()
 endif()
+
+# Do this by hand instead of using add_llvm_utilities(), which
+# tries to create a corresponding executable, which we don't want
+if(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION)
+  set( CLANG_VISUALIZERS utils/clang.natvis)
+  add_custom_target( ClangVisualizers SOURCES ${CLANG_VISUALIZERS})
+  set_target_properties(ClangVisualizers PROPERTIES FOLDER "Utils")
+endif()
\ No newline at end of file


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18498.51731.patch
Type: text/x-patch
Size: 2280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160327/120fcf8c/attachment.bin>


More information about the cfe-commits mailing list