From 2e30d326de4ba11a77d5ccd132c155ad72923c5e Mon Sep 17 00:00:00 2001 From: Trass3r Date: Tue, 8 Nov 2022 20:44:46 +0000 Subject: [PATCH] [Visualizers] Add natvis visualizers for various internal llvm classes Also improve DisplayStrings for array and string types. Differential Revision: https://reviews.llvm.org/D135685 --- llvm/utils/LLVMVisualizers/llvm.natvis | 163 ++++++++++++++++++++++++++------- 1 file changed, 129 insertions(+), 34 deletions(-) diff --git a/llvm/utils/LLVMVisualizers/llvm.natvis b/llvm/utils/LLVMVisualizers/llvm.natvis index 622ea77..2a34702 100644 --- a/llvm/utils/LLVMVisualizers/llvm.natvis +++ b/llvm/utils/LLVMVisualizers/llvm.natvis @@ -2,25 +2,16 @@ - - {((value_type*)BeginX)[0]}{*this,view(elt1)} - - , {((value_type*)BeginX)[1]}{*this,view(elt2)} - - , {((value_type*)BeginX)[2]}{*this,view(elt3)} - - , {((value_type*)BeginX)[3]}{*this,view(elt4)} - - , /* {Size - 4} more*/ empty - {{{*this,view(elt0)}}} + {(value_type*)BeginX,[Size]} + {Size} elements Uninitialized Size @@ -37,8 +28,9 @@ For later versions of Visual Studio, no setup is required. Cannot visualize APInts longer than 64 bits - empty - {{ size={Length} }} + {Data,[Length]} + {Length} elements + Uninitialized Length @@ -48,7 +40,7 @@ For later versions of Visual Studio, no setup is required. - {(const char*)BeginX,[Size] na} + {(const char*)BeginX,[Size]s8} (const char*)BeginX,[Size] Size @@ -61,12 +53,12 @@ For later versions of Visual Studio, no setup is required. - {First,[Last - First]s} + {First,[Last - First]s8} - + - {Data,[Length]s} - Data,[Length]s + {Data,[Length]s8} + Data,[Length]s8 Length @@ -121,7 +113,7 @@ For later versions of Visual Studio, no setup is required. - + {{ empty }} {{ head={Head} }} @@ -184,7 +176,7 @@ For later versions of Visual Studio, no setup is required. empty - ({this+1,s}, {second}) + ({this+1,s8}, {second}) this+1,s second @@ -194,7 +186,7 @@ For later versions of Visual Studio, no setup is required. {Data} - + None {Storage.value} @@ -227,24 +219,24 @@ For later versions of Visual Studio, no setup is required. (unsigned char *)Value.buffer,8 - + {{ big endian value = {*(unsigned char *)Value.buffer} }} - {{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) << 8) + {{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) << 8) | ($T1)(*((unsigned char *)Value.buffer+1))} }} - {{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) << 24) - | (($T1)(*((unsigned char *)Value.buffer+1)) << 16) - | (($T1)(*((unsigned char *)Value.buffer+2)) << 8) + {{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) << 24) + | (($T1)(*((unsigned char *)Value.buffer+1)) << 16) + | (($T1)(*((unsigned char *)Value.buffer+2)) << 8) | ($T1)(*((unsigned char *)Value.buffer+3))} }} - {{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) << 56) - | (($T1)(*((unsigned char *)Value.buffer+1)) << 48) - | (($T1)(*((unsigned char *)Value.buffer+2)) << 40) - | (($T1)(*((unsigned char *)Value.buffer+3)) << 32) - | (($T1)(*((unsigned char *)Value.buffer+4)) << 24) - | (($T1)(*((unsigned char *)Value.buffer+5)) << 16) - | (($T1)(*((unsigned char *)Value.buffer+6)) << 8) + {{ big endian value = {(($T1)(*(unsigned char *)Value.buffer) << 56) + | (($T1)(*((unsigned char *)Value.buffer+1)) << 48) + | (($T1)(*((unsigned char *)Value.buffer+2)) << 40) + | (($T1)(*((unsigned char *)Value.buffer+3)) << 32) + | (($T1)(*((unsigned char *)Value.buffer+4)) << 24) + | (($T1)(*((unsigned char *)Value.buffer+5)) << 16) + | (($T1)(*((unsigned char *)Value.buffer+6)) << 8) | ($T1)(*((unsigned char *)Value.buffer+7))} }} (unsigned char *)Value.buffer,1 @@ -304,4 +296,107 @@ For later versions of Visual Studio, no setup is required. Context + + + $(Type) {*Value} + + + + $(Type) {(llvm::ISD::NodeType)this->NodeType} + + + NumOperands + OperandList + + + + + + i{Val.BitWidth} {Val.VAL} + + + + {IDAndSubclassData >> 8}bit integer type + + + + $(Type) {*VTy} {this->getName()} {SubclassData} + $(Type) {*VTy} anon {SubclassData} + + (Instruction*)this + (User*)this + + UseList + Next + Prev.Value & 3 == 3 ? (User*)(this + 1) : (User*)(this + 2) + + + + + + + Val + + + + + + + $(Type) {*VTy} {this->getName()} {SubclassData} + $(Type) {*VTy} anon {SubclassData} + + (Value*)this,nd + *VTy + + NumUserOperands + (llvm::Use*)this - NumUserOperands + + + NumUserOperands + *((llvm::Use**)this - 1) + + + + + + {getOpcodeName(SubclassID - InstructionVal)} + + (User*)this,nd + + + + + {this->getName()} {(LinkageTypes)Linkage} {(VisibilityTypes)Visibility} {(DLLStorageClassTypes)DllStorageClass} {(llvm::GlobalValue::ThreadLocalMode) ThreadLocal} + + + + + + + this + Next + this + + + + + + + pImpl + + + + + {ModuleID,s8} {TargetTriple} + + + + $(Type) {PassID} {Kind} + -- 2.7.4