[PATCH] Add some natvis visualizers for llvm::Value, llvm::Type, and llvm::Instruction
Zachary Turner
zturner at google.com
Thu Jun 26 14:01:07 PDT 2014
Added some more for llvm::Instruction to display the Opcode.
http://reviews.llvm.org/D4316
Files:
utils/llvm.natvis
Index: utils/llvm.natvis
===================================================================
--- utils/llvm.natvis
+++ utils/llvm.natvis
@@ -166,4 +166,75 @@
<Item Name="[underlying]" Condition="hasVal">*(($T1 *)(unsigned char *)storage.buffer)</Item>
</Expand>
</Type>
+
+ <Type Name="llvm::Value">
+ <DisplayString Condition="Name != 0">{Name}</DisplayString>
+ <DisplayString>{{anonymous value}}</DisplayString>
+ <Expand>
+ <Item Name="VTy">VTy</Item>
+ <Item Name="UseList">UseList</Item>
+ <Item Name="Name">Name</Item>
+ <Item Name="SubclassID">(llvm::Value::ValueTy)SubclassID</Item>
+ <Item Name="HasValueHandle">(bool)HasValueHandle</Item>
+ <Item Name="SubclassOptionalData">SubclassOptionalData</Item>
+ <Item Name="SubclassData">SubclassData</Item>
+ </Expand>
+ </Type>
+
+ <Type Name="llvm::Type">
+ <DisplayString>{(llvm::Type::TypeID)(IDAndSubclassData & 255)}</DisplayString>
+ <Expand>
+ <Item Name="[Integer Type]" Condition="(IDAndSubclassData & 255) == llvm::Type::IntegerTyID">*(llvm::IntegerType*)this</Item>
+ <Item Name="[Function Type]" Condition="(IDAndSubclassData & 255) == llvm::Type::FunctionTyID">*(llvm::FunctionType*)this</Item>
+ <Item Name="[Struct Type]" Condition="(IDAndSubclassData & 255) == llvm::Type::StructTyID">*(llvm::StructType*)this</Item>
+ <Item Name="[Array Type]" Condition="(IDAndSubclassData & 255) == llvm::Type::ArrayTyID">*(llvm::ArrayType*)this</Item>
+ <Item Name="[Pointer Type]" Condition="(IDAndSubclassData & 255) == llvm::Type::PointerTyID">*(llvm::PointerType*)this</Item>
+ <Item Name="[Vector Type]" Condition="(IDAndSubclassData & 255) == llvm::Type::VectorTyID">*(llvm::VectorType*)this</Item>
+ </Expand>
+ </Type>
+
+ <Type Name="llvm::SequentialType">
+ <Expand>
+ <Item Name="ContainedType">ContainedType</Item>
+ <ExpandedItem>*(llvm::Type*)this,nd</ExpandedItem>
+ </Expand>
+ </Type>
+
+ <Type Name="llvm::Instruction">
+ <Expand>
+ <Synthetic Name="[Opcode]">
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Call">Call</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Add">Add</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Sub">Sub</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Mul">Mul</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::SDiv">SDiv</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::UDiv">UDiv</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::SRem">SRem</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::URem">URem</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Shl">Shl</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::LShr">LShr</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::AShr">AShr</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::And">And</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Or">Or</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Xor">Xor</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Alloca">Alloca</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::BitCast">BitCast</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::ZExt">ZExt</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::SExt">SExt</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Br">Br</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::GetElementPtr">GetElementPtr</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::ICmp">ICmp</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::IntToPtr">IntToPtr</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::PtrToInt">PtrToInt</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Trunc">Trunc</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Load">Load</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Ret">Ret</DisplayString>
+ <DisplayString Condition="(SubclassID - InstructionVal) == Instruction::Store">Store</DisplayString>
+ <DisplayString>{{Unknown}}</DisplayString>
+ </Synthetic>
+ <Item Name="Parent">Parent</Item>
+ <Item Name="DebugLoc">DbgLoc</Item>
+ <ExpandedItem>(llvm::User*)this,nd</ExpandedItem>
+ </Expand>
+ </Type>
</AutoVisualizer>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4316.10902.patch
Type: text/x-patch
Size: 5373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140626/042e5a14/attachment.bin>
More information about the llvm-commits
mailing list