[llvm] r350250 - Fix MSVC PointerUnion visualizer
Mike Spertus via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 2 11:26:50 PST 2019
Author: mps
Date: Wed Jan 2 11:26:50 2019
New Revision: 350250
URL: http://llvm.org/viewvc/llvm-project?rev=350250&view=rev
Log:
Fix MSVC PointerUnion visualizer
Differential Revision: https://reviews.llvm.org/D56186
Modified:
llvm/trunk/include/llvm/ADT/PointerIntPair.h
llvm/trunk/utils/LLVMVisualizers/llvm.natvis
Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=350250&r1=350249&r2=350250&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original)
+++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Wed Jan 2 11:26:50 2019
@@ -42,6 +42,8 @@ template <typename PointerTy, unsigned I
typename PtrTraits = PointerLikeTypeTraits<PointerTy>,
typename Info = PointerIntPairInfo<PointerTy, IntBits, PtrTraits>>
class PointerIntPair {
+ // Used by MSVC visualizer and generally helpful for debugging/visualizing.
+ using InfoTy = Info;
intptr_t Value = 0;
public:
Modified: llvm/trunk/utils/LLVMVisualizers/llvm.natvis
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/LLVMVisualizers/llvm.natvis?rev=350250&r1=350249&r2=350250&view=diff
==============================================================================
--- llvm/trunk/utils/LLVMVisualizers/llvm.natvis (original)
+++ llvm/trunk/utils/LLVMVisualizers/llvm.natvis Wed Jan 2 11:26:50 2019
@@ -35,6 +35,7 @@ For later versions of Visual Studio, no
<DisplayString IncludeView ="elt4">, /* {Size - 4} more*/ </DisplayString>
<DisplayString Condition="Size == 0">empty</DisplayString>
<DisplayString Condition="Size != 0">{{{*this,view(elt0)}}}</DisplayString>
+ <DisplayString>Uninitialized</DisplayString>
<Expand>
<Item Name="[size]">Size</Item>
<Item Name="[capacity]">Capacity</Item>
@@ -93,11 +94,13 @@ For later versions of Visual Studio, no
</Type>
<Type Name="llvm::PointerUnion<*,*>">
- <DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) == 0">{"$T1", s8b}: {($T1)(Val.Value & Val.PointerBitMask)}</DisplayString>
- <DisplayString Condition="((Val.Value >> Val.IntShift) & Val.IntMask) != 0">{"$T2", s8b}: {($T2)(Val.Value & Val.PointerBitMask)}</DisplayString>
+ <DisplayString Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) == 0">{"$T1", s8b}: {($T1)(Val.Value & ValTy::InfoTy::PointerBitMask)}</DisplayString>
+ <DisplayString Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) != 0">{"$T2", s8b}: {($T2)(Val.Value & ValTy::InfoTy::PointerBitMask)}</DisplayString>
<Expand>
- <ExpandedItem Condition="((Val.Value >> Val.IntShift) & Val.IntMask) == 0">($T1)(Val.Value & Val.PointerBitMask)</ExpandedItem>
- <ExpandedItem Condition="((Val.Value >> Val.IntShift) & Val.IntMask) != 0">($T2)(Val.Value & Val.PointerBitMask)</ExpandedItem>
+ <Item Name="[Holds]" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) == 0">"$T1", s8b</Item>
+ <Item Name="[Ptr]" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) == 0">($T1)(Val.Value & ValTy::InfoTy::PointerBitMask)</Item>
+ <Item Name="[Holds]" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) != 0">"$T2", s8b</Item>
+ <Item Name="[Ptr]" Condition="((Val.Value >> ValTy::InfoTy::IntShift) & ValTy::InfoTy::IntMask) != 0">($T2)(Val.Value & ValTy::InfoTy::PointerBitMask)</Item>
</Expand>
</Type>
More information about the llvm-commits
mailing list