[llvm] r280549 - [codeview] Make FieldList records print as a yaml sequence.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 2 15:19:01 PDT 2016
Author: zturner
Date: Fri Sep 2 17:19:01 2016
New Revision: 280549
URL: http://llvm.org/viewvc/llvm-project?rev=280549&view=rev
Log:
[codeview] Make FieldList records print as a yaml sequence.
Before we were kind of imitating the behavior of a Yaml sequence
by outputting each record one after the other. This makes it a
little cumbersome when we want to go the other direction -- from
Yaml to Pdb. So this treats FieldList records as no different than
any other list of records, by printing them as a Yaml sequence with
the exact same format.
Modified:
llvm/trunk/test/DebugInfo/PDB/pdbdump-yaml-types.test
llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.cpp
llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.h
Modified: llvm/trunk/test/DebugInfo/PDB/pdbdump-yaml-types.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/PDB/pdbdump-yaml-types.test?rev=280549&r1=280548&r2=280549&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/PDB/pdbdump-yaml-types.test (original)
+++ llvm/trunk/test/DebugInfo/PDB/pdbdump-yaml-types.test Fri Sep 2 17:19:01 2016
@@ -29,31 +29,31 @@ YAML: ParameterCount: 0
YAML: ArgumentList: 4096
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1
-YAML: Name: apartment
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2
-YAML: Name: single
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 3
-YAML: Name: free
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 4
-YAML: Name: neutral
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 5
-YAML: Name: both
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1
+YAML: Name: apartment
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2
+YAML: Name: single
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 3
+YAML: Name: free
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 4
+YAML: Name: neutral
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 5
+YAML: Name: both
YAML: - Kind: LF_ENUM
YAML: Enum:
YAML: NumEnumerators: 5
@@ -121,21 +121,21 @@ YAML: VFTableOffset: -1
YAML: Name: ''
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4099
-YAML: Name: threading_e
-YAML: Kind: LF_METHOD
-YAML: OverloadedMethod:
-YAML: NumOverloads: 2
-YAML: MethodList: 4105
-YAML: Name: threadingAttribute
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4099
-YAML: FieldOffset: 0
-YAML: Name: value
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4099
+YAML: Name: threading_e
+YAML: - Kind: LF_METHOD
+YAML: OverloadedMethod:
+YAML: NumOverloads: 2
+YAML: MethodList: 4105
+YAML: Name: threadingAttribute
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4099
+YAML: FieldOffset: 0
+YAML: Name: value
YAML: - Kind: LF_STRUCTURE
YAML: Class:
YAML: MemberCount: 4
@@ -150,21 +150,21 @@ YAML: VTableShape: 0
YAML: Size: 4
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 0
-YAML: Name: native
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1
-YAML: Name: com
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2
-YAML: Name: managed
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 0
+YAML: Name: native
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1
+YAML: Name: com
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2
+YAML: Name: managed
YAML: - Kind: LF_ENUM
YAML: Enum:
YAML: NumEnumerators: 3
@@ -251,27 +251,27 @@ YAML: VFTableOffset: -1
YAML: Name: ''
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4109
-YAML: Name: type_e
-YAML: Kind: LF_METHOD
-YAML: OverloadedMethod:
-YAML: NumOverloads: 3
-YAML: MethodList: 4117
-YAML: Name: event_receiverAttribute
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4109
-YAML: FieldOffset: 0
-YAML: Name: type
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 48
-YAML: FieldOffset: 4
-YAML: Name: layout_dependent
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4109
+YAML: Name: type_e
+YAML: - Kind: LF_METHOD
+YAML: OverloadedMethod:
+YAML: NumOverloads: 3
+YAML: MethodList: 4117
+YAML: Name: event_receiverAttribute
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4109
+YAML: FieldOffset: 0
+YAML: Name: type
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 48
+YAML: FieldOffset: 4
+YAML: Name: layout_dependent
YAML: - Kind: LF_STRUCTURE
YAML: Class:
YAML: MemberCount: 6
@@ -286,21 +286,21 @@ YAML: VTableShape: 0
YAML: Size: 8
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 0
-YAML: Name: never
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1
-YAML: Name: allowed
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2
-YAML: Name: always
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 0
+YAML: Name: never
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1
+YAML: Name: allowed
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2
+YAML: Name: always
YAML: - Kind: LF_ENUM
YAML: Enum:
YAML: NumEnumerators: 3
@@ -368,21 +368,21 @@ YAML: VFTableOffset: -1
YAML: Name: ''
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4121
-YAML: Name: type_e
-YAML: Kind: LF_METHOD
-YAML: OverloadedMethod:
-YAML: NumOverloads: 2
-YAML: MethodList: 4127
-YAML: Name: aggregatableAttribute
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4121
-YAML: FieldOffset: 0
-YAML: Name: type
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4121
+YAML: Name: type_e
+YAML: - Kind: LF_METHOD
+YAML: OverloadedMethod:
+YAML: NumOverloads: 2
+YAML: MethodList: 4127
+YAML: Name: aggregatableAttribute
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4121
+YAML: FieldOffset: 0
+YAML: Name: type
YAML: - Kind: LF_STRUCTURE
YAML: Class:
YAML: MemberCount: 4
@@ -405,16 +405,16 @@ YAML: UniqueName: '.?AW4typ
YAML: UnderlyingType: 116
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 0
-YAML: Name: speed
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1
-YAML: Name: size
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 0
+YAML: Name: speed
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1
+YAML: Name: size
YAML: - Kind: LF_ENUM
YAML: Enum:
YAML: NumEnumerators: 2
@@ -482,37 +482,37 @@ YAML: VFTableOffset: -1
YAML: Name: ''
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4130
-YAML: Name: type_e
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4132
-YAML: Name: optimize_e
-YAML: Kind: LF_METHOD
-YAML: OverloadedMethod:
-YAML: NumOverloads: 2
-YAML: MethodList: 4138
-YAML: Name: event_sourceAttribute
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4130
-YAML: FieldOffset: 0
-YAML: Name: type
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4132
-YAML: FieldOffset: 4
-YAML: Name: optimize
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 48
-YAML: FieldOffset: 8
-YAML: Name: decorate
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4130
+YAML: Name: type_e
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4132
+YAML: Name: optimize_e
+YAML: - Kind: LF_METHOD
+YAML: OverloadedMethod:
+YAML: NumOverloads: 2
+YAML: MethodList: 4138
+YAML: Name: event_sourceAttribute
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4130
+YAML: FieldOffset: 0
+YAML: Name: type
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4132
+YAML: FieldOffset: 4
+YAML: Name: optimize
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 48
+YAML: FieldOffset: 8
+YAML: Name: decorate
YAML: - Kind: LF_STRUCTURE
YAML: Class:
YAML: MemberCount: 7
@@ -527,36 +527,36 @@ YAML: VTableShape: 0
YAML: Size: 12
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1
-YAML: Name: dll
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2
-YAML: Name: exe
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 3
-YAML: Name: service
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 4
-YAML: Name: unspecified
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2
-YAML: Name: EXE
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 3
-YAML: Name: SERVICE
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1
+YAML: Name: dll
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2
+YAML: Name: exe
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 3
+YAML: Name: service
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 4
+YAML: Name: unspecified
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2
+YAML: Name: EXE
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 3
+YAML: Name: SERVICE
YAML: - Kind: LF_ENUM
YAML: Enum:
YAML: NumEnumerators: 6
@@ -655,105 +655,105 @@ YAML: VFTableOffset: -1
YAML: Name: ''
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4142
-YAML: Name: type_e
-YAML: Kind: LF_METHOD
-YAML: OverloadedMethod:
-YAML: NumOverloads: 3
-YAML: MethodList: 4152
-YAML: Name: moduleAttribute
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4142
-YAML: FieldOffset: 0
-YAML: Name: type
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 4
-YAML: Name: name
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 8
-YAML: Name: version
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 12
-YAML: Name: uuid
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 116
-YAML: FieldOffset: 16
-YAML: Name: lcid
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 48
-YAML: FieldOffset: 20
-YAML: Name: control
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 24
-YAML: Name: helpstring
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 116
-YAML: FieldOffset: 28
-YAML: Name: helpstringcontext
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 32
-YAML: Name: helpstringdll
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 36
-YAML: Name: helpfile
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 116
-YAML: FieldOffset: 40
-YAML: Name: helpcontext
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 48
-YAML: FieldOffset: 44
-YAML: Name: hidden
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 48
-YAML: FieldOffset: 45
-YAML: Name: restricted
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 48
-YAML: Name: custom
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4146
-YAML: FieldOffset: 52
-YAML: Name: resource_name
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4142
+YAML: Name: type_e
+YAML: - Kind: LF_METHOD
+YAML: OverloadedMethod:
+YAML: NumOverloads: 3
+YAML: MethodList: 4152
+YAML: Name: moduleAttribute
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4142
+YAML: FieldOffset: 0
+YAML: Name: type
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 4
+YAML: Name: name
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 8
+YAML: Name: version
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 12
+YAML: Name: uuid
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 116
+YAML: FieldOffset: 16
+YAML: Name: lcid
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 48
+YAML: FieldOffset: 20
+YAML: Name: control
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 24
+YAML: Name: helpstring
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 116
+YAML: FieldOffset: 28
+YAML: Name: helpstringcontext
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 32
+YAML: Name: helpstringdll
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 36
+YAML: Name: helpfile
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 116
+YAML: FieldOffset: 40
+YAML: Name: helpcontext
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 48
+YAML: FieldOffset: 44
+YAML: Name: hidden
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 48
+YAML: FieldOffset: 45
+YAML: Name: restricted
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 48
+YAML: Name: custom
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4146
+YAML: FieldOffset: 52
+YAML: Name: resource_name
YAML: - Kind: LF_STRUCTURE
YAML: Class:
YAML: MemberCount: 19
@@ -768,156 +768,156 @@ YAML: VTableShape: 0
YAML: Size: 56
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 0
-YAML: Name: eAnyUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1
-YAML: Name: eCoClassUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2
-YAML: Name: eCOMInterfaceUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 6
-YAML: Name: eInterfaceUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 8
-YAML: Name: eMemberUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 16
-YAML: Name: eMethodUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 32
-YAML: Name: eInterfaceMethodUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 64
-YAML: Name: eInterfaceMemberUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 128
-YAML: Name: eCoClassMemberUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 256
-YAML: Name: eCoClassMethodUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 768
-YAML: Name: eGlobalMethodUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1024
-YAML: Name: eGlobalDataUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2048
-YAML: Name: eClassUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 4096
-YAML: Name: eInterfaceParameterUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 12288
-YAML: Name: eMethodParameterUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 16384
-YAML: Name: eIDLModuleUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: -32768
-YAML: Name: eAnonymousUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 65536
-YAML: Name: eTypedefUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 131072
-YAML: Name: eUnionUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 262144
-YAML: Name: eEnumUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 524288
-YAML: Name: eDefineTagUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1048576
-YAML: Name: eStructUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2097152
-YAML: Name: eLocalUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 4194304
-YAML: Name: ePropertyUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 8388608
-YAML: Name: eEventUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 16777216
-YAML: Name: eTemplateUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 16777216
-YAML: Name: eModuleUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 33554432
-YAML: Name: eIllegalUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 67108864
-YAML: Name: eAsynchronousUsage
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 4161535
-YAML: Name: eAnyIDLUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 0
+YAML: Name: eAnyUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1
+YAML: Name: eCoClassUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2
+YAML: Name: eCOMInterfaceUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 6
+YAML: Name: eInterfaceUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 8
+YAML: Name: eMemberUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 16
+YAML: Name: eMethodUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 32
+YAML: Name: eInterfaceMethodUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 64
+YAML: Name: eInterfaceMemberUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 128
+YAML: Name: eCoClassMemberUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 256
+YAML: Name: eCoClassMethodUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 768
+YAML: Name: eGlobalMethodUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1024
+YAML: Name: eGlobalDataUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2048
+YAML: Name: eClassUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 4096
+YAML: Name: eInterfaceParameterUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 12288
+YAML: Name: eMethodParameterUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 16384
+YAML: Name: eIDLModuleUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: -32768
+YAML: Name: eAnonymousUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 65536
+YAML: Name: eTypedefUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 131072
+YAML: Name: eUnionUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 262144
+YAML: Name: eEnumUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 524288
+YAML: Name: eDefineTagUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1048576
+YAML: Name: eStructUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2097152
+YAML: Name: eLocalUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 4194304
+YAML: Name: ePropertyUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 8388608
+YAML: Name: eEventUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 16777216
+YAML: Name: eTemplateUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 16777216
+YAML: Name: eModuleUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 33554432
+YAML: Name: eIllegalUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 67108864
+YAML: Name: eAsynchronousUsage
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 4161535
+YAML: Name: eAnyIDLUsage
YAML: - Kind: LF_ENUM
YAML: Enum:
YAML: NumEnumerators: 30
@@ -960,24 +960,24 @@ YAML: ArgumentList: 4159
YAML: ThisPointerAdjustment: 0
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4156
-YAML: Name: usage_e
-YAML: Kind: LF_ONEMETHOD
-YAML: OneMethod:
-YAML: Type: 4160
-YAML: Kind: Vanilla
-YAML: Options: [ None ]
-YAML: Access: Public
-YAML: VFTableOffset: -1
-YAML: Name: usageAttribute
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 117
-YAML: FieldOffset: 0
-YAML: Name: value
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4156
+YAML: Name: usage_e
+YAML: - Kind: LF_ONEMETHOD
+YAML: OneMethod:
+YAML: Type: 4160
+YAML: Kind: Vanilla
+YAML: Options: [ None ]
+YAML: Access: Public
+YAML: VFTableOffset: -1
+YAML: Name: usageAttribute
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 117
+YAML: FieldOffset: 0
+YAML: Name: value
YAML: - Kind: LF_STRUCTURE
YAML: Class:
YAML: MemberCount: 3
@@ -992,26 +992,26 @@ YAML: VTableShape: 0
YAML: Size: 4
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 0
-YAML: Name: eBoolean
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 1
-YAML: Name: eInteger
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 2
-YAML: Name: eFloat
-YAML: Kind: LF_ENUMERATE
-YAML: Enumerator:
-YAML: Access: Public
-YAML: Value: 3
-YAML: Name: eDouble
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 0
+YAML: Name: eBoolean
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 1
+YAML: Name: eInteger
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 2
+YAML: Name: eFloat
+YAML: - Kind: LF_ENUMERATE
+YAML: Enumerator:
+YAML: Access: Public
+YAML: Value: 3
+YAML: Name: eDouble
YAML: - Kind: LF_ENUM
YAML: Enum:
YAML: NumEnumerators: 4
@@ -1054,24 +1054,24 @@ YAML: ArgumentList: 4167
YAML: ThisPointerAdjustment: 0
YAML: - Kind: LF_FIELDLIST
YAML: FieldList:
-YAML: Kind: LF_NESTTYPE
-YAML: NestedType:
-YAML: Type: 4164
-YAML: Name: type_e
-YAML: Kind: LF_ONEMETHOD
-YAML: OneMethod:
-YAML: Type: 4168
-YAML: Kind: Vanilla
-YAML: Options: [ None ]
-YAML: Access: Public
-YAML: VFTableOffset: -1
-YAML: Name: v1_alttypeAttribute
-YAML: Kind: LF_MEMBER
-YAML: DataMember:
-YAML: Access: Public
-YAML: Type: 4164
-YAML: FieldOffset: 0
-YAML: Name: type
+YAML: - Kind: LF_NESTTYPE
+YAML: NestedType:
+YAML: Type: 4164
+YAML: Name: type_e
+YAML: - Kind: LF_ONEMETHOD
+YAML: OneMethod:
+YAML: Type: 4168
+YAML: Kind: Vanilla
+YAML: Options: [ None ]
+YAML: Access: Public
+YAML: VFTableOffset: -1
+YAML: Name: v1_alttypeAttribute
+YAML: - Kind: LF_MEMBER
+YAML: DataMember:
+YAML: Access: Public
+YAML: Type: 4164
+YAML: FieldOffset: 0
+YAML: Name: type
YAML: - Kind: LF_STRUCTURE
YAML: Class:
YAML: MemberCount: 3
Modified: llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.cpp?rev=280549&r1=280548&r2=280549&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.cpp (original)
+++ llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.cpp Fri Sep 2 17:19:01 2016
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "CodeViewYaml.h"
+#include "PdbYaml.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/EnumTables.h"
@@ -25,6 +26,38 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(OneMethodRe
LLVM_YAML_IS_SEQUENCE_VECTOR(VFTableSlotKind)
LLVM_YAML_IS_SEQUENCE_VECTOR(StringRef)
LLVM_YAML_IS_SEQUENCE_VECTOR(CVType)
+LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbTpiRecord)
+
+namespace {
+struct FieldListRecordSplitter : public TypeVisitorCallbacks {
+public:
+ explicit FieldListRecordSplitter(
+ std::vector<llvm::pdb::yaml::PdbTpiRecord> &Records)
+ : Records(Records) {}
+
+#define TYPE_RECORD(EnumName, EnumVal, Name)
+#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
+#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
+#define MEMBER_RECORD(EnumName, EnumVal, Name) \
+ Error visitKnownRecord(const CVType &CVT, Name##Record &Record) override { \
+ visitKnownRecordImpl(CVT); \
+ return Error::success(); \
+ }
+#include "llvm/DebugInfo/CodeView/TypeRecords.def"
+
+private:
+ void visitKnownRecordImpl(const CVType &CVT) {
+ llvm::pdb::yaml::PdbTpiRecord R;
+ R.Record = CVT;
+ R.RecordData.assign(CVT.RawData.begin(), CVT.RawData.end());
+ R.Record.Data = R.RecordData;
+ R.Record.RawData = R.RecordData;
+ Records.push_back(std::move(R));
+ }
+
+ std::vector<llvm::pdb::yaml::PdbTpiRecord> &Records;
+};
+}
namespace llvm {
namespace yaml {
@@ -518,3 +551,15 @@ llvm::codeview::yaml::YamlTypeDumperCall
YamlIO.mapRequired("Kind", K);
return K;
}
+
+void llvm::codeview::yaml::YamlTypeDumperCallbacks::visitKnownRecordImpl(
+ const char *Name, const CVType &Type, FieldListRecord &FieldList) {
+
+ std::vector<llvm::pdb::yaml::PdbTpiRecord> Records;
+ if (YamlIO.outputting()) {
+ FieldListRecordSplitter Splitter(Records);
+ CVTypeVisitor V(Splitter);
+ consumeError(V.visitFieldListMemberStream(FieldList.Data));
+ }
+ YamlIO.mapRequired(Name, Records);
+}
Modified: llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.h?rev=280549&r1=280548&r2=280549&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.h (original)
+++ llvm/trunk/tools/llvm-pdbdump/CodeViewYaml.h Fri Sep 2 17:19:01 2016
@@ -27,7 +27,7 @@ public:
#define TYPE_RECORD(EnumName, EnumVal, Name) \
Error visitKnownRecord(const CVRecord<TypeLeafKind> &CVR, \
Name##Record &Record) override { \
- YamlIO.mapRequired(#Name, Record); \
+ visitKnownRecordImpl(#Name, CVR, Record); \
return Error::success(); \
}
#define MEMBER_RECORD(EnumName, EnumVal, Name) \
@@ -37,6 +37,14 @@ public:
#include "llvm/DebugInfo/CodeView/TypeRecords.def"
private:
+ template <typename T>
+ void visitKnownRecordImpl(const char *Name, const CVType &Type, T &Record) {
+ YamlIO.mapRequired(Name, Record);
+ }
+
+ void visitKnownRecordImpl(const char *Name, const CVType &Type,
+ FieldListRecord &FieldList);
+
llvm::yaml::IO &YamlIO;
};
}
More information about the llvm-commits
mailing list