[llvm] r269444 - [codeview] Dump the type index on the first line of each record

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 10:48:25 PDT 2016


Author: rnk
Date: Fri May 13 12:48:24 2016
New Revision: 269444

URL: http://llvm.org/viewvc/llvm-project?rev=269444&view=rev
Log:
[codeview] Dump the type index on the first line of each record

This will make it easier to write FileCheck tests.

Modified:
    llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp
    llvm/trunk/test/DebugInfo/COFF/inlining.ll
    llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
    llvm/trunk/test/tools/llvm-readobj/codeview-vftable.test

Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp?rev=269444&r1=269443&r2=269444&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp (original)
+++ llvm/trunk/lib/DebugInfo/CodeView/TypeDumper.cpp Fri May 13 12:48:24 2016
@@ -254,10 +254,10 @@ void CVTypeDumperImpl::visitTypeBegin(Ty
   // Reset Name to the empty string. If the visitor sets it, we know it.
   Name = "";
 
-  W.startLine() << getLeafTypeName(Leaf) << " {\n";
+  W.startLine() << getLeafTypeName(Leaf) << " ("
+                << HexNumber(CVTD.getNextTypeIndex()) << ") {\n";
   W.indent();
   W.printEnum("TypeLeafKind", unsigned(Leaf), makeArrayRef(LeafTypeNames));
-  W.printHex("TypeIndex", CVTD.getNextTypeIndex());
 }
 
 void CVTypeDumperImpl::visitTypeEnd(TypeLeafKind Leaf,

Modified: llvm/trunk/test/DebugInfo/COFF/inlining.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/inlining.ll?rev=269444&r1=269443&r2=269444&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/inlining.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/inlining.ll Fri May 13 12:48:24 2016
@@ -72,28 +72,24 @@
 ; We should only the LF_FUNC_ID records that we needed to reference.
 ; OBJ: CodeViewTypes [
 ; OBJ:   Section: .debug$T (4)
-; OBJ:   ArgList {
+; OBJ:   ArgList (0x1000) {
 ; OBJ:     TypeLeafKind: LF_ARGLIST (0x1201)
-; OBJ:     TypeIndex: 0x1000
 ; OBJ:     NumArgs: 0
 ; OBJ:   }
-; OBJ:   ProcedureType {
+; OBJ:   ProcedureType (0x1001) {
 ; OBJ:     TypeLeafKind: LF_PROCEDURE (0x1008)
-; OBJ:     TypeIndex: 0x1001
 ; OBJ:     ReturnType: void (0x3)
 ; OBJ:     NumParameters: 0
 ; OBJ:     ArgListType: () (0x1000)
 ; OBJ:   }
-; OBJ:   FuncId {
+; OBJ:   FuncId (0x1002) {
 ; OBJ:     TypeLeafKind: LF_FUNC_ID (0x1601)
-; OBJ:     TypeIndex: 0x1002
 ; OBJ:     ParentScope: 0x0
 ; OBJ:     FunctionType: void () (0x1001)
 ; OBJ:     Name: bar
 ; OBJ:   }
-; OBJ:   FuncId {
+; OBJ:   FuncId (0x1003) {
 ; OBJ:     TypeLeafKind: LF_FUNC_ID (0x1601)
-; OBJ:     TypeIndex: 0x1003
 ; OBJ:     ParentScope: 0x0
 ; OBJ:     FunctionType: void () (0x1001)
 ; OBJ:     Name: foo

Modified: llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test?rev=269444&r1=269443&r2=269444&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test (original)
+++ llvm/trunk/test/DebugInfo/PDB/pdbdump-headers.test Fri May 13 12:48:24 2016
@@ -246,9 +246,8 @@
 ; EMPTY-NEXT:   Record count: 75
 ; EMPTY-NEXT:   Records [
 ; EMPTY-NEXT:     {
-; EMPTY-NEXT:       ArgList {
+; EMPTY-NEXT:       ArgList (0x1000) {
 ; EMPTY-NEXT:         TypeLeafKind: LF_ARGLIST (0x1201)
-; EMPTY-NEXT:         TypeIndex: 0x1000
 ; EMPTY-NEXT:         NumArgs: 0
 ; EMPTY-NEXT:         Arguments [
 ; EMPTY-NEXT:         ]
@@ -258,9 +257,8 @@
 ; EMPTY-NEXT:       )
 ; EMPTY-NEXT:     }
 ; EMPTY-NEXT:     {
-; EMPTY-NEXT:       ProcedureType {
+; EMPTY-NEXT:       ProcedureType (0x1001) {
 ; EMPTY-NEXT:         TypeLeafKind: LF_PROCEDURE (0x1008)
-; EMPTY-NEXT:         TypeIndex: 0x1001
 ; EMPTY-NEXT:         ReturnType: int (0x74)
 ; EMPTY-NEXT:         CallingConvention: NearC (0x0)
 ; EMPTY-NEXT:         FunctionOptions [ (0x0)
@@ -273,9 +271,8 @@
 ; EMPTY-NEXT:       )
 ; EMPTY-NEXT:     }
 ; EMPTY-NEXT:     {
-; EMPTY-NEXT:       UnknownLeaf {
+; EMPTY-NEXT:       UnknownLeaf (0x1002) {
 ; EMPTY-NEXT:         TypeLeafKind: LF_FIELDLIST (0x1203)
-; EMPTY-NEXT:         TypeIndex: 0x1002
 ; EMPTY-NEXT:         Enumerator {
 ; EMPTY-NEXT:           AccessSpecifier: Public (0x3)
 ; EMPTY-NEXT:           EnumValue: 1

Modified: llvm/trunk/test/tools/llvm-readobj/codeview-vftable.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/codeview-vftable.test?rev=269444&r1=269443&r2=269444&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/codeview-vftable.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/codeview-vftable.test Fri May 13 12:48:24 2016
@@ -19,18 +19,16 @@
 
 RUN: llvm-readobj -codeview %p/Inputs/codeview-vftable.obj.coff | FileCheck %s
 
-CHECK:       VFTableType {
+CHECK:       VFTableType (0x10F0) {
 CHECK-NEXT:    TypeLeafKind: LF_VFTABLE (0x151D)
-CHECK-NEXT:    TypeIndex: 0x10F0
 CHECK-NEXT:    CompleteClass: A
 CHECK-NEXT:    OverriddenVFTable: 0x0
 CHECK-NEXT:    VFPtrOffset: 0x0
 CHECK-NEXT:    VFTableName: ??_7A@@6B@
 CHECK-NEXT:    MethodName: ?f at A@@UEAAXXZ
 CHECK-NEXT:  }
-CHECK-NEXT:  VFTableType {
+CHECK-NEXT:  VFTableType (0x10F1) {
 CHECK-NEXT:    TypeLeafKind: LF_VFTABLE (0x151D)
-CHECK-NEXT:    TypeIndex: 0x10F1
 CHECK-NEXT:    CompleteClass: B
 CHECK-NEXT:    OverriddenVFTable: ??_7A@@6B@ (0x10F0)
 CHECK-NEXT:    VFPtrOffset: 0x0
@@ -38,9 +36,8 @@ CHECK-NEXT:    VFTableName: ??_7B@@6B@
 CHECK-NEXT:    MethodName: ?f at B@@UEAAXXZ
 CHECK-NEXT:    MethodName: ?g at B@@UEAAXXZ
 CHECK-NEXT:  }
-CHECK-NEXT:  VFTableType {
+CHECK-NEXT:  VFTableType (0x10F2) {
 CHECK-NEXT:    TypeLeafKind: LF_VFTABLE (0x151D)
-CHECK-NEXT:    TypeIndex: 0x10F2
 CHECK-NEXT:    CompleteClass: C
 CHECK-NEXT:    OverriddenVFTable: ??_7B@@6B@ (0x10F1)
 CHECK-NEXT:    VFPtrOffset: 0x0




More information about the llvm-commits mailing list