[llvm] 4a12589 - Fix NATVIS for llvm::PointerIntPair

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 25 06:21:13 PDT 2024


Author: Aaron Ballman
Date: 2024-04-25T09:18:40-04:00
New Revision: 4a12589de1388885d0f198605de3b1fbc0f25100

URL: https://github.com/llvm/llvm-project/commit/4a12589de1388885d0f198605de3b1fbc0f25100
DIFF: https://github.com/llvm/llvm-project/commit/4a12589de1388885d0f198605de3b1fbc0f25100.diff

LOG: Fix NATVIS for llvm::PointerIntPair

We don't need to cast to the type of the template argument because it
is always an unsigned number. When passed an enumeration type, MSVC's
debug formatter would get confused, so this fixes issues like looking
at a llvm::PointerIntPair<const ContentCache *, 3, CharacteristicKind>
such as what's used in SrcMgr::FileInfo.

Added: 
    

Modified: 
    llvm/utils/LLVMVisualizers/llvm.natvis

Removed: 
    


################################################################################
diff  --git a/llvm/utils/LLVMVisualizers/llvm.natvis b/llvm/utils/LLVMVisualizers/llvm.natvis
index 0fc50f79466a45..d83ae8013c51e2 100644
--- a/llvm/utils/LLVMVisualizers/llvm.natvis
+++ b/llvm/utils/LLVMVisualizers/llvm.natvis
@@ -92,11 +92,11 @@ For later versions of Visual Studio, no setup is required.
 
   <Type Name="llvm::PointerIntPair<*>">
     <DisplayString IncludeView="ptr">{($T1)(*(intptr_t *)Value.Data & $T5::PointerBitMask)}</DisplayString>
-    <DisplayString IncludeView="int">{($T3)((*(intptr_t *)Value.Data >> $T5::IntShift) & $T5::IntMask)}</DisplayString>
-    <DisplayString>{$T5::IntMask}: {($T1)(*(intptr_t *)Value.Data & $T5::PointerBitMask)} [{($T3)((*(intptr_t *)Value.Data >> $T5::IntShift) & $T5::IntMask)}]</DisplayString>
+    <DisplayString IncludeView="int">{((*(intptr_t *)Value.Data >> $T5::IntShift) & $T5::IntMask)}</DisplayString>
+    <DisplayString>{$T5::IntMask}: {($T1)(*(intptr_t *)Value.Data & $T5::PointerBitMask)} [{((*(intptr_t *)Value.Data >> $T5::IntShift) & $T5::IntMask)}]</DisplayString>
     <Expand>
       <Item Name="[ptr]">($T1)(*(intptr_t *)Value.Data & $T5::PointerBitMask)</Item>
-      <Item Name="[int]">($T3)((*(intptr_t *)Value.Data >> $T5::IntShift) & $T5::IntMask)</Item>
+      <Item Name="[int]">((*(intptr_t *)Value.Data >> $T5::IntShift) & $T5::IntMask)</Item>
     </Expand>
   </Type>
   <!-- PointerUnion types -->


        


More information about the llvm-commits mailing list