[llvm] r304248 - [CodeView] Move CodeView YAML code to ObjectYAML.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue May 30 17:17:49 PDT 2017
Hi Zach,
I think your change caused a number of test failures on the
sanitizer-x86_64-linux-fast bot.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/5323/steps/check-llvm%20ubsan/logs/stdio
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/5323/steps/check-lld%20asan/logs/stdio
Can you please take a look?
Thanks,
Peter
On Tue, May 30, 2017 at 2:53 PM, Zachary Turner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: zturner
> Date: Tue May 30 16:53:05 2017
> New Revision: 304248
>
> URL: http://llvm.org/viewvc/llvm-project?rev=304248&view=rev
> Log:
> [CodeView] Move CodeView YAML code to ObjectYAML.
>
> This is the beginning of an effort to move the codeview yaml
> reader / writer into ObjectYAML so that it can be shared.
> Currently the only consumer / producer of CodeView YAML is
> llvm-pdbdump, but CodeView can exist outside of PDB files, and
> indeed is put into object files and passed to the linker to
> produce PDB files. Furthermore, there are subtle differences
> in the types of records that show up in object file CodeView
> vs PDB file CodeView, but they are otherwise 99% the same.
>
> By having this code in ObjectYAML, we can have llvm-pdbdump
> reuse this code, while teaching obj2yaml and yaml2obj to use
> this syntax for dealing with object files that can contain
> CodeView.
>
> This patch only adds support for CodeView type information
> to ObjectYAML. Subsequent patches will add support for
> CodeView symbol information.
>
> Added:
> llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def
> llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewTypes.def
> llvm/trunk/include/llvm/ObjectYAML/CodeViewYAML.h
> llvm/trunk/lib/ObjectYAML/CodeViewYAML.cpp
> Removed:
> llvm/trunk/include/llvm/DebugInfo/CodeView/CVSymbolTypes.def
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def
> llvm/trunk/tools/llvm-pdbdump/YamlSerializationContext.h
> llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.cpp
> llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.h
> Modified:
> llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/
> SymbolVisitorCallbackPipeline.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeSerializer.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/
> TypeVisitorCallbackPipeline.h
> llvm/trunk/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Native/RawConstants.h
> llvm/trunk/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
> llvm/trunk/include/llvm/Support/YAMLTraits.h
> llvm/trunk/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
> llvm/trunk/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
> llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp
> llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp
> llvm/trunk/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
> llvm/trunk/lib/MC/MCCodeView.cpp
> llvm/trunk/lib/ObjectYAML/CMakeLists.txt
> llvm/trunk/lib/ObjectYAML/LLVMBuild.txt
> llvm/trunk/tools/llvm-pdbdump/Analyze.cpp
> llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt
> llvm/trunk/tools/llvm-pdbdump/CompactTypeDumpVisitor.cpp
> llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp
> llvm/trunk/tools/llvm-pdbdump/PdbYaml.h
> llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp
> llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.h
> llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp
> llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.h
> llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
>
> Removed: llvm/trunk/include/llvm/DebugInfo/CodeView/CVSymbolTypes.def
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/CVSymbolTypes.def?rev=304247&view=auto
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/CVSymbolTypes.def
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/CVSymbolTypes.def (removed)
> @@ -1,258 +0,0 @@
> -//===-- CVLeafTypes.def - All CodeView leaf types ---------------*- C++
> -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -//
> -// See LEAF_ENUM_e in cvinfo.h. This should match the constants there.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -
> -#ifndef CV_SYMBOL
> -#define CV_SYMBOL(ename, value)
> -#endif
> -
> -#ifndef SYMBOL_RECORD
> -#define SYMBOL_RECORD(lf_ename, value, name) CV_SYMBOL(lf_ename, value)
> -#endif
> -
> -#ifndef SYMBOL_RECORD_ALIAS
> -#define SYMBOL_RECORD_ALIAS(lf_ename, value, name, alias_name)
> \
> - SYMBOL_RECORD(lf_ename, value, name)
> -#endif
> -
> -// 16 bit symbol types. Not very useful, provided only for reference.
> -CV_SYMBOL(S_COMPILE , 0x0001)
> -CV_SYMBOL(S_REGISTER_16t , 0x0002)
> -CV_SYMBOL(S_CONSTANT_16t , 0x0003)
> -CV_SYMBOL(S_UDT_16t , 0x0004)
> -CV_SYMBOL(S_SSEARCH , 0x0005)
> -CV_SYMBOL(S_SKIP , 0x0007)
> -CV_SYMBOL(S_CVRESERVE , 0x0008)
> -CV_SYMBOL(S_OBJNAME_ST , 0x0009)
> -CV_SYMBOL(S_ENDARG , 0x000a)
> -CV_SYMBOL(S_COBOLUDT_16t , 0x000b)
> -CV_SYMBOL(S_MANYREG_16t , 0x000c)
> -CV_SYMBOL(S_RETURN , 0x000d)
> -CV_SYMBOL(S_ENTRYTHIS , 0x000e)
> -CV_SYMBOL(S_BPREL16 , 0x0100)
> -CV_SYMBOL(S_LDATA16 , 0x0101)
> -CV_SYMBOL(S_GDATA16 , 0x0102)
> -CV_SYMBOL(S_PUB16 , 0x0103)
> -CV_SYMBOL(S_LPROC16 , 0x0104)
> -CV_SYMBOL(S_GPROC16 , 0x0105)
> -CV_SYMBOL(S_THUNK16 , 0x0106)
> -CV_SYMBOL(S_BLOCK16 , 0x0107)
> -CV_SYMBOL(S_WITH16 , 0x0108)
> -CV_SYMBOL(S_LABEL16 , 0x0109)
> -CV_SYMBOL(S_CEXMODEL16 , 0x010a)
> -CV_SYMBOL(S_VFTABLE16 , 0x010b)
> -CV_SYMBOL(S_REGREL16 , 0x010c)
> -CV_SYMBOL(S_BPREL32_16t , 0x0200)
> -CV_SYMBOL(S_LDATA32_16t , 0x0201)
> -CV_SYMBOL(S_GDATA32_16t , 0x0202)
> -CV_SYMBOL(S_PUB32_16t , 0x0203)
> -CV_SYMBOL(S_LPROC32_16t , 0x0204)
> -CV_SYMBOL(S_GPROC32_16t , 0x0205)
> -CV_SYMBOL(S_THUNK32_ST , 0x0206)
> -CV_SYMBOL(S_BLOCK32_ST , 0x0207)
> -CV_SYMBOL(S_WITH32_ST , 0x0208)
> -CV_SYMBOL(S_LABEL32_ST , 0x0209)
> -CV_SYMBOL(S_CEXMODEL32 , 0x020a)
> -CV_SYMBOL(S_VFTABLE32_16t , 0x020b)
> -CV_SYMBOL(S_REGREL32_16t , 0x020c)
> -CV_SYMBOL(S_LTHREAD32_16t , 0x020d)
> -CV_SYMBOL(S_GTHREAD32_16t , 0x020e)
> -CV_SYMBOL(S_SLINK32 , 0x020f)
> -CV_SYMBOL(S_LPROCMIPS_16t , 0x0300)
> -CV_SYMBOL(S_GPROCMIPS_16t , 0x0301)
> -CV_SYMBOL(S_PROCREF_ST , 0x0400)
> -CV_SYMBOL(S_DATAREF_ST , 0x0401)
> -CV_SYMBOL(S_ALIGN , 0x0402)
> -CV_SYMBOL(S_LPROCREF_ST , 0x0403)
> -CV_SYMBOL(S_OEM , 0x0404)
> -
> -// All post 16 bit symbol types have the 0x1000 bit set.
> -CV_SYMBOL(S_TI16_MAX , 0x1000)
> -
> -// Mostly unused "start" symbol types.
> -CV_SYMBOL(S_REGISTER_ST , 0x1001)
> -CV_SYMBOL(S_CONSTANT_ST , 0x1002)
> -CV_SYMBOL(S_UDT_ST , 0x1003)
> -CV_SYMBOL(S_COBOLUDT_ST , 0x1004)
> -CV_SYMBOL(S_MANYREG_ST , 0x1005)
> -CV_SYMBOL(S_BPREL32_ST , 0x1006)
> -CV_SYMBOL(S_LDATA32_ST , 0x1007)
> -CV_SYMBOL(S_GDATA32_ST , 0x1008)
> -CV_SYMBOL(S_PUB32_ST , 0x1009)
> -CV_SYMBOL(S_LPROC32_ST , 0x100a)
> -CV_SYMBOL(S_GPROC32_ST , 0x100b)
> -CV_SYMBOL(S_VFTABLE32 , 0x100c)
> -CV_SYMBOL(S_REGREL32_ST , 0x100d)
> -CV_SYMBOL(S_LTHREAD32_ST , 0x100e)
> -CV_SYMBOL(S_GTHREAD32_ST , 0x100f)
> -CV_SYMBOL(S_LPROCMIPS_ST , 0x1010)
> -CV_SYMBOL(S_GPROCMIPS_ST , 0x1011)
> -
> -CV_SYMBOL(S_COMPILE2_ST , 0x1013)
> -CV_SYMBOL(S_MANYREG2_ST , 0x1014)
> -CV_SYMBOL(S_LPROCIA64_ST , 0x1015)
> -CV_SYMBOL(S_GPROCIA64_ST , 0x1016)
> -CV_SYMBOL(S_LOCALSLOT_ST , 0x1017)
> -CV_SYMBOL(S_PARAMSLOT_ST , 0x1018)
> -CV_SYMBOL(S_ANNOTATION , 0x1019)
> -CV_SYMBOL(S_GMANPROC_ST , 0x101a)
> -CV_SYMBOL(S_LMANPROC_ST , 0x101b)
> -CV_SYMBOL(S_RESERVED1 , 0x101c)
> -CV_SYMBOL(S_RESERVED2 , 0x101d)
> -CV_SYMBOL(S_RESERVED3 , 0x101e)
> -CV_SYMBOL(S_RESERVED4 , 0x101f)
> -CV_SYMBOL(S_LMANDATA_ST , 0x1020)
> -CV_SYMBOL(S_GMANDATA_ST , 0x1021)
> -CV_SYMBOL(S_MANFRAMEREL_ST, 0x1022)
> -CV_SYMBOL(S_MANREGISTER_ST, 0x1023)
> -CV_SYMBOL(S_MANSLOT_ST , 0x1024)
> -CV_SYMBOL(S_MANMANYREG_ST , 0x1025)
> -CV_SYMBOL(S_MANREGREL_ST , 0x1026)
> -CV_SYMBOL(S_MANMANYREG2_ST, 0x1027)
> -CV_SYMBOL(S_MANTYPREF , 0x1028)
> -CV_SYMBOL(S_UNAMESPACE_ST , 0x1029)
> -
> -// End of S_*_ST symbols, which do not appear to be generated by modern
> -// compilers.
> -CV_SYMBOL(S_ST_MAX , 0x1100)
> -
> -
> -CV_SYMBOL(S_WITH32 , 0x1104)
> -CV_SYMBOL(S_MANYREG , 0x110a)
> -CV_SYMBOL(S_LPROCMIPS , 0x1114)
> -CV_SYMBOL(S_GPROCMIPS , 0x1115)
> -CV_SYMBOL(S_MANYREG2 , 0x1117)
> -CV_SYMBOL(S_LPROCIA64 , 0x1118)
> -CV_SYMBOL(S_GPROCIA64 , 0x1119)
> -CV_SYMBOL(S_LOCALSLOT , 0x111a)
> -CV_SYMBOL(S_PARAMSLOT , 0x111b)
> -
> -// Managed code symbols.
> -CV_SYMBOL(S_MANFRAMEREL , 0x111e)
> -CV_SYMBOL(S_MANREGISTER , 0x111f)
> -CV_SYMBOL(S_MANSLOT , 0x1120)
> -CV_SYMBOL(S_MANMANYREG , 0x1121)
> -CV_SYMBOL(S_MANREGREL , 0x1122)
> -CV_SYMBOL(S_MANMANYREG2 , 0x1123)
> -CV_SYMBOL(S_UNAMESPACE , 0x1124)
> -CV_SYMBOL(S_DATAREF , 0x1126)
> -CV_SYMBOL(S_ANNOTATIONREF , 0x1128)
> -CV_SYMBOL(S_TOKENREF , 0x1129)
> -CV_SYMBOL(S_GMANPROC , 0x112a)
> -CV_SYMBOL(S_LMANPROC , 0x112b)
> -CV_SYMBOL(S_ATTR_FRAMEREL , 0x112e)
> -CV_SYMBOL(S_ATTR_REGISTER , 0x112f)
> -CV_SYMBOL(S_ATTR_REGREL , 0x1130)
> -CV_SYMBOL(S_ATTR_MANYREG , 0x1131)
> -
> -
> -CV_SYMBOL(S_SEPCODE , 0x1132)
> -CV_SYMBOL(S_LOCAL_2005 , 0x1133)
> -CV_SYMBOL(S_DEFRANGE_2005 , 0x1134)
> -CV_SYMBOL(S_DEFRANGE2_2005, 0x1135)
> -CV_SYMBOL(S_DISCARDED , 0x113b)
> -
> -// Current symbol types for most procedures as of this writing.
> -CV_SYMBOL(S_LPROCMIPS_ID , 0x1148)
> -CV_SYMBOL(S_GPROCMIPS_ID , 0x1149)
> -CV_SYMBOL(S_LPROCIA64_ID , 0x114a)
> -CV_SYMBOL(S_GPROCIA64_ID , 0x114b)
> -
> -CV_SYMBOL(S_DEFRANGE_HLSL , 0x1150)
> -CV_SYMBOL(S_GDATA_HLSL , 0x1151)
> -CV_SYMBOL(S_LDATA_HLSL , 0x1152)
> -CV_SYMBOL(S_LOCAL_DPC_GROUPSHARED, 0x1154)
> -CV_SYMBOL(S_DEFRANGE_DPC_PTR_TAG, 0x1157)
> -CV_SYMBOL(S_DPC_SYM_TAG_MAP, 0x1158)
> -CV_SYMBOL(S_ARMSWITCHTABLE , 0x1159)
> -CV_SYMBOL(S_POGODATA , 0x115c)
> -CV_SYMBOL(S_INLINESITE2 , 0x115d)
> -CV_SYMBOL(S_MOD_TYPEREF , 0x115f)
> -CV_SYMBOL(S_REF_MINIPDB , 0x1160)
> -CV_SYMBOL(S_PDBMAP , 0x1161)
> -CV_SYMBOL(S_GDATA_HLSL32 , 0x1162)
> -CV_SYMBOL(S_LDATA_HLSL32 , 0x1163)
> -CV_SYMBOL(S_GDATA_HLSL32_EX, 0x1164)
> -CV_SYMBOL(S_LDATA_HLSL32_EX, 0x1165)
> -
> -// Known symbol types
> -SYMBOL_RECORD(S_END , 0x0006, ScopeEndSym)
> -SYMBOL_RECORD_ALIAS(S_INLINESITE_END , 0x114e, InlineSiteEnd,
> ScopeEndSym)
> -SYMBOL_RECORD_ALIAS(S_PROC_ID_END , 0x114f, ProcEnd, ScopeEndSym)
> -
> -SYMBOL_RECORD(S_THUNK32 , 0x1102, Thunk32Sym)
> -SYMBOL_RECORD(S_TRAMPOLINE , 0x112c, TrampolineSym)
> -SYMBOL_RECORD(S_SECTION , 0x1136, SectionSym)
> -SYMBOL_RECORD(S_COFFGROUP , 0x1137, CoffGroupSym)
> -SYMBOL_RECORD(S_EXPORT , 0x1138, ExportSym)
> -
> -SYMBOL_RECORD(S_LPROC32 , 0x110f, ProcSym)
> -SYMBOL_RECORD_ALIAS(S_GPROC32 , 0x1110, GlobalProcSym, ProcSym)
> -SYMBOL_RECORD_ALIAS(S_LPROC32_ID , 0x1146, ProcIdSym, ProcSym)
> -SYMBOL_RECORD_ALIAS(S_GPROC32_ID , 0x1147, GlobalProcIdSym, ProcSym)
> -SYMBOL_RECORD_ALIAS(S_LPROC32_DPC , 0x1155, DPCProcSym, ProcSym)
> -SYMBOL_RECORD_ALIAS(S_LPROC32_DPC_ID , 0x1156, DPCProcIdSym, ProcSym)
> -
> -SYMBOL_RECORD(S_REGISTER , 0x1106, RegisterSym)
> -SYMBOL_RECORD(S_PUB32 , 0x110e, PublicSym32)
> -
> -SYMBOL_RECORD(S_PROCREF , 0x1125, ProcRefSym)
> -SYMBOL_RECORD_ALIAS(S_LPROCREF, 0x1127, LocalProcRef, ProcRefSym)
> -
> -
> -SYMBOL_RECORD(S_ENVBLOCK , 0x113d, EnvBlockSym)
> -
> -SYMBOL_RECORD(S_INLINESITE , 0x114d, InlineSiteSym)
> -SYMBOL_RECORD(S_LOCAL , 0x113e, LocalSym)
> -SYMBOL_RECORD(S_DEFRANGE , 0x113f, DefRangeSym)
> -SYMBOL_RECORD(S_DEFRANGE_SUBFIELD, 0x1140, DefRangeSubfieldSym)
> -SYMBOL_RECORD(S_DEFRANGE_REGISTER, 0x1141, DefRangeRegisterSym)
> -SYMBOL_RECORD(S_DEFRANGE_FRAMEPOINTER_REL, 0x1142,
> DefRangeFramePointerRelSym)
> -SYMBOL_RECORD(S_DEFRANGE_SUBFIELD_REGISTER, 0x1143,
> DefRangeSubfieldRegisterSym)
> -SYMBOL_RECORD(S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE, 0x1144,
> DefRangeFramePointerRelFullScopeSym)
> -SYMBOL_RECORD(S_DEFRANGE_REGISTER_REL, 0x1145, DefRangeRegisterRelSym)
> -SYMBOL_RECORD(S_BLOCK32 , 0x1103, BlockSym)
> -SYMBOL_RECORD(S_LABEL32 , 0x1105, LabelSym)
> -SYMBOL_RECORD(S_OBJNAME , 0x1101, ObjNameSym)
> -SYMBOL_RECORD(S_COMPILE2 , 0x1116, Compile2Sym)
> -SYMBOL_RECORD(S_COMPILE3 , 0x113c, Compile3Sym)
> -SYMBOL_RECORD(S_FRAMEPROC , 0x1012, FrameProcSym)
> -SYMBOL_RECORD(S_CALLSITEINFO , 0x1139, CallSiteInfoSym)
> -SYMBOL_RECORD(S_FILESTATIC , 0x1153, FileStaticSym)
> -SYMBOL_RECORD(S_HEAPALLOCSITE , 0x115e, HeapAllocationSiteSym)
> -SYMBOL_RECORD(S_FRAMECOOKIE , 0x113a, FrameCookieSym)
> -
> -SYMBOL_RECORD(S_CALLEES , 0x115a, CallerSym)
> -SYMBOL_RECORD_ALIAS(S_CALLERS , 0x115b, CalleeSym, CallerSym)
> -
> -SYMBOL_RECORD(S_UDT , 0x1108, UDTSym)
> -SYMBOL_RECORD_ALIAS(S_COBOLUDT , 0x1109, CobolUDT, UDTSym)
> -
> -SYMBOL_RECORD(S_BUILDINFO , 0x114c, BuildInfoSym)
> -SYMBOL_RECORD(S_BPREL32 , 0x110b, BPRelativeSym)
> -SYMBOL_RECORD(S_REGREL32 , 0x1111, RegRelativeSym)
> -
> -SYMBOL_RECORD(S_CONSTANT , 0x1107, ConstantSym)
> -SYMBOL_RECORD_ALIAS(S_MANCONSTANT , 0x112d, ManagedConstant,
> ConstantSym)
> -
> -SYMBOL_RECORD(S_LDATA32 , 0x110c, DataSym)
> -SYMBOL_RECORD_ALIAS(S_GDATA32 , 0x110d, GlobalData, DataSym)
> -SYMBOL_RECORD_ALIAS(S_LMANDATA , 0x111c, ManagedLocalData, DataSym)
> -SYMBOL_RECORD_ALIAS(S_GMANDATA , 0x111d, ManagedGlobalData, DataSym)
> -
> -SYMBOL_RECORD(S_LTHREAD32 , 0x1112, ThreadLocalDataSym)
> -SYMBOL_RECORD_ALIAS(S_GTHREAD32 , 0x1113, GlobalTLS,
> ThreadLocalDataSym)
> -
> -
> -#undef CV_SYMBOL
> -#undef SYMBOL_RECORD
> -#undef SYMBOL_RECORD_ALIAS
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/CodeView.h?rev=304248&r1=
> 304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h Tue May 30
> 16:53:05 2017
> @@ -6,6 +6,10 @@
> // License. See LICENSE.TXT for details.
> //
> //===-------------------------------------------------------
> ---------------===//
> +//
> +// Defines constants and basic types describing CodeView debug
> information.
> +//
> +//===------------------------------------------------------
> ----------------===//
>
> #ifndef LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
> #define LLVM_DEBUGINFO_CODEVIEW_CODEVIEW_H
> @@ -22,28 +26,28 @@ namespace codeview {
> /// documentation and headers talk about this as the "leaf" type.
> enum class TypeRecordKind : uint16_t {
> #define TYPE_RECORD(lf_ename, value, name) name = value,
> -#include "TypeRecords.def"
> +#include "CodeViewTypes.def"
> };
>
> /// Duplicate copy of the above enum, but using the official CV names.
> Useful
> /// for reference purposes and when dealing with unknown record types.
> enum TypeLeafKind : uint16_t {
> #define CV_TYPE(name, val) name = val,
> -#include "TypeRecords.def"
> +#include "CodeViewTypes.def"
> };
>
> /// Distinguishes individual records in the Symbols subsection of a
> .debug$S
> /// section. Equivalent to SYM_ENUM_e in cvinfo.h.
> enum class SymbolRecordKind : uint16_t {
> #define SYMBOL_RECORD(lf_ename, value, name) name = value,
> -#include "CVSymbolTypes.def"
> +#include "CodeViewSymbols.def"
> };
>
> /// Duplicate copy of the above enum, but using the official CV names.
> Useful
> /// for reference purposes and when dealing with unknown record types.
> enum SymbolKind : uint16_t {
> #define CV_SYMBOL(name, val) name = val,
> -#include "CVSymbolTypes.def"
> +#include "CodeViewSymbols.def"
> };
>
> #define CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(Class)
> \
> @@ -280,7 +284,7 @@ CV_DEFINE_ENUM_CLASS_FLAGS_OPERATORS(Met
> /// Equivalent to CV_LABEL_TYPE_e.
> enum class LabelType : uint16_t {
> Near = 0x0,
> - Far = 0x4,
> + Far = 0x4,
> };
>
> /// Equivalent to CV_modifier_t.
>
> Added: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/CodeViewSymbols.def?rev=304248&view=auto
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def (added)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewSymbols.def Tue
> May 30 16:53:05 2017
> @@ -0,0 +1,258 @@
> +//===-- CVLeafTypes.def - All CodeView leaf types ---------------*- C++
> -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +//
> +// See LEAF_ENUM_e in cvinfo.h. This should match the constants there.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +
> +#ifndef CV_SYMBOL
> +#define CV_SYMBOL(ename, value)
> +#endif
> +
> +#ifndef SYMBOL_RECORD
> +#define SYMBOL_RECORD(lf_ename, value, name) CV_SYMBOL(lf_ename, value)
> +#endif
> +
> +#ifndef SYMBOL_RECORD_ALIAS
> +#define SYMBOL_RECORD_ALIAS(lf_ename, value, name, alias_name)
> \
> + SYMBOL_RECORD(lf_ename, value, name)
> +#endif
> +
> +// 16 bit symbol types. Not very useful, provided only for reference.
> +CV_SYMBOL(S_COMPILE , 0x0001)
> +CV_SYMBOL(S_REGISTER_16t , 0x0002)
> +CV_SYMBOL(S_CONSTANT_16t , 0x0003)
> +CV_SYMBOL(S_UDT_16t , 0x0004)
> +CV_SYMBOL(S_SSEARCH , 0x0005)
> +CV_SYMBOL(S_SKIP , 0x0007)
> +CV_SYMBOL(S_CVRESERVE , 0x0008)
> +CV_SYMBOL(S_OBJNAME_ST , 0x0009)
> +CV_SYMBOL(S_ENDARG , 0x000a)
> +CV_SYMBOL(S_COBOLUDT_16t , 0x000b)
> +CV_SYMBOL(S_MANYREG_16t , 0x000c)
> +CV_SYMBOL(S_RETURN , 0x000d)
> +CV_SYMBOL(S_ENTRYTHIS , 0x000e)
> +CV_SYMBOL(S_BPREL16 , 0x0100)
> +CV_SYMBOL(S_LDATA16 , 0x0101)
> +CV_SYMBOL(S_GDATA16 , 0x0102)
> +CV_SYMBOL(S_PUB16 , 0x0103)
> +CV_SYMBOL(S_LPROC16 , 0x0104)
> +CV_SYMBOL(S_GPROC16 , 0x0105)
> +CV_SYMBOL(S_THUNK16 , 0x0106)
> +CV_SYMBOL(S_BLOCK16 , 0x0107)
> +CV_SYMBOL(S_WITH16 , 0x0108)
> +CV_SYMBOL(S_LABEL16 , 0x0109)
> +CV_SYMBOL(S_CEXMODEL16 , 0x010a)
> +CV_SYMBOL(S_VFTABLE16 , 0x010b)
> +CV_SYMBOL(S_REGREL16 , 0x010c)
> +CV_SYMBOL(S_BPREL32_16t , 0x0200)
> +CV_SYMBOL(S_LDATA32_16t , 0x0201)
> +CV_SYMBOL(S_GDATA32_16t , 0x0202)
> +CV_SYMBOL(S_PUB32_16t , 0x0203)
> +CV_SYMBOL(S_LPROC32_16t , 0x0204)
> +CV_SYMBOL(S_GPROC32_16t , 0x0205)
> +CV_SYMBOL(S_THUNK32_ST , 0x0206)
> +CV_SYMBOL(S_BLOCK32_ST , 0x0207)
> +CV_SYMBOL(S_WITH32_ST , 0x0208)
> +CV_SYMBOL(S_LABEL32_ST , 0x0209)
> +CV_SYMBOL(S_CEXMODEL32 , 0x020a)
> +CV_SYMBOL(S_VFTABLE32_16t , 0x020b)
> +CV_SYMBOL(S_REGREL32_16t , 0x020c)
> +CV_SYMBOL(S_LTHREAD32_16t , 0x020d)
> +CV_SYMBOL(S_GTHREAD32_16t , 0x020e)
> +CV_SYMBOL(S_SLINK32 , 0x020f)
> +CV_SYMBOL(S_LPROCMIPS_16t , 0x0300)
> +CV_SYMBOL(S_GPROCMIPS_16t , 0x0301)
> +CV_SYMBOL(S_PROCREF_ST , 0x0400)
> +CV_SYMBOL(S_DATAREF_ST , 0x0401)
> +CV_SYMBOL(S_ALIGN , 0x0402)
> +CV_SYMBOL(S_LPROCREF_ST , 0x0403)
> +CV_SYMBOL(S_OEM , 0x0404)
> +
> +// All post 16 bit symbol types have the 0x1000 bit set.
> +CV_SYMBOL(S_TI16_MAX , 0x1000)
> +
> +// Mostly unused "start" symbol types.
> +CV_SYMBOL(S_REGISTER_ST , 0x1001)
> +CV_SYMBOL(S_CONSTANT_ST , 0x1002)
> +CV_SYMBOL(S_UDT_ST , 0x1003)
> +CV_SYMBOL(S_COBOLUDT_ST , 0x1004)
> +CV_SYMBOL(S_MANYREG_ST , 0x1005)
> +CV_SYMBOL(S_BPREL32_ST , 0x1006)
> +CV_SYMBOL(S_LDATA32_ST , 0x1007)
> +CV_SYMBOL(S_GDATA32_ST , 0x1008)
> +CV_SYMBOL(S_PUB32_ST , 0x1009)
> +CV_SYMBOL(S_LPROC32_ST , 0x100a)
> +CV_SYMBOL(S_GPROC32_ST , 0x100b)
> +CV_SYMBOL(S_VFTABLE32 , 0x100c)
> +CV_SYMBOL(S_REGREL32_ST , 0x100d)
> +CV_SYMBOL(S_LTHREAD32_ST , 0x100e)
> +CV_SYMBOL(S_GTHREAD32_ST , 0x100f)
> +CV_SYMBOL(S_LPROCMIPS_ST , 0x1010)
> +CV_SYMBOL(S_GPROCMIPS_ST , 0x1011)
> +
> +CV_SYMBOL(S_COMPILE2_ST , 0x1013)
> +CV_SYMBOL(S_MANYREG2_ST , 0x1014)
> +CV_SYMBOL(S_LPROCIA64_ST , 0x1015)
> +CV_SYMBOL(S_GPROCIA64_ST , 0x1016)
> +CV_SYMBOL(S_LOCALSLOT_ST , 0x1017)
> +CV_SYMBOL(S_PARAMSLOT_ST , 0x1018)
> +CV_SYMBOL(S_ANNOTATION , 0x1019)
> +CV_SYMBOL(S_GMANPROC_ST , 0x101a)
> +CV_SYMBOL(S_LMANPROC_ST , 0x101b)
> +CV_SYMBOL(S_RESERVED1 , 0x101c)
> +CV_SYMBOL(S_RESERVED2 , 0x101d)
> +CV_SYMBOL(S_RESERVED3 , 0x101e)
> +CV_SYMBOL(S_RESERVED4 , 0x101f)
> +CV_SYMBOL(S_LMANDATA_ST , 0x1020)
> +CV_SYMBOL(S_GMANDATA_ST , 0x1021)
> +CV_SYMBOL(S_MANFRAMEREL_ST, 0x1022)
> +CV_SYMBOL(S_MANREGISTER_ST, 0x1023)
> +CV_SYMBOL(S_MANSLOT_ST , 0x1024)
> +CV_SYMBOL(S_MANMANYREG_ST , 0x1025)
> +CV_SYMBOL(S_MANREGREL_ST , 0x1026)
> +CV_SYMBOL(S_MANMANYREG2_ST, 0x1027)
> +CV_SYMBOL(S_MANTYPREF , 0x1028)
> +CV_SYMBOL(S_UNAMESPACE_ST , 0x1029)
> +
> +// End of S_*_ST symbols, which do not appear to be generated by modern
> +// compilers.
> +CV_SYMBOL(S_ST_MAX , 0x1100)
> +
> +
> +CV_SYMBOL(S_WITH32 , 0x1104)
> +CV_SYMBOL(S_MANYREG , 0x110a)
> +CV_SYMBOL(S_LPROCMIPS , 0x1114)
> +CV_SYMBOL(S_GPROCMIPS , 0x1115)
> +CV_SYMBOL(S_MANYREG2 , 0x1117)
> +CV_SYMBOL(S_LPROCIA64 , 0x1118)
> +CV_SYMBOL(S_GPROCIA64 , 0x1119)
> +CV_SYMBOL(S_LOCALSLOT , 0x111a)
> +CV_SYMBOL(S_PARAMSLOT , 0x111b)
> +
> +// Managed code symbols.
> +CV_SYMBOL(S_MANFRAMEREL , 0x111e)
> +CV_SYMBOL(S_MANREGISTER , 0x111f)
> +CV_SYMBOL(S_MANSLOT , 0x1120)
> +CV_SYMBOL(S_MANMANYREG , 0x1121)
> +CV_SYMBOL(S_MANREGREL , 0x1122)
> +CV_SYMBOL(S_MANMANYREG2 , 0x1123)
> +CV_SYMBOL(S_UNAMESPACE , 0x1124)
> +CV_SYMBOL(S_DATAREF , 0x1126)
> +CV_SYMBOL(S_ANNOTATIONREF , 0x1128)
> +CV_SYMBOL(S_TOKENREF , 0x1129)
> +CV_SYMBOL(S_GMANPROC , 0x112a)
> +CV_SYMBOL(S_LMANPROC , 0x112b)
> +CV_SYMBOL(S_ATTR_FRAMEREL , 0x112e)
> +CV_SYMBOL(S_ATTR_REGISTER , 0x112f)
> +CV_SYMBOL(S_ATTR_REGREL , 0x1130)
> +CV_SYMBOL(S_ATTR_MANYREG , 0x1131)
> +
> +
> +CV_SYMBOL(S_SEPCODE , 0x1132)
> +CV_SYMBOL(S_LOCAL_2005 , 0x1133)
> +CV_SYMBOL(S_DEFRANGE_2005 , 0x1134)
> +CV_SYMBOL(S_DEFRANGE2_2005, 0x1135)
> +CV_SYMBOL(S_DISCARDED , 0x113b)
> +
> +// Current symbol types for most procedures as of this writing.
> +CV_SYMBOL(S_LPROCMIPS_ID , 0x1148)
> +CV_SYMBOL(S_GPROCMIPS_ID , 0x1149)
> +CV_SYMBOL(S_LPROCIA64_ID , 0x114a)
> +CV_SYMBOL(S_GPROCIA64_ID , 0x114b)
> +
> +CV_SYMBOL(S_DEFRANGE_HLSL , 0x1150)
> +CV_SYMBOL(S_GDATA_HLSL , 0x1151)
> +CV_SYMBOL(S_LDATA_HLSL , 0x1152)
> +CV_SYMBOL(S_LOCAL_DPC_GROUPSHARED, 0x1154)
> +CV_SYMBOL(S_DEFRANGE_DPC_PTR_TAG, 0x1157)
> +CV_SYMBOL(S_DPC_SYM_TAG_MAP, 0x1158)
> +CV_SYMBOL(S_ARMSWITCHTABLE , 0x1159)
> +CV_SYMBOL(S_POGODATA , 0x115c)
> +CV_SYMBOL(S_INLINESITE2 , 0x115d)
> +CV_SYMBOL(S_MOD_TYPEREF , 0x115f)
> +CV_SYMBOL(S_REF_MINIPDB , 0x1160)
> +CV_SYMBOL(S_PDBMAP , 0x1161)
> +CV_SYMBOL(S_GDATA_HLSL32 , 0x1162)
> +CV_SYMBOL(S_LDATA_HLSL32 , 0x1163)
> +CV_SYMBOL(S_GDATA_HLSL32_EX, 0x1164)
> +CV_SYMBOL(S_LDATA_HLSL32_EX, 0x1165)
> +
> +// Known symbol types
> +SYMBOL_RECORD(S_END , 0x0006, ScopeEndSym)
> +SYMBOL_RECORD_ALIAS(S_INLINESITE_END , 0x114e, InlineSiteEnd,
> ScopeEndSym)
> +SYMBOL_RECORD_ALIAS(S_PROC_ID_END , 0x114f, ProcEnd, ScopeEndSym)
> +
> +SYMBOL_RECORD(S_THUNK32 , 0x1102, Thunk32Sym)
> +SYMBOL_RECORD(S_TRAMPOLINE , 0x112c, TrampolineSym)
> +SYMBOL_RECORD(S_SECTION , 0x1136, SectionSym)
> +SYMBOL_RECORD(S_COFFGROUP , 0x1137, CoffGroupSym)
> +SYMBOL_RECORD(S_EXPORT , 0x1138, ExportSym)
> +
> +SYMBOL_RECORD(S_LPROC32 , 0x110f, ProcSym)
> +SYMBOL_RECORD_ALIAS(S_GPROC32 , 0x1110, GlobalProcSym, ProcSym)
> +SYMBOL_RECORD_ALIAS(S_LPROC32_ID , 0x1146, ProcIdSym, ProcSym)
> +SYMBOL_RECORD_ALIAS(S_GPROC32_ID , 0x1147, GlobalProcIdSym, ProcSym)
> +SYMBOL_RECORD_ALIAS(S_LPROC32_DPC , 0x1155, DPCProcSym, ProcSym)
> +SYMBOL_RECORD_ALIAS(S_LPROC32_DPC_ID , 0x1156, DPCProcIdSym, ProcSym)
> +
> +SYMBOL_RECORD(S_REGISTER , 0x1106, RegisterSym)
> +SYMBOL_RECORD(S_PUB32 , 0x110e, PublicSym32)
> +
> +SYMBOL_RECORD(S_PROCREF , 0x1125, ProcRefSym)
> +SYMBOL_RECORD_ALIAS(S_LPROCREF, 0x1127, LocalProcRef, ProcRefSym)
> +
> +
> +SYMBOL_RECORD(S_ENVBLOCK , 0x113d, EnvBlockSym)
> +
> +SYMBOL_RECORD(S_INLINESITE , 0x114d, InlineSiteSym)
> +SYMBOL_RECORD(S_LOCAL , 0x113e, LocalSym)
> +SYMBOL_RECORD(S_DEFRANGE , 0x113f, DefRangeSym)
> +SYMBOL_RECORD(S_DEFRANGE_SUBFIELD, 0x1140, DefRangeSubfieldSym)
> +SYMBOL_RECORD(S_DEFRANGE_REGISTER, 0x1141, DefRangeRegisterSym)
> +SYMBOL_RECORD(S_DEFRANGE_FRAMEPOINTER_REL, 0x1142,
> DefRangeFramePointerRelSym)
> +SYMBOL_RECORD(S_DEFRANGE_SUBFIELD_REGISTER, 0x1143,
> DefRangeSubfieldRegisterSym)
> +SYMBOL_RECORD(S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE, 0x1144,
> DefRangeFramePointerRelFullScopeSym)
> +SYMBOL_RECORD(S_DEFRANGE_REGISTER_REL, 0x1145, DefRangeRegisterRelSym)
> +SYMBOL_RECORD(S_BLOCK32 , 0x1103, BlockSym)
> +SYMBOL_RECORD(S_LABEL32 , 0x1105, LabelSym)
> +SYMBOL_RECORD(S_OBJNAME , 0x1101, ObjNameSym)
> +SYMBOL_RECORD(S_COMPILE2 , 0x1116, Compile2Sym)
> +SYMBOL_RECORD(S_COMPILE3 , 0x113c, Compile3Sym)
> +SYMBOL_RECORD(S_FRAMEPROC , 0x1012, FrameProcSym)
> +SYMBOL_RECORD(S_CALLSITEINFO , 0x1139, CallSiteInfoSym)
> +SYMBOL_RECORD(S_FILESTATIC , 0x1153, FileStaticSym)
> +SYMBOL_RECORD(S_HEAPALLOCSITE , 0x115e, HeapAllocationSiteSym)
> +SYMBOL_RECORD(S_FRAMECOOKIE , 0x113a, FrameCookieSym)
> +
> +SYMBOL_RECORD(S_CALLEES , 0x115a, CallerSym)
> +SYMBOL_RECORD_ALIAS(S_CALLERS , 0x115b, CalleeSym, CallerSym)
> +
> +SYMBOL_RECORD(S_UDT , 0x1108, UDTSym)
> +SYMBOL_RECORD_ALIAS(S_COBOLUDT , 0x1109, CobolUDT, UDTSym)
> +
> +SYMBOL_RECORD(S_BUILDINFO , 0x114c, BuildInfoSym)
> +SYMBOL_RECORD(S_BPREL32 , 0x110b, BPRelativeSym)
> +SYMBOL_RECORD(S_REGREL32 , 0x1111, RegRelativeSym)
> +
> +SYMBOL_RECORD(S_CONSTANT , 0x1107, ConstantSym)
> +SYMBOL_RECORD_ALIAS(S_MANCONSTANT , 0x112d, ManagedConstant,
> ConstantSym)
> +
> +SYMBOL_RECORD(S_LDATA32 , 0x110c, DataSym)
> +SYMBOL_RECORD_ALIAS(S_GDATA32 , 0x110d, GlobalData, DataSym)
> +SYMBOL_RECORD_ALIAS(S_LMANDATA , 0x111c, ManagedLocalData, DataSym)
> +SYMBOL_RECORD_ALIAS(S_GMANDATA , 0x111d, ManagedGlobalData, DataSym)
> +
> +SYMBOL_RECORD(S_LTHREAD32 , 0x1112, ThreadLocalDataSym)
> +SYMBOL_RECORD_ALIAS(S_GTHREAD32 , 0x1113, GlobalTLS,
> ThreadLocalDataSym)
> +
> +
> +#undef CV_SYMBOL
> +#undef SYMBOL_RECORD
> +#undef SYMBOL_RECORD_ALIAS
>
> Added: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewTypes.def
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/CodeViewTypes.def?rev=304248&view=auto
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewTypes.def (added)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeViewTypes.def Tue May
> 30 16:53:05 2017
> @@ -0,0 +1,251 @@
> +
> +//===-- CVLeafTypes.def - All CodeView leaf types ---------------*- C++
> -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +//
> +// See LEAF_ENUM_e in cvinfo.h. This should match the constants there.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +
> +// If the type is known, then we have a record describing it in
> TypeRecord.h.
> +
> +#ifndef CV_TYPE
> +#define CV_TYPE(lf_ename, value)
> +#endif
> +
> +// If the type is known, then we have a record describing it in
> TypeRecord.h.
> +#ifndef TYPE_RECORD
> +#define TYPE_RECORD(lf_ename, value, name) CV_TYPE(lf_ename, value)
> +#endif
> +
> +#ifndef TYPE_RECORD_ALIAS
> +#define TYPE_RECORD_ALIAS(lf_ename, value, name, alias_name)
> \
> + TYPE_RECORD(lf_ename, value, name)
> +#endif
> +
> +#ifndef MEMBER_RECORD
> +#define MEMBER_RECORD(lf_ename, value, name) TYPE_RECORD(lf_ename, value,
> name)
> +#endif
> +
> +#ifndef MEMBER_RECORD_ALIAS
> +#define MEMBER_RECORD_ALIAS(lf_ename, value, name, alias_name)
> \
> + MEMBER_RECORD(lf_ename, value, name)
> +#endif
> +
> +TYPE_RECORD(LF_POINTER, 0x1002, Pointer)
> +TYPE_RECORD(LF_MODIFIER, 0x1001, Modifier)
> +TYPE_RECORD(LF_PROCEDURE, 0x1008, Procedure)
> +TYPE_RECORD(LF_MFUNCTION, 0x1009, MemberFunction)
> +TYPE_RECORD(LF_LABEL, 0x000e, Label)
> +TYPE_RECORD(LF_ARGLIST, 0x1201, ArgList)
> +
> +TYPE_RECORD(LF_FIELDLIST, 0x1203, FieldList)
> +
> +TYPE_RECORD(LF_ARRAY, 0x1503, Array)
> +TYPE_RECORD(LF_CLASS, 0x1504, Class)
> +TYPE_RECORD_ALIAS(LF_STRUCTURE, 0x1505, Struct, Class)
> +TYPE_RECORD_ALIAS(LF_INTERFACE, 0x1519, Interface, Class)
> +TYPE_RECORD(LF_UNION, 0x1506, Union)
> +TYPE_RECORD(LF_ENUM, 0x1507, Enum)
> +TYPE_RECORD(LF_TYPESERVER2, 0x1515, TypeServer2)
> +TYPE_RECORD(LF_VFTABLE, 0x151d, VFTable)
> +TYPE_RECORD(LF_VTSHAPE, 0x000a, VFTableShape)
> +
> +TYPE_RECORD(LF_BITFIELD, 0x1205, BitField)
> +
> +// Member type records. These are generally not length prefixed, and
> appear
> +// inside of a field list record.
> +MEMBER_RECORD(LF_BCLASS, 0x1400, BaseClass)
> +MEMBER_RECORD_ALIAS(LF_BINTERFACE, 0x151a, BaseInterface, BaseClass)
> +
> +MEMBER_RECORD(LF_VBCLASS, 0x1401, VirtualBaseClass)
> +MEMBER_RECORD_ALIAS(LF_IVBCLASS, 0x1402, IndirectVirtualBaseClass,
> + VirtualBaseClass)
> +
> +MEMBER_RECORD(LF_VFUNCTAB, 0x1409, VFPtr)
> +MEMBER_RECORD(LF_STMEMBER, 0x150e, StaticDataMember)
> +MEMBER_RECORD(LF_METHOD, 0x150f, OverloadedMethod)
> +MEMBER_RECORD(LF_MEMBER, 0x150d, DataMember)
> +MEMBER_RECORD(LF_NESTTYPE, 0x1510, NestedType)
> +MEMBER_RECORD(LF_ONEMETHOD, 0x1511, OneMethod)
> +MEMBER_RECORD(LF_ENUMERATE, 0x1502, Enumerator)
> +MEMBER_RECORD(LF_INDEX, 0x1404, ListContinuation)
> +
> +// ID leaf records. Subsequent leaf types may be referenced from .debug$S.
> +TYPE_RECORD(LF_FUNC_ID, 0x1601, FuncId)
> +TYPE_RECORD(LF_MFUNC_ID, 0x1602, MemberFuncId)
> +TYPE_RECORD(LF_BUILDINFO, 0x1603, BuildInfo)
> +TYPE_RECORD(LF_SUBSTR_LIST, 0x1604, StringList)
> +TYPE_RECORD(LF_STRING_ID, 0x1605, StringId)
> +TYPE_RECORD(LF_UDT_SRC_LINE, 0x1606, UdtSourceLine)
> +TYPE_RECORD(LF_UDT_MOD_SRC_LINE, 0x1607, UdtModSourceLine)
> +
> +
> +TYPE_RECORD(LF_METHODLIST, 0x1206, MethodOverloadList)
> +
> +
> +// 16 bit type records.
> +CV_TYPE(LF_MODIFIER_16t, 0x0001)
> +CV_TYPE(LF_POINTER_16t, 0x0002)
> +CV_TYPE(LF_ARRAY_16t, 0x0003)
> +CV_TYPE(LF_CLASS_16t, 0x0004)
> +CV_TYPE(LF_STRUCTURE_16t, 0x0005)
> +CV_TYPE(LF_UNION_16t, 0x0006)
> +CV_TYPE(LF_ENUM_16t, 0x0007)
> +CV_TYPE(LF_PROCEDURE_16t, 0x0008)
> +CV_TYPE(LF_MFUNCTION_16t, 0x0009)
> +CV_TYPE(LF_COBOL0_16t, 0x000b)
> +CV_TYPE(LF_COBOL1, 0x000c)
> +CV_TYPE(LF_BARRAY_16t, 0x000d)
> +CV_TYPE(LF_NULLLEAF, 0x000f) // LF_NULL
> +CV_TYPE(LF_NOTTRAN, 0x0010)
> +CV_TYPE(LF_DIMARRAY_16t, 0x0011)
> +CV_TYPE(LF_VFTPATH_16t, 0x0012)
> +CV_TYPE(LF_PRECOMP_16t, 0x0013)
> +CV_TYPE(LF_ENDPRECOMP, 0x0014)
> +CV_TYPE(LF_OEM_16t, 0x0015)
> +CV_TYPE(LF_TYPESERVER_ST, 0x0016)
> +
> +CV_TYPE(LF_SKIP_16t, 0x0200)
> +CV_TYPE(LF_ARGLIST_16t, 0x0201)
> +CV_TYPE(LF_DEFARG_16t, 0x0202)
> +CV_TYPE(LF_LIST, 0x0203)
> +CV_TYPE(LF_FIELDLIST_16t, 0x0204)
> +CV_TYPE(LF_DERIVED_16t, 0x0205)
> +CV_TYPE(LF_BITFIELD_16t, 0x0206)
> +CV_TYPE(LF_METHODLIST_16t, 0x0207)
> +CV_TYPE(LF_DIMCONU_16t, 0x0208)
> +CV_TYPE(LF_DIMCONLU_16t, 0x0209)
> +CV_TYPE(LF_DIMVARU_16t, 0x020a)
> +CV_TYPE(LF_DIMVARLU_16t, 0x020b)
> +CV_TYPE(LF_REFSYM, 0x020c)
> +
> +// 16 bit member types. Generally not length prefixed.
> +CV_TYPE(LF_BCLASS_16t, 0x0400)
> +CV_TYPE(LF_VBCLASS_16t, 0x0401)
> +CV_TYPE(LF_IVBCLASS_16t, 0x0402)
> +CV_TYPE(LF_ENUMERATE_ST, 0x0403)
> +CV_TYPE(LF_FRIENDFCN_16t, 0x0404)
> +CV_TYPE(LF_INDEX_16t, 0x0405)
> +CV_TYPE(LF_MEMBER_16t, 0x0406)
> +CV_TYPE(LF_STMEMBER_16t, 0x0407)
> +CV_TYPE(LF_METHOD_16t, 0x0408)
> +CV_TYPE(LF_NESTTYPE_16t, 0x0409)
> +CV_TYPE(LF_VFUNCTAB_16t, 0x040a)
> +CV_TYPE(LF_FRIENDCLS_16t, 0x040b)
> +CV_TYPE(LF_ONEMETHOD_16t, 0x040c)
> +CV_TYPE(LF_VFUNCOFF_16t, 0x040d)
> +
> +CV_TYPE(LF_TI16_MAX, 0x1000)
> +
> +CV_TYPE(LF_ARRAY_ST, 0x1003)
> +CV_TYPE(LF_CLASS_ST, 0x1004)
> +CV_TYPE(LF_STRUCTURE_ST, 0x1005)
> +CV_TYPE(LF_UNION_ST, 0x1006)
> +CV_TYPE(LF_ENUM_ST, 0x1007)
> +CV_TYPE(LF_COBOL0, 0x100a)
> +CV_TYPE(LF_BARRAY, 0x100b)
> +CV_TYPE(LF_DIMARRAY_ST, 0x100c)
> +CV_TYPE(LF_VFTPATH, 0x100d)
> +CV_TYPE(LF_PRECOMP_ST, 0x100e)
> +CV_TYPE(LF_OEM, 0x100f)
> +CV_TYPE(LF_ALIAS_ST, 0x1010)
> +CV_TYPE(LF_OEM2, 0x1011)
> +
> +CV_TYPE(LF_SKIP, 0x1200)
> +CV_TYPE(LF_DEFARG_ST, 0x1202)
> +CV_TYPE(LF_DERIVED, 0x1204)
> +CV_TYPE(LF_DIMCONU, 0x1207)
> +CV_TYPE(LF_DIMCONLU, 0x1208)
> +CV_TYPE(LF_DIMVARU, 0x1209)
> +CV_TYPE(LF_DIMVARLU, 0x120a)
> +
> +// Member type records. These are generally not length prefixed, and
> appear
> +// inside of a field list record.
> +CV_TYPE(LF_FRIENDFCN_ST, 0x1403)
> +CV_TYPE(LF_MEMBER_ST, 0x1405)
> +CV_TYPE(LF_STMEMBER_ST, 0x1406)
> +CV_TYPE(LF_METHOD_ST, 0x1407)
> +CV_TYPE(LF_NESTTYPE_ST, 0x1408)
> +CV_TYPE(LF_FRIENDCLS, 0x140a)
> +CV_TYPE(LF_ONEMETHOD_ST, 0x140b)
> +CV_TYPE(LF_VFUNCOFF, 0x140c)
> +CV_TYPE(LF_NESTTYPEEX_ST, 0x140d)
> +CV_TYPE(LF_MEMBERMODIFY_ST, 0x140e)
> +CV_TYPE(LF_MANAGED_ST, 0x140f)
> +
> +CV_TYPE(LF_ST_MAX, 0x1500)
> +CV_TYPE(LF_TYPESERVER, 0x1501)
> +CV_TYPE(LF_DIMARRAY, 0x1508)
> +CV_TYPE(LF_PRECOMP, 0x1509)
> +CV_TYPE(LF_ALIAS, 0x150a)
> +CV_TYPE(LF_DEFARG, 0x150b)
> +CV_TYPE(LF_FRIENDFCN, 0x150c)
> +CV_TYPE(LF_NESTTYPEEX, 0x1512)
> +CV_TYPE(LF_MEMBERMODIFY, 0x1513)
> +CV_TYPE(LF_MANAGED, 0x1514)
> +CV_TYPE(LF_STRIDED_ARRAY, 0x1516)
> +CV_TYPE(LF_HLSL, 0x1517)
> +CV_TYPE(LF_MODIFIER_EX, 0x1518)
> +CV_TYPE(LF_VECTOR, 0x151b)
> +CV_TYPE(LF_MATRIX, 0x151c)
> +
> +// ID leaf records. Subsequent leaf types may be referenced from .debug$S.
> +
> +// Numeric leaf types. These are generally contained in other records,
> and not
> +// encountered in the main type stream.
> +
> +CV_TYPE(LF_NUMERIC, 0x8000)
> +CV_TYPE(LF_CHAR, 0x8000)
> +CV_TYPE(LF_SHORT, 0x8001)
> +CV_TYPE(LF_USHORT, 0x8002)
> +CV_TYPE(LF_LONG, 0x8003)
> +CV_TYPE(LF_ULONG, 0x8004)
> +CV_TYPE(LF_REAL32, 0x8005)
> +CV_TYPE(LF_REAL64, 0x8006)
> +CV_TYPE(LF_REAL80, 0x8007)
> +CV_TYPE(LF_REAL128, 0x8008)
> +CV_TYPE(LF_QUADWORD, 0x8009)
> +CV_TYPE(LF_UQUADWORD, 0x800a)
> +CV_TYPE(LF_REAL48, 0x800b)
> +CV_TYPE(LF_COMPLEX32, 0x800c)
> +CV_TYPE(LF_COMPLEX64, 0x800d)
> +CV_TYPE(LF_COMPLEX80, 0x800e)
> +CV_TYPE(LF_COMPLEX128, 0x800f)
> +CV_TYPE(LF_VARSTRING, 0x8010)
> +CV_TYPE(LF_OCTWORD, 0x8017)
> +CV_TYPE(LF_UOCTWORD, 0x8018)
> +CV_TYPE(LF_DECIMAL, 0x8019)
> +CV_TYPE(LF_DATE, 0x801a)
> +CV_TYPE(LF_UTF8STRING, 0x801b)
> +CV_TYPE(LF_REAL16, 0x801c)
> +
> +// Padding bytes. These are emitted into alignment bytes in the type
> stream.
> +
> +CV_TYPE(LF_PAD0, 0xf0)
> +CV_TYPE(LF_PAD1, 0xf1)
> +CV_TYPE(LF_PAD2, 0xf2)
> +CV_TYPE(LF_PAD3, 0xf3)
> +CV_TYPE(LF_PAD4, 0xf4)
> +CV_TYPE(LF_PAD5, 0xf5)
> +CV_TYPE(LF_PAD6, 0xf6)
> +CV_TYPE(LF_PAD7, 0xf7)
> +CV_TYPE(LF_PAD8, 0xf8)
> +CV_TYPE(LF_PAD9, 0xf9)
> +CV_TYPE(LF_PAD10, 0xfa)
> +CV_TYPE(LF_PAD11, 0xfb)
> +CV_TYPE(LF_PAD12, 0xfc)
> +CV_TYPE(LF_PAD13, 0xfd)
> +CV_TYPE(LF_PAD14, 0xfe)
> +CV_TYPE(LF_PAD15, 0xff)
> +
> +#undef CV_TYPE
> +#undef TYPE_RECORD
> +#undef TYPE_RECORD_ALIAS
> +#undef MEMBER_RECORD
> +#undef MEMBER_RECORD_ALIAS
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/SymbolDeserializer.h?rev=
> 304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolDeserializer.h Tue
> May 30 16:53:05 2017
> @@ -54,7 +54,7 @@ public:
> return visitKnownRecordImpl(CVR, Record);
> \
> }
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
>
> private:
> template <typename T> Error visitKnownRecordImpl(CVSymbol &CVR, T
> &Record) {
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/SymbolRecordMapping.h?rev=
> 304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolRecordMapping.h Tue
> May 30 16:53:05 2017
> @@ -29,7 +29,7 @@ public:
> #define SYMBOL_RECORD(EnumName, EnumVal, Name)
> \
> Error visitKnownRecord(CVSymbol &CVR, Name &Record) override;
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
>
> private:
> Optional<SymbolKind> Kind;
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/SymbolSerializer.h?rev=304248&
> r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolSerializer.h Tue May
> 30 16:53:05 2017
> @@ -55,7 +55,7 @@ public:
> return visitKnownRecordImpl(CVR, Record);
> \
> }
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
>
> private:
> template <typename RecordKind>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/
> SymbolVisitorCallbackPipeline.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.
> h?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/
> SymbolVisitorCallbackPipeline.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/
> SymbolVisitorCallbackPipeline.h Tue May 30 16:53:05 2017
> @@ -59,7 +59,7 @@ public:
> return Error::success();
> \
> }
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
>
> private:
> std::vector<SymbolVisitorCallbacks *> Pipeline;
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/
> SymbolVisitorCallbacks.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h?rev=
> 304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/SymbolVisitorCallbacks.h
> Tue May 30 16:53:05 2017
> @@ -39,7 +39,7 @@ public:
> return Error::success();
> \
> }
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
> };
>
> } // end namespace codeview
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h?rev=
> 304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDatabaseVisitor.h Tue
> May 30 16:53:05 2017
> @@ -39,7 +39,7 @@ public:
> Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record)
> override;
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> StringRef getTypeName(TypeIndex Index) const;
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeDeserializer.h?rev=304248&
> r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDeserializer.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDeserializer.h Tue May
> 30 16:53:05 2017
> @@ -41,6 +41,7 @@ public:
> TypeDeserializer() = default;
>
> template <typename T> static Error deserializeAs(CVType &CVT, T
> &Record) {
> + Record.Kind = static_cast<TypeRecordKind>(CVT.kind());
> MappingInfo I(CVT.content());
> if (auto EC = I.Mapping.visitTypeBegin(CVT))
> return EC;
> @@ -75,7 +76,7 @@ public:
> #define MEMBER_RECORD(EnumName, EnumVal, Name)
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> template <typename RecordType>
> @@ -127,7 +128,7 @@ public:
> }
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> template <typename RecordType>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeDumpVisitor.h?rev=304248&
> r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeDumpVisitor.h Tue May
> 30 16:53:05 2017
> @@ -58,7 +58,7 @@ public:
> Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record)
> override;
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> void printMemberAttributes(MemberAttributes Attrs);
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeRecord.h?rev=304248&r1=
> 304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h Tue May 30
> 16:53:05 2017
> @@ -123,13 +123,13 @@ protected:
> public:
> TypeRecordKind getKind() const { return Kind; }
>
> -private:
> TypeRecordKind Kind;
> };
>
> // LF_MODIFIER
> class ModifierRecord : public TypeRecord {
> public:
> + ModifierRecord() = default;
> explicit ModifierRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> ModifierRecord(TypeIndex ModifiedType, ModifierOptions Modifiers)
> : TypeRecord(TypeRecordKind::Modifier), ModifiedType(ModifiedType),
> @@ -145,6 +145,7 @@ public:
> // LF_PROCEDURE
> class ProcedureRecord : public TypeRecord {
> public:
> + ProcedureRecord() = default;
> explicit ProcedureRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> ProcedureRecord(TypeIndex ReturnType, CallingConvention CallConv,
> FunctionOptions Options, uint16_t ParameterCount,
> @@ -169,6 +170,7 @@ public:
> // LF_MFUNCTION
> class MemberFunctionRecord : public TypeRecord {
> public:
> + MemberFunctionRecord() = default;
> explicit MemberFunctionRecord(TypeRecordKind Kind) : TypeRecord(Kind)
> {}
>
> MemberFunctionRecord(TypeIndex ReturnType, TypeIndex ClassType,
> @@ -203,6 +205,7 @@ public:
> // LF_LABEL
> class LabelRecord : public TypeRecord {
> public:
> + LabelRecord() = default;
> explicit LabelRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
>
> LabelRecord(LabelType Mode) : TypeRecord(TypeRecordKind::Label),
> Mode(Mode) {}
> @@ -213,6 +216,7 @@ public:
> // LF_MFUNC_ID
> class MemberFuncIdRecord : public TypeRecord {
> public:
> + MemberFuncIdRecord() = default;
> explicit MemberFuncIdRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> MemberFuncIdRecord(TypeIndex ClassType, TypeIndex FunctionType,
> StringRef Name)
> @@ -230,6 +234,7 @@ public:
> // LF_ARGLIST
> class ArgListRecord : public TypeRecord {
> public:
> + ArgListRecord() = default;
> explicit ArgListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
>
> ArgListRecord(TypeRecordKind Kind, ArrayRef<TypeIndex> Indices)
> @@ -243,6 +248,7 @@ public:
> // LF_SUBSTR_LIST
> class StringListRecord : public TypeRecord {
> public:
> + StringListRecord() = default;
> explicit StringListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
>
> StringListRecord(TypeRecordKind Kind, ArrayRef<TypeIndex> Indices)
> @@ -267,6 +273,7 @@ public:
> static const uint32_t PointerSizeShift = 13;
> static const uint32_t PointerSizeMask = 0xFF;
>
> + PointerRecord() = default;
> explicit PointerRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
>
> PointerRecord(TypeIndex ReferentType, uint32_t Attrs)
> @@ -341,6 +348,7 @@ private:
> // LF_NESTTYPE
> class NestedTypeRecord : public TypeRecord {
> public:
> + NestedTypeRecord() = default;
> explicit NestedTypeRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> NestedTypeRecord(TypeIndex Type, StringRef Name)
> : TypeRecord(TypeRecordKind::NestedType), Type(Type), Name(Name) {}
> @@ -355,6 +363,7 @@ public:
> // LF_FIELDLIST
> class FieldListRecord : public TypeRecord {
> public:
> + FieldListRecord() = default;
> explicit FieldListRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> explicit FieldListRecord(ArrayRef<uint8_t> Data)
> : TypeRecord(TypeRecordKind::FieldList), Data(Data) {}
> @@ -365,6 +374,7 @@ public:
> // LF_ARRAY
> class ArrayRecord : public TypeRecord {
> public:
> + ArrayRecord() = default;
> explicit ArrayRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> ArrayRecord(TypeIndex ElementType, TypeIndex IndexType, uint64_t Size,
> StringRef Name)
> @@ -384,6 +394,7 @@ public:
>
> class TagRecord : public TypeRecord {
> protected:
> + TagRecord() = default;
> explicit TagRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> TagRecord(TypeRecordKind Kind, uint16_t MemberCount, ClassOptions
> Options,
> TypeIndex FieldList, StringRef Name, StringRef UniqueName)
> @@ -416,6 +427,7 @@ public:
> // LF_CLASS, LF_STRUCTURE, LF_INTERFACE
> class ClassRecord : public TagRecord {
> public:
> + ClassRecord() = default;
> explicit ClassRecord(TypeRecordKind Kind) : TagRecord(Kind) {}
> ClassRecord(TypeRecordKind Kind, uint16_t MemberCount, ClassOptions
> Options,
> TypeIndex FieldList, TypeIndex DerivationList,
> @@ -447,6 +459,7 @@ public:
>
> // LF_UNION
> struct UnionRecord : public TagRecord {
> + UnionRecord() = default;
> explicit UnionRecord(TypeRecordKind Kind) : TagRecord(Kind) {}
> UnionRecord(uint16_t MemberCount, ClassOptions Options, TypeIndex
> FieldList,
> uint64_t Size, StringRef Name, StringRef UniqueName)
> @@ -468,6 +481,7 @@ struct UnionRecord : public TagRecord {
> // LF_ENUM
> class EnumRecord : public TagRecord {
> public:
> + EnumRecord() = default;
> explicit EnumRecord(TypeRecordKind Kind) : TagRecord(Kind) {}
> EnumRecord(uint16_t MemberCount, ClassOptions Options, TypeIndex
> FieldList,
> StringRef Name, StringRef UniqueName, TypeIndex
> UnderlyingType)
> @@ -482,6 +496,7 @@ public:
> // LF_BITFIELD
> class BitFieldRecord : public TypeRecord {
> public:
> + BitFieldRecord() = default;
> explicit BitFieldRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> BitFieldRecord(TypeIndex Type, uint8_t BitSize, uint8_t BitOffset)
> : TypeRecord(TypeRecordKind::BitField), Type(Type),
> BitSize(BitSize),
> @@ -498,6 +513,7 @@ public:
> // LF_VTSHAPE
> class VFTableShapeRecord : public TypeRecord {
> public:
> + VFTableShapeRecord() = default;
> explicit VFTableShapeRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> explicit VFTableShapeRecord(ArrayRef<VFTableSlotKind> Slots)
> : TypeRecord(TypeRecordKind::VFTableShape), SlotsRef(Slots) {}
> @@ -518,6 +534,7 @@ public:
> // LF_TYPESERVER2
> class TypeServer2Record : public TypeRecord {
> public:
> + TypeServer2Record() = default;
> explicit TypeServer2Record(TypeRecordKind Kind) : TypeRecord(Kind) {}
> TypeServer2Record(StringRef Guid, uint32_t Age, StringRef Name)
> : TypeRecord(TypeRecordKind::TypeServer2), Guid(Guid), Age(Age),
> @@ -537,6 +554,7 @@ public:
> // LF_STRING_ID
> class StringIdRecord : public TypeRecord {
> public:
> + StringIdRecord() = default;
> explicit StringIdRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> StringIdRecord(TypeIndex Id, StringRef String)
> : TypeRecord(TypeRecordKind::StringId), Id(Id), String(String) {}
> @@ -551,6 +569,7 @@ public:
> // LF_FUNC_ID
> class FuncIdRecord : public TypeRecord {
> public:
> + FuncIdRecord() = default;
> explicit FuncIdRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> FuncIdRecord(TypeIndex ParentScope, TypeIndex FunctionType, StringRef
> Name)
> : TypeRecord(TypeRecordKind::FuncId), ParentScope(ParentScope),
> @@ -570,6 +589,7 @@ public:
> // LF_UDT_SRC_LINE
> class UdtSourceLineRecord : public TypeRecord {
> public:
> + UdtSourceLineRecord() = default;
> explicit UdtSourceLineRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> UdtSourceLineRecord(TypeIndex UDT, TypeIndex SourceFile, uint32_t
> LineNumber)
> : TypeRecord(TypeRecordKind::UdtSourceLine), UDT(UDT),
> @@ -587,6 +607,7 @@ public:
> // LF_UDT_MOD_SRC_LINE
> class UdtModSourceLineRecord : public TypeRecord {
> public:
> + UdtModSourceLineRecord() = default;
> explicit UdtModSourceLineRecord(TypeRecordKind Kind) :
> TypeRecord(Kind) {}
> UdtModSourceLineRecord(TypeIndex UDT, TypeIndex SourceFile,
> uint32_t LineNumber, uint16_t Module)
> @@ -607,6 +628,7 @@ public:
> // LF_BUILDINFO
> class BuildInfoRecord : public TypeRecord {
> public:
> + BuildInfoRecord() = default;
> explicit BuildInfoRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> BuildInfoRecord(ArrayRef<TypeIndex> ArgIndices)
> : TypeRecord(TypeRecordKind::BuildInfo),
> @@ -619,6 +641,7 @@ public:
> // LF_VFTABLE
> class VFTableRecord : public TypeRecord {
> public:
> + VFTableRecord() = default;
> explicit VFTableRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> VFTableRecord(TypeIndex CompleteClass, TypeIndex OverriddenVFTable,
> uint32_t VFPtrOffset, StringRef Name,
> @@ -646,7 +669,7 @@ public:
> // LF_ONEMETHOD
> class OneMethodRecord : public TypeRecord {
> public:
> - OneMethodRecord() : TypeRecord(TypeRecordKind::OneMethod) {}
> + OneMethodRecord() = default;
> explicit OneMethodRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> OneMethodRecord(TypeIndex Type, MemberAttributes Attrs, int32_t
> VFTableOffset,
> StringRef Name)
> @@ -678,6 +701,7 @@ public:
> // LF_METHODLIST
> class MethodOverloadListRecord : public TypeRecord {
> public:
> + MethodOverloadListRecord() = default;
> explicit MethodOverloadListRecord(TypeRecordKind Kind) :
> TypeRecord(Kind) {}
> MethodOverloadListRecord(ArrayRef<OneMethodRecord> Methods)
> : TypeRecord(TypeRecordKind::MethodOverloadList), Methods(Methods)
> {}
> @@ -689,6 +713,7 @@ public:
> /// For method overload sets. LF_METHOD
> class OverloadedMethodRecord : public TypeRecord {
> public:
> + OverloadedMethodRecord() = default;
> explicit OverloadedMethodRecord(TypeRecordKind Kind) :
> TypeRecord(Kind) {}
> OverloadedMethodRecord(uint16_t NumOverloads, TypeIndex MethodList,
> StringRef Name)
> @@ -706,6 +731,7 @@ public:
> // LF_MEMBER
> class DataMemberRecord : public TypeRecord {
> public:
> + DataMemberRecord() = default;
> explicit DataMemberRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> DataMemberRecord(MemberAttributes Attrs, TypeIndex Type, uint64_t
> Offset,
> StringRef Name)
> @@ -730,6 +756,7 @@ public:
> // LF_STMEMBER
> class StaticDataMemberRecord : public TypeRecord {
> public:
> + StaticDataMemberRecord() = default;
> explicit StaticDataMemberRecord(TypeRecordKind Kind) :
> TypeRecord(Kind) {}
> StaticDataMemberRecord(MemberAttributes Attrs, TypeIndex Type,
> StringRef Name)
> : TypeRecord(TypeRecordKind::StaticDataMember), Attrs(Attrs),
> Type(Type),
> @@ -750,6 +777,7 @@ public:
> // LF_ENUMERATE
> class EnumeratorRecord : public TypeRecord {
> public:
> + EnumeratorRecord() = default;
> explicit EnumeratorRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> EnumeratorRecord(MemberAttributes Attrs, APSInt Value, StringRef Name)
> : TypeRecord(TypeRecordKind::Enumerator), Attrs(Attrs),
> @@ -770,6 +798,7 @@ public:
> // LF_VFUNCTAB
> class VFPtrRecord : public TypeRecord {
> public:
> + VFPtrRecord() = default;
> explicit VFPtrRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> VFPtrRecord(TypeIndex Type)
> : TypeRecord(TypeRecordKind::VFPtr), Type(Type) {}
> @@ -782,6 +811,7 @@ public:
> // LF_BCLASS, LF_BINTERFACE
> class BaseClassRecord : public TypeRecord {
> public:
> + BaseClassRecord() = default;
> explicit BaseClassRecord(TypeRecordKind Kind) : TypeRecord(Kind) {}
> BaseClassRecord(MemberAttributes Attrs, TypeIndex Type, uint64_t
> Offset)
> : TypeRecord(TypeRecordKind::BaseClass), Attrs(Attrs), Type(Type),
> @@ -802,6 +832,7 @@ public:
> // LF_VBCLASS, LF_IVBCLASS
> class VirtualBaseClassRecord : public TypeRecord {
> public:
> + VirtualBaseClassRecord() = default;
> explicit VirtualBaseClassRecord(TypeRecordKind Kind) :
> TypeRecord(Kind) {}
> VirtualBaseClassRecord(TypeRecordKind Kind, MemberAttributes Attrs,
> TypeIndex BaseType, TypeIndex VBPtrType,
> @@ -831,6 +862,7 @@ public:
> /// together. The first will end in an LF_INDEX record that points to the
> next.
> class ListContinuationRecord : public TypeRecord {
> public:
> + ListContinuationRecord() = default;
> explicit ListContinuationRecord(TypeRecordKind Kind) :
> TypeRecord(Kind) {}
> ListContinuationRecord(TypeIndex ContinuationIndex)
> : TypeRecord(TypeRecordKind::ListContinuation),
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeRecordMapping.h?rev=
> 304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecordMapping.h Tue
> May 30 16:53:05 2017
> @@ -37,7 +37,7 @@ public:
> Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record)
> override;
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> Optional<TypeLeafKind> TypeKind;
>
> Removed: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeRecords.def?rev=304247&view=auto
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecords.def (removed)
> @@ -1,251 +0,0 @@
> -
> -//===-- CVLeafTypes.def - All CodeView leaf types ---------------*- C++
> -*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -//
> -// See LEAF_ENUM_e in cvinfo.h. This should match the constants there.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -
> -// If the type is known, then we have a record describing it in
> TypeRecord.h.
> -
> -#ifndef CV_TYPE
> -#define CV_TYPE(lf_ename, value)
> -#endif
> -
> -// If the type is known, then we have a record describing it in
> TypeRecord.h.
> -#ifndef TYPE_RECORD
> -#define TYPE_RECORD(lf_ename, value, name) CV_TYPE(lf_ename, value)
> -#endif
> -
> -#ifndef TYPE_RECORD_ALIAS
> -#define TYPE_RECORD_ALIAS(lf_ename, value, name, alias_name)
> \
> - TYPE_RECORD(lf_ename, value, name)
> -#endif
> -
> -#ifndef MEMBER_RECORD
> -#define MEMBER_RECORD(lf_ename, value, name) TYPE_RECORD(lf_ename, value,
> name)
> -#endif
> -
> -#ifndef MEMBER_RECORD_ALIAS
> -#define MEMBER_RECORD_ALIAS(lf_ename, value, name, alias_name)
> \
> - MEMBER_RECORD(lf_ename, value, name)
> -#endif
> -
> -TYPE_RECORD(LF_POINTER, 0x1002, Pointer)
> -TYPE_RECORD(LF_MODIFIER, 0x1001, Modifier)
> -TYPE_RECORD(LF_PROCEDURE, 0x1008, Procedure)
> -TYPE_RECORD(LF_MFUNCTION, 0x1009, MemberFunction)
> -TYPE_RECORD(LF_LABEL, 0x000e, Label)
> -TYPE_RECORD(LF_ARGLIST, 0x1201, ArgList)
> -
> -TYPE_RECORD(LF_FIELDLIST, 0x1203, FieldList)
> -
> -TYPE_RECORD(LF_ARRAY, 0x1503, Array)
> -TYPE_RECORD(LF_CLASS, 0x1504, Class)
> -TYPE_RECORD_ALIAS(LF_STRUCTURE, 0x1505, Struct, Class)
> -TYPE_RECORD_ALIAS(LF_INTERFACE, 0x1519, Interface, Class)
> -TYPE_RECORD(LF_UNION, 0x1506, Union)
> -TYPE_RECORD(LF_ENUM, 0x1507, Enum)
> -TYPE_RECORD(LF_TYPESERVER2, 0x1515, TypeServer2)
> -TYPE_RECORD(LF_VFTABLE, 0x151d, VFTable)
> -TYPE_RECORD(LF_VTSHAPE, 0x000a, VFTableShape)
> -
> -TYPE_RECORD(LF_BITFIELD, 0x1205, BitField)
> -
> -// Member type records. These are generally not length prefixed, and
> appear
> -// inside of a field list record.
> -MEMBER_RECORD(LF_BCLASS, 0x1400, BaseClass)
> -MEMBER_RECORD_ALIAS(LF_BINTERFACE, 0x151a, BaseInterface, BaseClass)
> -
> -MEMBER_RECORD(LF_VBCLASS, 0x1401, VirtualBaseClass)
> -MEMBER_RECORD_ALIAS(LF_IVBCLASS, 0x1402, IndirectVirtualBaseClass,
> - VirtualBaseClass)
> -
> -MEMBER_RECORD(LF_VFUNCTAB, 0x1409, VFPtr)
> -MEMBER_RECORD(LF_STMEMBER, 0x150e, StaticDataMember)
> -MEMBER_RECORD(LF_METHOD, 0x150f, OverloadedMethod)
> -MEMBER_RECORD(LF_MEMBER, 0x150d, DataMember)
> -MEMBER_RECORD(LF_NESTTYPE, 0x1510, NestedType)
> -MEMBER_RECORD(LF_ONEMETHOD, 0x1511, OneMethod)
> -MEMBER_RECORD(LF_ENUMERATE, 0x1502, Enumerator)
> -MEMBER_RECORD(LF_INDEX, 0x1404, ListContinuation)
> -
> -// ID leaf records. Subsequent leaf types may be referenced from .debug$S.
> -TYPE_RECORD(LF_FUNC_ID, 0x1601, FuncId)
> -TYPE_RECORD(LF_MFUNC_ID, 0x1602, MemberFuncId)
> -TYPE_RECORD(LF_BUILDINFO, 0x1603, BuildInfo)
> -TYPE_RECORD(LF_SUBSTR_LIST, 0x1604, StringList)
> -TYPE_RECORD(LF_STRING_ID, 0x1605, StringId)
> -TYPE_RECORD(LF_UDT_SRC_LINE, 0x1606, UdtSourceLine)
> -TYPE_RECORD(LF_UDT_MOD_SRC_LINE, 0x1607, UdtModSourceLine)
> -
> -
> -TYPE_RECORD(LF_METHODLIST, 0x1206, MethodOverloadList)
> -
> -
> -// 16 bit type records.
> -CV_TYPE(LF_MODIFIER_16t, 0x0001)
> -CV_TYPE(LF_POINTER_16t, 0x0002)
> -CV_TYPE(LF_ARRAY_16t, 0x0003)
> -CV_TYPE(LF_CLASS_16t, 0x0004)
> -CV_TYPE(LF_STRUCTURE_16t, 0x0005)
> -CV_TYPE(LF_UNION_16t, 0x0006)
> -CV_TYPE(LF_ENUM_16t, 0x0007)
> -CV_TYPE(LF_PROCEDURE_16t, 0x0008)
> -CV_TYPE(LF_MFUNCTION_16t, 0x0009)
> -CV_TYPE(LF_COBOL0_16t, 0x000b)
> -CV_TYPE(LF_COBOL1, 0x000c)
> -CV_TYPE(LF_BARRAY_16t, 0x000d)
> -CV_TYPE(LF_NULLLEAF, 0x000f) // LF_NULL
> -CV_TYPE(LF_NOTTRAN, 0x0010)
> -CV_TYPE(LF_DIMARRAY_16t, 0x0011)
> -CV_TYPE(LF_VFTPATH_16t, 0x0012)
> -CV_TYPE(LF_PRECOMP_16t, 0x0013)
> -CV_TYPE(LF_ENDPRECOMP, 0x0014)
> -CV_TYPE(LF_OEM_16t, 0x0015)
> -CV_TYPE(LF_TYPESERVER_ST, 0x0016)
> -
> -CV_TYPE(LF_SKIP_16t, 0x0200)
> -CV_TYPE(LF_ARGLIST_16t, 0x0201)
> -CV_TYPE(LF_DEFARG_16t, 0x0202)
> -CV_TYPE(LF_LIST, 0x0203)
> -CV_TYPE(LF_FIELDLIST_16t, 0x0204)
> -CV_TYPE(LF_DERIVED_16t, 0x0205)
> -CV_TYPE(LF_BITFIELD_16t, 0x0206)
> -CV_TYPE(LF_METHODLIST_16t, 0x0207)
> -CV_TYPE(LF_DIMCONU_16t, 0x0208)
> -CV_TYPE(LF_DIMCONLU_16t, 0x0209)
> -CV_TYPE(LF_DIMVARU_16t, 0x020a)
> -CV_TYPE(LF_DIMVARLU_16t, 0x020b)
> -CV_TYPE(LF_REFSYM, 0x020c)
> -
> -// 16 bit member types. Generally not length prefixed.
> -CV_TYPE(LF_BCLASS_16t, 0x0400)
> -CV_TYPE(LF_VBCLASS_16t, 0x0401)
> -CV_TYPE(LF_IVBCLASS_16t, 0x0402)
> -CV_TYPE(LF_ENUMERATE_ST, 0x0403)
> -CV_TYPE(LF_FRIENDFCN_16t, 0x0404)
> -CV_TYPE(LF_INDEX_16t, 0x0405)
> -CV_TYPE(LF_MEMBER_16t, 0x0406)
> -CV_TYPE(LF_STMEMBER_16t, 0x0407)
> -CV_TYPE(LF_METHOD_16t, 0x0408)
> -CV_TYPE(LF_NESTTYPE_16t, 0x0409)
> -CV_TYPE(LF_VFUNCTAB_16t, 0x040a)
> -CV_TYPE(LF_FRIENDCLS_16t, 0x040b)
> -CV_TYPE(LF_ONEMETHOD_16t, 0x040c)
> -CV_TYPE(LF_VFUNCOFF_16t, 0x040d)
> -
> -CV_TYPE(LF_TI16_MAX, 0x1000)
> -
> -CV_TYPE(LF_ARRAY_ST, 0x1003)
> -CV_TYPE(LF_CLASS_ST, 0x1004)
> -CV_TYPE(LF_STRUCTURE_ST, 0x1005)
> -CV_TYPE(LF_UNION_ST, 0x1006)
> -CV_TYPE(LF_ENUM_ST, 0x1007)
> -CV_TYPE(LF_COBOL0, 0x100a)
> -CV_TYPE(LF_BARRAY, 0x100b)
> -CV_TYPE(LF_DIMARRAY_ST, 0x100c)
> -CV_TYPE(LF_VFTPATH, 0x100d)
> -CV_TYPE(LF_PRECOMP_ST, 0x100e)
> -CV_TYPE(LF_OEM, 0x100f)
> -CV_TYPE(LF_ALIAS_ST, 0x1010)
> -CV_TYPE(LF_OEM2, 0x1011)
> -
> -CV_TYPE(LF_SKIP, 0x1200)
> -CV_TYPE(LF_DEFARG_ST, 0x1202)
> -CV_TYPE(LF_DERIVED, 0x1204)
> -CV_TYPE(LF_DIMCONU, 0x1207)
> -CV_TYPE(LF_DIMCONLU, 0x1208)
> -CV_TYPE(LF_DIMVARU, 0x1209)
> -CV_TYPE(LF_DIMVARLU, 0x120a)
> -
> -// Member type records. These are generally not length prefixed, and
> appear
> -// inside of a field list record.
> -CV_TYPE(LF_FRIENDFCN_ST, 0x1403)
> -CV_TYPE(LF_MEMBER_ST, 0x1405)
> -CV_TYPE(LF_STMEMBER_ST, 0x1406)
> -CV_TYPE(LF_METHOD_ST, 0x1407)
> -CV_TYPE(LF_NESTTYPE_ST, 0x1408)
> -CV_TYPE(LF_FRIENDCLS, 0x140a)
> -CV_TYPE(LF_ONEMETHOD_ST, 0x140b)
> -CV_TYPE(LF_VFUNCOFF, 0x140c)
> -CV_TYPE(LF_NESTTYPEEX_ST, 0x140d)
> -CV_TYPE(LF_MEMBERMODIFY_ST, 0x140e)
> -CV_TYPE(LF_MANAGED_ST, 0x140f)
> -
> -CV_TYPE(LF_ST_MAX, 0x1500)
> -CV_TYPE(LF_TYPESERVER, 0x1501)
> -CV_TYPE(LF_DIMARRAY, 0x1508)
> -CV_TYPE(LF_PRECOMP, 0x1509)
> -CV_TYPE(LF_ALIAS, 0x150a)
> -CV_TYPE(LF_DEFARG, 0x150b)
> -CV_TYPE(LF_FRIENDFCN, 0x150c)
> -CV_TYPE(LF_NESTTYPEEX, 0x1512)
> -CV_TYPE(LF_MEMBERMODIFY, 0x1513)
> -CV_TYPE(LF_MANAGED, 0x1514)
> -CV_TYPE(LF_STRIDED_ARRAY, 0x1516)
> -CV_TYPE(LF_HLSL, 0x1517)
> -CV_TYPE(LF_MODIFIER_EX, 0x1518)
> -CV_TYPE(LF_VECTOR, 0x151b)
> -CV_TYPE(LF_MATRIX, 0x151c)
> -
> -// ID leaf records. Subsequent leaf types may be referenced from .debug$S.
> -
> -// Numeric leaf types. These are generally contained in other records,
> and not
> -// encountered in the main type stream.
> -
> -CV_TYPE(LF_NUMERIC, 0x8000)
> -CV_TYPE(LF_CHAR, 0x8000)
> -CV_TYPE(LF_SHORT, 0x8001)
> -CV_TYPE(LF_USHORT, 0x8002)
> -CV_TYPE(LF_LONG, 0x8003)
> -CV_TYPE(LF_ULONG, 0x8004)
> -CV_TYPE(LF_REAL32, 0x8005)
> -CV_TYPE(LF_REAL64, 0x8006)
> -CV_TYPE(LF_REAL80, 0x8007)
> -CV_TYPE(LF_REAL128, 0x8008)
> -CV_TYPE(LF_QUADWORD, 0x8009)
> -CV_TYPE(LF_UQUADWORD, 0x800a)
> -CV_TYPE(LF_REAL48, 0x800b)
> -CV_TYPE(LF_COMPLEX32, 0x800c)
> -CV_TYPE(LF_COMPLEX64, 0x800d)
> -CV_TYPE(LF_COMPLEX80, 0x800e)
> -CV_TYPE(LF_COMPLEX128, 0x800f)
> -CV_TYPE(LF_VARSTRING, 0x8010)
> -CV_TYPE(LF_OCTWORD, 0x8017)
> -CV_TYPE(LF_UOCTWORD, 0x8018)
> -CV_TYPE(LF_DECIMAL, 0x8019)
> -CV_TYPE(LF_DATE, 0x801a)
> -CV_TYPE(LF_UTF8STRING, 0x801b)
> -CV_TYPE(LF_REAL16, 0x801c)
> -
> -// Padding bytes. These are emitted into alignment bytes in the type
> stream.
> -
> -CV_TYPE(LF_PAD0, 0xf0)
> -CV_TYPE(LF_PAD1, 0xf1)
> -CV_TYPE(LF_PAD2, 0xf2)
> -CV_TYPE(LF_PAD3, 0xf3)
> -CV_TYPE(LF_PAD4, 0xf4)
> -CV_TYPE(LF_PAD5, 0xf5)
> -CV_TYPE(LF_PAD6, 0xf6)
> -CV_TYPE(LF_PAD7, 0xf7)
> -CV_TYPE(LF_PAD8, 0xf8)
> -CV_TYPE(LF_PAD9, 0xf9)
> -CV_TYPE(LF_PAD10, 0xfa)
> -CV_TYPE(LF_PAD11, 0xfb)
> -CV_TYPE(LF_PAD12, 0xfc)
> -CV_TYPE(LF_PAD13, 0xfd)
> -CV_TYPE(LF_PAD14, 0xfe)
> -CV_TYPE(LF_PAD15, 0xff)
> -
> -#undef CV_TYPE
> -#undef TYPE_RECORD
> -#undef TYPE_RECORD_ALIAS
> -#undef MEMBER_RECORD
> -#undef MEMBER_RECORD_ALIAS
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeSerializer.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeSerializer.h?rev=304248&
> r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeSerializer.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeSerializer.h Tue May
> 30 16:53:05 2017
> @@ -106,7 +106,7 @@ public:
> return visitKnownMemberImpl<Name##Record>(CVR, Record);
> \
> }
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> template <typename RecordKind>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeTableBuilder.h?rev=304248&
> r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeTableBuilder.h Tue May
> 30 16:53:05 2017
> @@ -13,8 +13,8 @@
> #include "llvm/ADT/ArrayRef.h"
> #include "llvm/DebugInfo/CodeView/CodeView.h"
> #include "llvm/DebugInfo/CodeView/TypeIndex.h"
> -#include "llvm/DebugInfo/CodeView/TypeSerializer.h"
> #include "llvm/DebugInfo/CodeView/TypeRecord.h"
> +#include "llvm/DebugInfo/CodeView/TypeSerializer.h"
> #include "llvm/Support/Allocator.h"
> #include "llvm/Support/Error.h"
> #include <algorithm>
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/
> TypeVisitorCallbackPipeline.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h?
> rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h
> Tue May 30 16:53:05 2017
> @@ -94,7 +94,7 @@ public:
> }
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> template <typename T> Error visitKnownRecordImpl(CVType &CVR, T
> &Record) {
>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/
> TypeVisitorCallbacks.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h?rev=
> 304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h
> (original)
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h Tue
> May 30 16:53:05 2017
> @@ -58,7 +58,11 @@ public:
>
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> +#undef TYPE_RECORD
> +#undef TYPE_RECORD_ALIAS
> +#undef MEMBER_RECORD
> +#undef MEMBER_RECORD_ALIAS
> };
>
> } // end namespace codeview
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Native/RawConstants.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/PDB/Native/RawConstants.h?rev=304248&r1=
> 304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Native/RawConstants.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/RawConstants.h Tue May
> 30 16:53:05 2017
> @@ -12,7 +12,6 @@
>
> #include "llvm/ADT/BitmaskEnum.h"
> #include "llvm/DebugInfo/CodeView/CodeView.h"
> -
> #include <cstdint>
>
> namespace llvm {
>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/Native/TpiHashing.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/DebugInfo/PDB/Native/TpiHashing.h?rev=304248&r1=
> 304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/DebugInfo/PDB/Native/TpiHashing.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/Native/TpiHashing.h Tue May 30
> 16:53:05 2017
> @@ -38,7 +38,7 @@ public:
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> #define MEMBER_RECORD(EnumName, EnumVal, Name)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
>
> private:
> template <typename RecordKind>
>
> Added: llvm/trunk/include/llvm/ObjectYAML/CodeViewYAML.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/ObjectYAML/CodeViewYAML.h?rev=304248&view=auto
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/ObjectYAML/CodeViewYAML.h (added)
> +++ llvm/trunk/include/llvm/ObjectYAML/CodeViewYAML.h Tue May 30 16:53:05
> 2017
> @@ -0,0 +1,141 @@
> +//===- CodeViewYAML.cpp - CodeView YAMLIO implementation
> ------------------===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +//
> +// This file defines classes for handling the YAML representation of
> CodeView
> +// Debug Info.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +
> +#ifndef LLVM_OBJECTYAML_CODEVIEWYAML_H
> +#define LLVM_OBJECTYAML_CODEVIEWYAML_H
> +
> +#include "llvm/DebugInfo/CodeView/CodeView.h"
> +#include "llvm/DebugInfo/CodeView/TypeDeserializer.h"
> +#include "llvm/DebugInfo/CodeView/TypeRecord.h"
> +#include "llvm/DebugInfo/CodeView/TypeSerializer.h"
> +#include "llvm/DebugInfo/CodeView/TypeTableBuilder.h"
> +#include "llvm/ObjectYAML/YAML.h"
> +
> +namespace llvm {
> +namespace CodeViewYAML {
> +
> +namespace detail {
> +struct MemberRecordBase;
> +struct LeafRecordBase;
> +}
> +
> +struct SourceLineEntry {
> + uint32_t Offset;
> + uint32_t LineStart;
> + uint32_t EndDelta;
> + bool IsStatement;
> +};
> +
> +struct SourceColumnEntry {
> + uint16_t StartColumn;
> + uint16_t EndColumn;
> +};
> +
> +struct SourceLineBlock {
> + StringRef FileName;
> + std::vector<SourceLineEntry> Lines;
> + std::vector<SourceColumnEntry> Columns;
> +};
> +
> +struct HexFormattedString {
> + std::vector<uint8_t> Bytes;
> +};
> +
> +struct SourceFileChecksumEntry {
> + StringRef FileName;
> + codeview::FileChecksumKind Kind;
> + HexFormattedString ChecksumBytes;
> +};
> +
> +struct SourceLineInfo {
> + uint32_t RelocOffset;
> + uint32_t RelocSegment;
> + codeview::LineFlags Flags;
> + uint32_t CodeSize;
> +
> + std::vector<SourceLineBlock> Blocks;
> +};
> +
> +struct InlineeSite {
> + uint32_t Inlinee;
> + StringRef FileName;
> + uint32_t SourceLineNum;
> + std::vector<StringRef> ExtraFiles;
> +};
> +
> +struct InlineeInfo {
> + bool HasExtraFiles;
> + std::vector<InlineeSite> Sites;
> +};
> +
> +struct SourceFileInfo {
> + std::vector<SourceFileChecksumEntry> FileChecksums;
> + std::vector<SourceLineInfo> LineFragments;
> + std::vector<InlineeInfo> Inlinees;
> +};
> +
> +struct MemberRecord {
> + std::shared_ptr<detail::MemberRecordBase> Member;
> +};
> +
> +struct LeafRecord {
> + std::shared_ptr<detail::LeafRecordBase> Leaf;
> +
> + codeview::CVType toCodeViewRecord(BumpPtrAllocator &Allocator) const;
> + static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
> +};
> +
> +} // namespace CodeViewYAML
> +} // namespace llvm
> +
> +LLVM_YAML_DECLARE_SCALAR_TRAITS(codeview::TypeIndex, false)
> +LLVM_YAML_DECLARE_SCALAR_TRAITS(CodeViewYAML::HexFormattedString, false)
> +LLVM_YAML_DECLARE_SCALAR_TRAITS(APSInt, false)
> +
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineEntry)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceColumnEntry)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceFileChecksumEntry)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineInfo)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineBlock)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceFileInfo)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::InlineeInfo)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::InlineeSite)
> +
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::LeafRecord)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::MemberRecord)
> +
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::TypeLeafKind)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::PointerToMemberRepresentation)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::VFTableSlotKind)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::CallingConvention)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::PointerKind)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::PointerMode)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::HfaKind)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::MemberAccess)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::MethodKind)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::WindowsRTClassKind)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::LabelType)
> +LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::FileChecksumKind)
> +
> +LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::PointerOptions)
> +LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::LineFlags)
> +LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::ModifierOptions)
> +LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::FunctionOptions)
> +LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::ClassOptions)
> +LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::MethodOptions)
> +
> +LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::LeafRecord)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::MemberRecord)
> +
> +#endif
>
> Modified: llvm/trunk/include/llvm/Support/YAMLTraits.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/Support/YAMLTraits.h?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/Support/YAMLTraits.h (original)
> +++ llvm/trunk/include/llvm/Support/YAMLTraits.h Tue May 30 16:53:05 2017
> @@ -1606,6 +1606,44 @@ template <typename T> struct StdMapStrin
> }
> \
> }
>
> +#define LLVM_YAML_DECLARE_MAPPING_TRAITS(Type)
> \
> + namespace llvm {
> \
> + namespace yaml {
> \
> + template <> struct MappingTraits<Type> {
> \
> + static void mapping(IO &IO, Type &Obj);
> \
> + };
> \
> + }
> \
> + }
> +
> +#define LLVM_YAML_DECLARE_ENUM_TRAITS(Type)
> \
> + namespace llvm {
> \
> + namespace yaml {
> \
> + template <> struct ScalarEnumerationTraits<Type> {
> \
> + static void enumeration(IO &io, Type &Value);
> \
> + };
> \
> + }
> \
> + }
> +
> +#define LLVM_YAML_DECLARE_BITSET_TRAITS(Type)
> \
> + namespace llvm {
> \
> + namespace yaml {
> \
> + template <> struct ScalarBitSetTraits<Type> {
> \
> + static void bitset(IO &IO, Type &Options);
> \
> + };
> \
> + }
> \
> + }
> +
> +#define LLVM_YAML_DECLARE_SCALAR_TRAITS(Type, MustQuote)
> \
> + namespace llvm {
> \
> + namespace yaml {
> \
> + template <> struct ScalarTraits<Type> {
> \
> + static void output(const Type &Value, void *ctx, llvm::raw_ostream
> &Out); \
> + static StringRef input(StringRef Scalar, void *ctxt, Type &Value);
> \
> + static bool mustQuote(StringRef) { return MustQuote; }
> \
> + };
> \
> + }
> \
> + }
> +
> /// Utility for declaring that a std::vector of a particular type
> /// should be considered a YAML document list.
> #define LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(_type)
> \
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> DebugInfo/CodeView/CVSymbolVisitor.cpp?rev=304248&r1=304247&r2=304248&
> view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp Tue May 30
> 16:53:05 2017
> @@ -46,7 +46,7 @@ Error CVSymbolVisitor::visitSymbolRecord
> }
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> \
> SYMBOL_RECORD(EnumVal, EnumVal, AliasName)
> -#include "llvm/DebugInfo/CodeView/CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
> }
>
> if (auto EC = Callbacks.visitSymbolEnd(Record))
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/CVTypeVisitor.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> DebugInfo/CodeView/CVTypeVisitor.cpp?rev=304248&
> r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/DebugInfo/CodeView/CVTypeVisitor.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/CVTypeVisitor.cpp Tue May 30
> 16:53:05 2017
> @@ -71,7 +71,7 @@ static Error visitMemberRecord(CVMemberR
> MEMBER_RECORD(EnumVal, EnumVal, AliasName)
> #define TYPE_RECORD(EnumName, EnumVal, Name)
> #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> }
>
> if (auto EC = Callbacks.visitMemberEnd(Record))
> @@ -155,7 +155,7 @@ Error CVTypeVisitor::finishVisitation(CV
> TYPE_RECORD(EnumVal, EnumVal, AliasName)
> #define MEMBER_RECORD(EnumName, EnumVal, Name)
> #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> }
>
> if (auto EC = Callbacks.visitTypeEnd(Record))
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> DebugInfo/CodeView/EnumTables.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/EnumTables.cpp Tue May 30 16:53:05
> 2017
> @@ -20,13 +20,13 @@ using namespace codeview;
>
> static const EnumEntry<SymbolKind> SymbolTypeNames[] = {
> #define CV_SYMBOL(enum, val) {#enum, enum},
> -#include "llvm/DebugInfo/CodeView/CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
> #undef CV_SYMBOL
> };
>
> static const EnumEntry<TypeLeafKind> TypeLeafNames[] = {
> #define CV_TYPE(name, val) {#name, name},
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> #undef CV_TYPE
> };
>
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> DebugInfo/CodeView/SymbolDumper.cpp?rev=304248&
> r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/SymbolDumper.cpp Tue May 30
> 16:53:05 2017
> @@ -41,7 +41,7 @@ public:
> #define SYMBOL_RECORD(EnumName, EnumVal, Name)
> \
> Error visitKnownRecord(CVSymbol &CVR, Name &Record) override;
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
>
> Error visitSymbolBegin(CVSymbol &Record) override;
> Error visitSymbolEnd(CVSymbol &Record) override;
>
> Modified: llvm/trunk/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> DebugInfo/CodeView/TypeDumpVisitor.cpp?rev=304248&r1=304247&r2=304248&
> view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp Tue May 30
> 16:53:05 2017
> @@ -26,7 +26,7 @@ using namespace llvm::codeview;
>
> static const EnumEntry<TypeLeafKind> LeafTypeNames[] = {
> #define CV_TYPE(enum, val) {#enum, enum},
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> };
>
> #define ENUM_ENTRY(enum_class, enum)
> \
> @@ -155,7 +155,7 @@ static StringRef getLeafTypeName(TypeLea
> #define TYPE_RECORD(ename, value, name)
> \
> case ename:
> \
> return #name;
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> default:
> break;
> }
>
> Modified: llvm/trunk/lib/MC/MCCodeView.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/
> MCCodeView.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/MC/MCCodeView.cpp (original)
> +++ llvm/trunk/lib/MC/MCCodeView.cpp Tue May 30 16:53:05 2017
> @@ -12,11 +12,11 @@
> //===-------------------------------------------------------
> ---------------===//
>
> #include "llvm/MC/MCCodeView.h"
> -#include "llvm/MC/MCAsmLayout.h"
> #include "llvm/ADT/STLExtras.h"
> #include "llvm/DebugInfo/CodeView/CodeView.h"
> #include "llvm/DebugInfo/CodeView/Line.h"
> #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
> +#include "llvm/MC/MCAsmLayout.h"
> #include "llvm/MC/MCContext.h"
> #include "llvm/MC/MCObjectStreamer.h"
> #include "llvm/MC/MCValue.h"
>
> Modified: llvm/trunk/lib/ObjectYAML/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> ObjectYAML/CMakeLists.txt?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/ObjectYAML/CMakeLists.txt (original)
> +++ llvm/trunk/lib/ObjectYAML/CMakeLists.txt Tue May 30 16:53:05 2017
> @@ -1,4 +1,5 @@
> add_llvm_library(LLVMObjectYAML
> + CodeViewYAML.cpp
> COFFYAML.cpp
> DWARFEmitter.cpp
> DWARFVisitor.cpp
>
> Added: llvm/trunk/lib/ObjectYAML/CodeViewYAML.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> ObjectYAML/CodeViewYAML.cpp?rev=304248&view=auto
> ============================================================
> ==================
> --- llvm/trunk/lib/ObjectYAML/CodeViewYAML.cpp (added)
> +++ llvm/trunk/lib/ObjectYAML/CodeViewYAML.cpp Tue May 30 16:53:05 2017
> @@ -0,0 +1,759 @@
> +//===- CodeViewYAML.cpp - CodeView YAMLIO implementation
> ------------------===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +//
> +// This file defines classes for handling the YAML representation of
> CodeView
> +// Debug Info.
> +//
> +//===------------------------------------------------------
> ----------------===//
> +
> +#include "llvm/ObjectYAML/CodeViewYAML.h"
> +#include "llvm/ADT/StringExtras.h"
> +#include "llvm/ADT/StringSwitch.h"
> +#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
> +#include "llvm/DebugInfo/CodeView/CodeViewError.h"
> +
> +using namespace llvm;
> +using namespace llvm::codeview;
> +using namespace llvm::CodeViewYAML;
> +using namespace llvm::CodeViewYAML::detail;
> +using namespace llvm::yaml;
> +
> +LLVM_YAML_IS_SEQUENCE_VECTOR(SourceFileChecksumEntry)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(SourceLineEntry)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(SourceColumnEntry)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(SourceLineBlock)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(SourceLineInfo)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(InlineeSite)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(InlineeInfo)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(OneMethodRecord)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(StringRef)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(uint32_t)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(VFTableSlotKind)
> +LLVM_YAML_IS_SEQUENCE_VECTOR(TypeIndex)
> +
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::codeview::OneMethodRecord)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::codeview::MemberPointerInfo)
> +
> +namespace llvm {
> +namespace CodeViewYAML {
> +namespace detail {
> +
> +struct LeafRecordBase {
> + TypeLeafKind Kind;
> + explicit LeafRecordBase(TypeLeafKind K) : Kind(K) {}
> +
> + virtual ~LeafRecordBase() {}
> + virtual void map(yaml::IO &io) = 0;
> + virtual CVType toCodeViewRecord(BumpPtrAllocator &Allocator) const = 0;
> + virtual Error fromCodeViewRecord(CVType Type) = 0;
> +};
> +
> +template <typename T> struct LeafRecordImpl : public LeafRecordBase {
> + explicit LeafRecordImpl(TypeLeafKind K)
> + : LeafRecordBase(K), Record(static_cast<TypeRecordKind>(K)) {}
> +
> + void map(yaml::IO &io) override;
> +
> + Error fromCodeViewRecord(CVType Type) override {
> + return TypeDeserializer::deserializeAs<T>(Type, Record);
> + }
> +
> + CVType toCodeViewRecord(BumpPtrAllocator &Allocator) const override {
> + TypeTableBuilder Table(Allocator);
> + Table.writeKnownType(Record);
> + return CVType(Kind, Table.records().front());
> + }
> +
> + mutable T Record;
> +};
> +
> +template <> struct LeafRecordImpl<FieldListRecord> : public
> LeafRecordBase {
> + explicit LeafRecordImpl(TypeLeafKind K) : LeafRecordBase(K) {}
> +
> + void map(yaml::IO &io) override;
> + CVType toCodeViewRecord(BumpPtrAllocator &Allocator) const override;
> + Error fromCodeViewRecord(CVType Type) override;
> +
> + std::vector<MemberRecord> Members;
> +};
> +
> +struct MemberRecordBase {
> + TypeLeafKind Kind;
> + explicit MemberRecordBase(TypeLeafKind K) : Kind(K) {}
> +
> + virtual ~MemberRecordBase() {}
> + virtual void map(yaml::IO &io) = 0;
> + virtual void writeTo(FieldListRecordBuilder &FLRB) = 0;
> +};
> +
> +template <typename T> struct MemberRecordImpl : public MemberRecordBase {
> + explicit MemberRecordImpl(TypeLeafKind K)
> + : MemberRecordBase(K), Record(static_cast<TypeRecordKind>(K)) {}
> + void map(yaml::IO &io) override;
> +
> + void writeTo(FieldListRecordBuilder &FLRB) override {
> + FLRB.writeMemberType(Record);
> + }
> +
> + mutable T Record;
> +};
> +}
> +}
> +}
> +
> +void ScalarTraits<TypeIndex>::output(const TypeIndex &S, void *,
> + llvm::raw_ostream &OS) {
> + OS << S.getIndex();
> +}
> +
> +StringRef ScalarTraits<TypeIndex>::input(StringRef Scalar, void *Ctx,
> + TypeIndex &S) {
> + uint32_t I;
> + StringRef Result = ScalarTraits<uint32_t>::input(Scalar, Ctx, I);
> + S.setIndex(I);
> + return Result;
> +}
> +
> +void ScalarTraits<APSInt>::output(const APSInt &S, void *,
> + llvm::raw_ostream &OS) {
> + S.print(OS, true);
> +}
> +
> +StringRef ScalarTraits<APSInt>::input(StringRef Scalar, void *Ctx,
> APSInt &S) {
> + S = APSInt(Scalar);
> + return "";
> +}
> +
> +void ScalarEnumerationTraits<TypeLeafKind>::enumeration(IO &io,
> + TypeLeafKind
> &Value) {
> +#define CV_TYPE(name, val) io.enumCase(Value, #name, name);
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> +#undef CV_TYPE
> +}
> +
> +void ScalarEnumerationTraits<PointerToMemberRepresentation>::enumeration(
> + IO &IO, PointerToMemberRepresentation &Value) {
> + IO.enumCase(Value, "Unknown", PointerToMemberRepresentation::Unknown);
> + IO.enumCase(Value, "SingleInheritanceData",
> + PointerToMemberRepresentation::SingleInheritanceData);
> + IO.enumCase(Value, "MultipleInheritanceData",
> + PointerToMemberRepresentation::MultipleInheritanceData);
> + IO.enumCase(Value, "VirtualInheritanceData",
> + PointerToMemberRepresentation::VirtualInheritanceData);
> + IO.enumCase(Value, "GeneralData", PointerToMemberRepresentation:
> :GeneralData);
> + IO.enumCase(Value, "SingleInheritanceFunction",
> + PointerToMemberRepresentation::SingleInheritanceFunction);
> + IO.enumCase(Value, "MultipleInheritanceFunction",
> + PointerToMemberRepresentation:
> :MultipleInheritanceFunction);
> + IO.enumCase(Value, "VirtualInheritanceFunction",
> + PointerToMemberRepresentation::VirtualInheritanceFunction);
> + IO.enumCase(Value, "GeneralFunction",
> + PointerToMemberRepresentation::GeneralFunction);
> +}
> +
> +void ScalarEnumerationTraits<VFTableSlotKind>::enumeration(
> + IO &IO, VFTableSlotKind &Kind) {
> + IO.enumCase(Kind, "Near16", VFTableSlotKind::Near16);
> + IO.enumCase(Kind, "Far16", VFTableSlotKind::Far16);
> + IO.enumCase(Kind, "This", VFTableSlotKind::This);
> + IO.enumCase(Kind, "Outer", VFTableSlotKind::Outer);
> + IO.enumCase(Kind, "Meta", VFTableSlotKind::Meta);
> + IO.enumCase(Kind, "Near", VFTableSlotKind::Near);
> + IO.enumCase(Kind, "Far", VFTableSlotKind::Far);
> +}
> +
> +void ScalarEnumerationTraits<CallingConvention>::enumeration(
> + IO &IO, CallingConvention &Value) {
> + IO.enumCase(Value, "NearC", CallingConvention::NearC);
> + IO.enumCase(Value, "FarC", CallingConvention::FarC);
> + IO.enumCase(Value, "NearPascal", CallingConvention::NearPascal);
> + IO.enumCase(Value, "FarPascal", CallingConvention::FarPascal);
> + IO.enumCase(Value, "NearFast", CallingConvention::NearFast);
> + IO.enumCase(Value, "FarFast", CallingConvention::FarFast);
> + IO.enumCase(Value, "NearStdCall", CallingConvention::NearStdCall);
> + IO.enumCase(Value, "FarStdCall", CallingConvention::FarStdCall);
> + IO.enumCase(Value, "NearSysCall", CallingConvention::NearSysCall);
> + IO.enumCase(Value, "FarSysCall", CallingConvention::FarSysCall);
> + IO.enumCase(Value, "ThisCall", CallingConvention::ThisCall);
> + IO.enumCase(Value, "MipsCall", CallingConvention::MipsCall);
> + IO.enumCase(Value, "Generic", CallingConvention::Generic);
> + IO.enumCase(Value, "AlphaCall", CallingConvention::AlphaCall);
> + IO.enumCase(Value, "PpcCall", CallingConvention::PpcCall);
> + IO.enumCase(Value, "SHCall", CallingConvention::SHCall);
> + IO.enumCase(Value, "ArmCall", CallingConvention::ArmCall);
> + IO.enumCase(Value, "AM33Call", CallingConvention::AM33Call);
> + IO.enumCase(Value, "TriCall", CallingConvention::TriCall);
> + IO.enumCase(Value, "SH5Call", CallingConvention::SH5Call);
> + IO.enumCase(Value, "M32RCall", CallingConvention::M32RCall);
> + IO.enumCase(Value, "ClrCall", CallingConvention::ClrCall);
> + IO.enumCase(Value, "Inline", CallingConvention::Inline);
> + IO.enumCase(Value, "NearVector", CallingConvention::NearVector);
> +}
> +
> +void ScalarEnumerationTraits<PointerKind>::enumeration(IO &IO,
> + PointerKind &Kind)
> {
> + IO.enumCase(Kind, "Near16", PointerKind::Near16);
> + IO.enumCase(Kind, "Far16", PointerKind::Far16);
> + IO.enumCase(Kind, "Huge16", PointerKind::Huge16);
> + IO.enumCase(Kind, "BasedOnSegment", PointerKind::BasedOnSegment);
> + IO.enumCase(Kind, "BasedOnValue", PointerKind::BasedOnValue);
> + IO.enumCase(Kind, "BasedOnSegmentValue", PointerKind::
> BasedOnSegmentValue);
> + IO.enumCase(Kind, "BasedOnAddress", PointerKind::BasedOnAddress);
> + IO.enumCase(Kind, "BasedOnSegmentAddress",
> + PointerKind::BasedOnSegmentAddress);
> + IO.enumCase(Kind, "BasedOnType", PointerKind::BasedOnType);
> + IO.enumCase(Kind, "BasedOnSelf", PointerKind::BasedOnSelf);
> + IO.enumCase(Kind, "Near32", PointerKind::Near32);
> + IO.enumCase(Kind, "Far32", PointerKind::Far32);
> + IO.enumCase(Kind, "Near64", PointerKind::Near64);
> +}
> +
> +void ScalarEnumerationTraits<PointerMode>::enumeration(IO &IO,
> + PointerMode &Mode)
> {
> + IO.enumCase(Mode, "Pointer", PointerMode::Pointer);
> + IO.enumCase(Mode, "LValueReference", PointerMode::LValueReference);
> + IO.enumCase(Mode, "PointerToDataMember", PointerMode::
> PointerToDataMember);
> + IO.enumCase(Mode, "PointerToMemberFunction",
> + PointerMode::PointerToMemberFunction);
> + IO.enumCase(Mode, "RValueReference", PointerMode::RValueReference);
> +}
> +
> +void ScalarEnumerationTraits<HfaKind>::enumeration(IO &IO, HfaKind
> &Value) {
> + IO.enumCase(Value, "None", HfaKind::None);
> + IO.enumCase(Value, "Float", HfaKind::Float);
> + IO.enumCase(Value, "Double", HfaKind::Double);
> + IO.enumCase(Value, "Other", HfaKind::Other);
> +}
> +
> +void ScalarEnumerationTraits<MemberAccess>::enumeration(IO &IO,
> + MemberAccess
> &Access) {
> + IO.enumCase(Access, "None", MemberAccess::None);
> + IO.enumCase(Access, "Private", MemberAccess::Private);
> + IO.enumCase(Access, "Protected", MemberAccess::Protected);
> + IO.enumCase(Access, "Public", MemberAccess::Public);
> +}
> +
> +void ScalarEnumerationTraits<MethodKind>::enumeration(IO &IO,
> + MethodKind &Kind) {
> + IO.enumCase(Kind, "Vanilla", MethodKind::Vanilla);
> + IO.enumCase(Kind, "Virtual", MethodKind::Virtual);
> + IO.enumCase(Kind, "Static", MethodKind::Static);
> + IO.enumCase(Kind, "Friend", MethodKind::Friend);
> + IO.enumCase(Kind, "IntroducingVirtual", MethodKind::
> IntroducingVirtual);
> + IO.enumCase(Kind, "PureVirtual", MethodKind::PureVirtual);
> + IO.enumCase(Kind, "PureIntroducingVirtual",
> + MethodKind::PureIntroducingVirtual);
> +}
> +
> +void ScalarEnumerationTraits<WindowsRTClassKind>::enumeration(
> + IO &IO, WindowsRTClassKind &Value) {
> + IO.enumCase(Value, "None", WindowsRTClassKind::None);
> + IO.enumCase(Value, "Ref", WindowsRTClassKind::RefClass);
> + IO.enumCase(Value, "Value", WindowsRTClassKind::ValueClass);
> + IO.enumCase(Value, "Interface", WindowsRTClassKind::Interface);
> +}
> +
> +void ScalarEnumerationTraits<LabelType>::enumeration(IO &IO, LabelType
> &Value) {
> + IO.enumCase(Value, "Near", LabelType::Near);
> + IO.enumCase(Value, "Far", LabelType::Far);
> +}
> +
> +void ScalarBitSetTraits<PointerOptions>::bitset(IO &IO,
> + PointerOptions &Options) {
> + IO.bitSetCase(Options, "None", PointerOptions::None);
> + IO.bitSetCase(Options, "Flat32", PointerOptions::Flat32);
> + IO.bitSetCase(Options, "Volatile", PointerOptions::Volatile);
> + IO.bitSetCase(Options, "Const", PointerOptions::Const);
> + IO.bitSetCase(Options, "Unaligned", PointerOptions::Unaligned);
> + IO.bitSetCase(Options, "Restrict", PointerOptions::Restrict);
> + IO.bitSetCase(Options, "WinRTSmartPointer",
> + PointerOptions::WinRTSmartPointer);
> +}
> +
> +void ScalarBitSetTraits<ModifierOptions>::bitset(IO &IO,
> + ModifierOptions
> &Options) {
> + IO.bitSetCase(Options, "None", ModifierOptions::None);
> + IO.bitSetCase(Options, "Const", ModifierOptions::Const);
> + IO.bitSetCase(Options, "Volatile", ModifierOptions::Volatile);
> + IO.bitSetCase(Options, "Unaligned", ModifierOptions::Unaligned);
> +}
> +
> +void ScalarBitSetTraits<FunctionOptions>::bitset(IO &IO,
> + FunctionOptions
> &Options) {
> + IO.bitSetCase(Options, "None", FunctionOptions::None);
> + IO.bitSetCase(Options, "CxxReturnUdt", FunctionOptions::CxxReturnUdt);
> + IO.bitSetCase(Options, "Constructor", FunctionOptions::Constructor);
> + IO.bitSetCase(Options, "ConstructorWithVirtualBases",
> + FunctionOptions::ConstructorWithVirtualBases);
> +}
> +
> +void ScalarBitSetTraits<ClassOptions>::bitset(IO &IO, ClassOptions
> &Options) {
> + IO.bitSetCase(Options, "None", ClassOptions::None);
> + IO.bitSetCase(Options, "HasConstructorOrDestructor",
> + ClassOptions::HasConstructorOrDestructor);
> + IO.bitSetCase(Options, "HasOverloadedOperator",
> + ClassOptions::HasOverloadedOperator);
> + IO.bitSetCase(Options, "Nested", ClassOptions::Nested);
> + IO.bitSetCase(Options, "ContainsNestedClass",
> + ClassOptions::ContainsNestedClass);
> + IO.bitSetCase(Options, "HasOverloadedAssignmentOperator",
> + ClassOptions::HasOverloadedAssignmentOperator);
> + IO.bitSetCase(Options, "HasConversionOperator",
> + ClassOptions::HasConversionOperator);
> + IO.bitSetCase(Options, "ForwardReference", ClassOptions::
> ForwardReference);
> + IO.bitSetCase(Options, "Scoped", ClassOptions::Scoped);
> + IO.bitSetCase(Options, "HasUniqueName", ClassOptions::HasUniqueName);
> + IO.bitSetCase(Options, "Sealed", ClassOptions::Sealed);
> + IO.bitSetCase(Options, "Intrinsic", ClassOptions::Intrinsic);
> +}
> +
> +void ScalarBitSetTraits<MethodOptions>::bitset(IO &IO, MethodOptions
> &Options) {
> + IO.bitSetCase(Options, "None", MethodOptions::None);
> + IO.bitSetCase(Options, "Pseudo", MethodOptions::Pseudo);
> + IO.bitSetCase(Options, "NoInherit", MethodOptions::NoInherit);
> + IO.bitSetCase(Options, "NoConstruct", MethodOptions::NoConstruct);
> + IO.bitSetCase(Options, "CompilerGenerated", MethodOptions::
> CompilerGenerated);
> + IO.bitSetCase(Options, "Sealed", MethodOptions::Sealed);
> +}
> +
> +void ScalarEnumerationTraits<FileChecksumKind>::enumeration(
> + IO &io, FileChecksumKind &Kind) {
> + io.enumCase(Kind, "None", FileChecksumKind::None);
> + io.enumCase(Kind, "MD5", FileChecksumKind::MD5);
> + io.enumCase(Kind, "SHA1", FileChecksumKind::SHA1);
> + io.enumCase(Kind, "SHA256", FileChecksumKind::SHA256);
> +}
> +
> +void ScalarBitSetTraits<LineFlags>::bitset(IO &io, LineFlags &Flags) {
> + io.bitSetCase(Flags, "HasColumnInfo", LF_HaveColumns);
> + io.enumFallback<Hex16>(Flags);
> +}
> +
> +void ScalarTraits<HexFormattedString>::output(const HexFormattedString
> &Value,
> + void *ctx, raw_ostream
> &Out) {
> + StringRef Bytes(reinterpret_cast<const char *>(Value.Bytes.data()),
> + Value.Bytes.size());
> + Out << toHex(Bytes);
> +}
> +
> +StringRef ScalarTraits<HexFormattedString>::input(StringRef Scalar, void
> *ctxt,
> + HexFormattedString
> &Value) {
> + std::string H = fromHex(Scalar);
> + Value.Bytes.assign(H.begin(), H.end());
> + return StringRef();
> +}
> +
> +void MappingTraits<SourceLineEntry>::mapping(IO &IO, SourceLineEntry
> &Obj) {
> + IO.mapRequired("Offset", Obj.Offset);
> + IO.mapRequired("LineStart", Obj.LineStart);
> + IO.mapRequired("IsStatement", Obj.IsStatement);
> + IO.mapRequired("EndDelta", Obj.EndDelta);
> +}
> +
> +void MappingTraits<SourceColumnEntry>::mapping(IO &IO, SourceColumnEntry
> &Obj) {
> + IO.mapRequired("StartColumn", Obj.StartColumn);
> + IO.mapRequired("EndColumn", Obj.EndColumn);
> +}
> +
> +void MappingTraits<SourceLineBlock>::mapping(IO &IO, SourceLineBlock
> &Obj) {
> + IO.mapRequired("FileName", Obj.FileName);
> + IO.mapRequired("Lines", Obj.Lines);
> + IO.mapRequired("Columns", Obj.Columns);
> +}
> +
> +void MappingTraits<SourceFileChecksumEntry>::mapping(
> + IO &IO, SourceFileChecksumEntry &Obj) {
> + IO.mapRequired("FileName", Obj.FileName);
> + IO.mapRequired("Kind", Obj.Kind);
> + IO.mapRequired("Checksum", Obj.ChecksumBytes);
> +}
> +
> +void MappingTraits<SourceLineInfo>::mapping(IO &IO, SourceLineInfo &Obj)
> {
> + IO.mapRequired("CodeSize", Obj.CodeSize);
> +
> + IO.mapRequired("Flags", Obj.Flags);
> + IO.mapRequired("RelocOffset", Obj.RelocOffset);
> + IO.mapRequired("RelocSegment", Obj.RelocSegment);
> + IO.mapRequired("Blocks", Obj.Blocks);
> +}
> +
> +void MappingTraits<SourceFileInfo>::mapping(IO &IO, SourceFileInfo &Obj)
> {
> + IO.mapOptional("Checksums", Obj.FileChecksums);
> + IO.mapOptional("Lines", Obj.LineFragments);
> + IO.mapOptional("InlineeLines", Obj.Inlinees);
> +}
> +
> +void MappingTraits<InlineeSite>::mapping(IO &IO, InlineeSite &Obj) {
> + IO.mapRequired("FileName", Obj.FileName);
> + IO.mapRequired("LineNum", Obj.SourceLineNum);
> + IO.mapRequired("Inlinee", Obj.Inlinee);
> + IO.mapOptional("ExtraFiles", Obj.ExtraFiles);
> +}
> +
> +void MappingTraits<InlineeInfo>::mapping(IO &IO, InlineeInfo &Obj) {
> + IO.mapRequired("HasExtraFiles", Obj.HasExtraFiles);
> + IO.mapRequired("Sites", Obj.Sites);
> +}
> +
> +void MappingTraits<MemberPointerInfo>::mapping(IO &IO, MemberPointerInfo
> &MPI) {
> + IO.mapRequired("ContainingType", MPI.ContainingType);
> + IO.mapRequired("Representation", MPI.Representation);
> +}
> +
> +template <> void LeafRecordImpl<ModifierRecord>::map(IO &IO) {
> + IO.mapRequired("ModifiedType", Record.ModifiedType);
> + IO.mapRequired("Modifiers", Record.Modifiers);
> +}
> +
> +template <> void LeafRecordImpl<ProcedureRecord>::map(IO &IO) {
> + IO.mapRequired("ReturnType", Record.ReturnType);
> + IO.mapRequired("CallConv", Record.CallConv);
> + IO.mapRequired("Options", Record.Options);
> + IO.mapRequired("ParameterCount", Record.ParameterCount);
> + IO.mapRequired("ArgumentList", Record.ArgumentList);
> +}
> +
> +template <> void LeafRecordImpl<MemberFunctionRecord>::map(IO &IO) {
> + IO.mapRequired("ReturnType", Record.ReturnType);
> + IO.mapRequired("ClassType", Record.ClassType);
> + IO.mapRequired("ThisType", Record.ThisType);
> + IO.mapRequired("CallConv", Record.CallConv);
> + IO.mapRequired("Options", Record.Options);
> + IO.mapRequired("ParameterCount", Record.ParameterCount);
> + IO.mapRequired("ArgumentList", Record.ArgumentList);
> + IO.mapRequired("ThisPointerAdjustment", Record.ThisPointerAdjustment);
> +}
> +
> +template <> void LeafRecordImpl<LabelRecord>::map(IO &IO) {
> + IO.mapRequired("Mode", Record.Mode);
> +}
> +
> +template <> void LeafRecordImpl<MemberFuncIdRecord>::map(IO &IO) {
> + IO.mapRequired("ClassType", Record.ClassType);
> + IO.mapRequired("FunctionType", Record.FunctionType);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void LeafRecordImpl<ArgListRecord>::map(IO &IO) {
> + IO.mapRequired("ArgIndices", Record.ArgIndices);
> +}
> +
> +template <> void LeafRecordImpl<StringListRecord>::map(IO &IO) {
> + IO.mapRequired("StringIndices", Record.StringIndices);
> +}
> +
> +template <> void LeafRecordImpl<PointerRecord>::map(IO &IO) {
> + IO.mapRequired("ReferentType", Record.ReferentType);
> + IO.mapRequired("Attrs", Record.Attrs);
> + IO.mapOptional("MemberInfo", Record.MemberInfo);
> +}
> +
> +template <> void LeafRecordImpl<ArrayRecord>::map(IO &IO) {
> + IO.mapRequired("ElementType", Record.ElementType);
> + IO.mapRequired("IndexType", Record.IndexType);
> + IO.mapRequired("Size", Record.Size);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +void LeafRecordImpl<FieldListRecord>::map(IO &IO) {
> + IO.mapRequired("FieldList", Members);
> +}
> +
> +namespace {
> +class MemberRecordConversionVisitor : public TypeVisitorCallbacks {
> +public:
> + explicit MemberRecordConversionVisitor(std::vector<MemberRecord>
> &Records)
> + : Records(Records) {}
> +
> +#define TYPE_RECORD(EnumName, EnumVal, Name)
> +#define MEMBER_RECORD(EnumName, EnumVal, Name)
> \
> + Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record)
> override { \
> + return visitKnownMemberImpl(Record);
> \
> + }
> +#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> +#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> +private:
> + template <typename T> Error visitKnownMemberImpl(T &Record) {
> + TypeLeafKind K = static_cast<TypeLeafKind>(Record.getKind());
> + auto Impl = std::make_shared<MemberRecordImpl<T>>(K);
> + Impl->Record = Record;
> + Records.push_back(MemberRecord{Impl});
> + return Error::success();
> + }
> +
> + std::vector<MemberRecord> &Records;
> +};
> +}
> +
> +Error LeafRecordImpl<FieldListRecord>::fromCodeViewRecord(CVType Type) {
> + MemberRecordConversionVisitor V(Members);
> + return visitMemberRecordStream(Type.content(), V);
> +}
> +
> +CVType LeafRecordImpl<FieldListRecord>::toCodeViewRecord(
> + BumpPtrAllocator &Allocator) const {
> + TypeTableBuilder TTB(Allocator);
> + FieldListRecordBuilder FLRB(TTB);
> + FLRB.begin();
> + for (const auto &Member : Members) {
> + Member.Member->writeTo(FLRB);
> + }
> + FLRB.end(true);
> + return CVType(Kind, TTB.records().front());
> +}
> +
> +template <> void LeafRecordImpl<ClassRecord>::map(IO &IO) {
> + IO.mapRequired("MemberCount", Record.MemberCount);
> + IO.mapRequired("Options", Record.Options);
> + IO.mapRequired("FieldList", Record.FieldList);
> + IO.mapRequired("Name", Record.Name);
> + IO.mapRequired("UniqueName", Record.UniqueName);
> +
> + IO.mapRequired("DerivationList", Record.DerivationList);
> + IO.mapRequired("VTableShape", Record.VTableShape);
> + IO.mapRequired("Size", Record.Size);
> +}
> +
> +template <> void LeafRecordImpl<UnionRecord>::map(IO &IO) {
> + IO.mapRequired("MemberCount", Record.MemberCount);
> + IO.mapRequired("Options", Record.Options);
> + IO.mapRequired("FieldList", Record.FieldList);
> + IO.mapRequired("Name", Record.Name);
> + IO.mapRequired("UniqueName", Record.UniqueName);
> +
> + IO.mapRequired("Size", Record.Size);
> +}
> +
> +template <> void LeafRecordImpl<EnumRecord>::map(IO &IO) {
> + IO.mapRequired("NumEnumerators", Record.MemberCount);
> + IO.mapRequired("Options", Record.Options);
> + IO.mapRequired("FieldList", Record.FieldList);
> + IO.mapRequired("Name", Record.Name);
> + IO.mapRequired("UniqueName", Record.UniqueName);
> +
> + IO.mapRequired("UnderlyingType", Record.UnderlyingType);
> +}
> +
> +template <> void LeafRecordImpl<BitFieldRecord>::map(IO &IO) {
> + IO.mapRequired("Type", Record.Type);
> + IO.mapRequired("BitSize", Record.BitSize);
> + IO.mapRequired("BitOffset", Record.BitOffset);
> +}
> +
> +template <> void LeafRecordImpl<VFTableShapeRecord>::map(IO &IO) {
> + IO.mapRequired("Slots", Record.Slots);
> +}
> +
> +template <> void LeafRecordImpl<TypeServer2Record>::map(IO &IO) {
> + IO.mapRequired("Guid", Record.Guid);
> + IO.mapRequired("Age", Record.Age);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void LeafRecordImpl<StringIdRecord>::map(IO &IO) {
> + IO.mapRequired("Id", Record.Id);
> + IO.mapRequired("String", Record.String);
> +}
> +
> +template <> void LeafRecordImpl<FuncIdRecord>::map(IO &IO) {
> + IO.mapRequired("ParentScope", Record.ParentScope);
> + IO.mapRequired("FunctionType", Record.FunctionType);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void LeafRecordImpl<UdtSourceLineRecord>::map(IO &IO) {
> + IO.mapRequired("UDT", Record.UDT);
> + IO.mapRequired("SourceFile", Record.SourceFile);
> + IO.mapRequired("LineNumber", Record.LineNumber);
> +}
> +
> +template <> void LeafRecordImpl<UdtModSourceLineRecord>::map(IO &IO) {
> + IO.mapRequired("UDT", Record.UDT);
> + IO.mapRequired("SourceFile", Record.SourceFile);
> + IO.mapRequired("LineNumber", Record.LineNumber);
> + IO.mapRequired("Module", Record.Module);
> +}
> +
> +template <> void LeafRecordImpl<BuildInfoRecord>::map(IO &IO) {
> + IO.mapRequired("ArgIndices", Record.ArgIndices);
> +}
> +
> +template <> void LeafRecordImpl<VFTableRecord>::map(IO &IO) {
> + IO.mapRequired("CompleteClass", Record.CompleteClass);
> + IO.mapRequired("OverriddenVFTable", Record.OverriddenVFTable);
> + IO.mapRequired("VFPtrOffset", Record.VFPtrOffset);
> + IO.mapRequired("MethodNames", Record.MethodNames);
> +}
> +
> +template <> void LeafRecordImpl<MethodOverloadListRecord>::map(IO &IO) {
> + IO.mapRequired("Methods", Record.Methods);
> +}
> +
> +void MappingTraits<OneMethodRecord>::mapping(IO &io, OneMethodRecord
> &Record) {
> + io.mapRequired("Type", Record.Type);
> + io.mapRequired("Attrs", Record.Attrs.Attrs);
> + io.mapRequired("VFTableOffset", Record.VFTableOffset);
> + io.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void MemberRecordImpl<OneMethodRecord>::map(IO &IO) {
> + MappingTraits<OneMethodRecord>::mapping(IO, Record);
> +}
> +
> +template <> void MemberRecordImpl<OverloadedMethodRecord>::map(IO &IO) {
> + IO.mapRequired("NumOverloads", Record.NumOverloads);
> + IO.mapRequired("MethodList", Record.MethodList);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void MemberRecordImpl<NestedTypeRecord>::map(IO &IO) {
> + IO.mapRequired("Type", Record.Type);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void MemberRecordImpl<DataMemberRecord>::map(IO &IO) {
> + IO.mapRequired("Attrs", Record.Attrs.Attrs);
> + IO.mapRequired("Type", Record.Type);
> + IO.mapRequired("FieldOffset", Record.FieldOffset);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void MemberRecordImpl<StaticDataMemberRecord>::map(IO &IO) {
> + IO.mapRequired("Attrs", Record.Attrs.Attrs);
> + IO.mapRequired("Type", Record.Type);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void MemberRecordImpl<EnumeratorRecord>::map(IO &IO) {
> + IO.mapRequired("Attrs", Record.Attrs.Attrs);
> + IO.mapRequired("Value", Record.Value);
> + IO.mapRequired("Name", Record.Name);
> +}
> +
> +template <> void MemberRecordImpl<VFPtrRecord>::map(IO &IO) {
> + IO.mapRequired("Type", Record.Type);
> +}
> +
> +template <> void MemberRecordImpl<BaseClassRecord>::map(IO &IO) {
> + IO.mapRequired("Attrs", Record.Attrs.Attrs);
> + IO.mapRequired("Type", Record.Type);
> + IO.mapRequired("Offset", Record.Offset);
> +}
> +
> +template <> void MemberRecordImpl<VirtualBaseClassRecord>::map(IO &IO) {
> + IO.mapRequired("Attrs", Record.Attrs.Attrs);
> + IO.mapRequired("BaseType", Record.BaseType);
> + IO.mapRequired("VBPtrType", Record.VBPtrType);
> + IO.mapRequired("VBPtrOffset", Record.VBPtrOffset);
> + IO.mapRequired("VTableIndex", Record.VTableIndex);
> +}
> +
> +template <> void MemberRecordImpl<ListContinuationRecord>::map(IO &IO) {
> + IO.mapRequired("ContinuationIndex", Record.ContinuationIndex);
> +}
> +
> +template <typename T>
> +static inline Expected<LeafRecord> fromCodeViewRecordImpl(CVType Type) {
> + LeafRecord Result;
> +
> + auto Impl = std::make_shared<LeafRecordImpl<T>>(Type.kind());
> + if (auto EC = Impl->fromCodeViewRecord(Type))
> + return std::move(EC);
> + Result.Leaf = Impl;
> + return Result;
> +}
> +
> +Expected<LeafRecord> LeafRecord::fromCodeViewRecord(CVType Type) {
> +#define TYPE_RECORD(EnumName, EnumVal, ClassName)
> \
> + case EnumName:
> \
> + return fromCodeViewRecordImpl<ClassName##Record>(Type);
> +#define TYPE_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
> \
> + TYPE_RECORD(EnumName, EnumVal, ClassName)
> +#define MEMBER_RECORD(EnumName, EnumVal, ClassName)
> +#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
> + switch (Type.kind()) {
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> + default: { llvm_unreachable("Unknown leaf kind!"); }
> + }
> + return make_error<CodeViewError>(cv_error_code::corrupt_record);
> +}
> +
> +CVType LeafRecord::toCodeViewRecord(BumpPtrAllocator &Allocator) const {
> + return Leaf->toCodeViewRecord(Allocator);
> +}
> +
> +template <> struct MappingTraits<LeafRecordBase> {
> + static void mapping(IO &io, LeafRecordBase &Record) { Record.map(io); }
> +};
> +
> +template <typename ConcreteType>
> +static void mapLeafRecordImpl(IO &IO, const char *Class, TypeLeafKind
> Kind,
> + LeafRecord &Obj) {
> + if (!IO.outputting())
> + Obj.Leaf = std::make_shared<LeafRecordImpl<ConcreteType>>(Kind);
> +
> + if (Kind == LF_FIELDLIST)
> + Obj.Leaf->map(IO);
> + else
> + IO.mapRequired(Class, *Obj.Leaf);
> +}
> +
> +void MappingTraits<LeafRecord>::mapping(IO &IO, LeafRecord &Obj) {
> + TypeLeafKind Kind;
> + if (IO.outputting())
> + Kind = Obj.Leaf->Kind;
> + IO.mapRequired("Kind", Kind);
> +
> +#define TYPE_RECORD(EnumName, EnumVal, ClassName)
> \
> + case EnumName:
> \
> + mapLeafRecordImpl<ClassName##Record>(IO, #ClassName, Kind, Obj);
> \
> + break;
> +#define TYPE_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
> \
> + TYPE_RECORD(EnumName, EnumVal, ClassName)
> +#define MEMBER_RECORD(EnumName, EnumVal, ClassName)
> +#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
> + switch (Kind) {
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> + default: { llvm_unreachable("Unknown leaf kind!"); }
> + }
> +}
> +
> +template <> struct MappingTraits<MemberRecordBase> {
> + static void mapping(IO &io, MemberRecordBase &Record) { Record.map(io);
> }
> +};
> +
> +template <typename ConcreteType>
> +static void mapMemberRecordImpl(IO &IO, const char *Class, TypeLeafKind
> Kind,
> + MemberRecord &Obj) {
> + if (!IO.outputting())
> + Obj.Member = std::make_shared<MemberRecordImpl<ConcreteType>>(Kind);
> +
> + IO.mapRequired(Class, *Obj.Member);
> +}
> +
> +void MappingTraits<MemberRecord>::mapping(IO &IO, MemberRecord &Obj) {
> + TypeLeafKind Kind;
> + if (IO.outputting())
> + Kind = Obj.Member->Kind;
> + IO.mapRequired("Kind", Kind);
> +
> +#define MEMBER_RECORD(EnumName, EnumVal, ClassName)
> \
> + case EnumName:
> \
> + mapMemberRecordImpl<ClassName##Record>(IO, #ClassName, Kind, Obj);
> \
> + break;
> +#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
> \
> + MEMBER_RECORD(EnumName, EnumVal, ClassName)
> +#define TYPE_RECORD(EnumName, EnumVal, ClassName)
> +#define TYPE_RECORD_ALIAS(EnumName, EnumVal, AliasName, ClassName)
> + switch (Kind) {
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> + default: { llvm_unreachable("Unknown member kind!"); }
> + }
> +}
>
> Modified: llvm/trunk/lib/ObjectYAML/LLVMBuild.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/
> ObjectYAML/LLVMBuild.txt?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/lib/ObjectYAML/LLVMBuild.txt (original)
> +++ llvm/trunk/lib/ObjectYAML/LLVMBuild.txt Tue May 30 16:53:05 2017
> @@ -11,4 +11,4 @@
> type = Library
> name = ObjectYAML
> parent = Libraries
> -required_libraries = Support
> +required_libraries = Support DebugInfoCodeView
>
> Modified: llvm/trunk/tools/llvm-pdbdump/Analyze.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/Analyze.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/Analyze.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/Analyze.cpp Tue May 30 16:53:05 2017
> @@ -35,7 +35,7 @@ static StringRef getLeafTypeName(TypeLea
> #define TYPE_RECORD(ename, value, name)
> \
> case ename:
> \
> return #name;
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> default:
> break;
> }
>
> Modified: llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/CMakeLists.txt?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt (original)
> +++ llvm/trunk/tools/llvm-pdbdump/CMakeLists.txt Tue May 30 16:53:05 2017
> @@ -3,6 +3,7 @@ set(LLVM_LINK_COMPONENTS
> DebugInfoMSF
> DebugInfoPDB
> Object
> + ObjectYAML
> Support
> )
>
> @@ -12,8 +13,6 @@ add_llvm_tool(llvm-pdbdump
> CompactTypeDumpVisitor.cpp
> Diff.cpp
> llvm-pdbdump.cpp
> - YamlSymbolDumper.cpp
> - YamlTypeDumper.cpp
> LinePrinter.cpp
> LLVMOutputStyle.cpp
> PdbYaml.cpp
> @@ -29,6 +28,7 @@ add_llvm_tool(llvm-pdbdump
> PrettyVariableDumper.cpp
> StreamUtil.cpp
> YAMLOutputStyle.cpp
> + YamlSymbolDumper.cpp
> )
>
> if(LLVM_USE_SANITIZE_COVERAGE)
>
> Modified: llvm/trunk/tools/llvm-pdbdump/CompactTypeDumpVisitor.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/
> CompactTypeDumpVisitor.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/CompactTypeDumpVisitor.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/CompactTypeDumpVisitor.cpp Tue May 30
> 16:53:05 2017
> @@ -18,7 +18,7 @@ using namespace llvm::pdb;
>
> static const EnumEntry<TypeLeafKind> LeafTypeNames[] = {
> #define CV_TYPE(enum, val) {#enum, enum},
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
> };
>
> static StringRef getLeafName(TypeLeafKind K) {
>
> Modified: llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/PdbYaml.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/PdbYaml.cpp Tue May 30 16:53:05 2017
> @@ -9,9 +9,7 @@
>
> #include "PdbYaml.h"
>
> -#include "YamlSerializationContext.h"
> #include "YamlSymbolDumper.h"
> -#include "YamlTypeDumper.h"
>
> #include "llvm/ADT/StringExtras.h"
> #include "llvm/DebugInfo/CodeView/CVSymbolVisitor.h"
> @@ -22,6 +20,7 @@
> #include "llvm/DebugInfo/CodeView/TypeSerializer.h"
> #include "llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h"
> #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
> +#include "llvm/DebugInfo/PDB/Native/RawTypes.h"
> #include "llvm/DebugInfo/PDB/Native/TpiHashing.h"
> #include "llvm/DebugInfo/PDB/PDBExtras.h"
> #include "llvm/DebugInfo/PDB/PDBTypes.h"
> @@ -35,15 +34,7 @@ LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32
> LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef)
> LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::NamedStreamMapping)
> LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbDbiModuleInfo)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbSourceFileChecksumEntry)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbSourceLineEntry)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbSourceColumnEntry)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbSourceLineBlock)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbSourceLineInfo)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbInlineeSite)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbInlineeInfo)
> LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbSymbolRecord)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbTpiRecord)
> LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::StreamBlockList)
> LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::pdb::PdbRaw_FeatureSig)
>
> @@ -152,57 +143,18 @@ template <> struct ScalarEnumerationTrai
> io.enumCase(Features, "VC140", PdbRaw_FeatureSig::VC140);
> }
> };
> -
> -template <> struct ScalarEnumerationTraits<llvm::codeview::FileChecksumKind>
> {
> - static void enumeration(IO &io, llvm::codeview::FileChecksumKind
> &Kind) {
> - io.enumCase(Kind, "None", llvm::codeview::FileChecksumKind::None);
> - io.enumCase(Kind, "MD5", llvm::codeview::FileChecksumKind::MD5);
> - io.enumCase(Kind, "SHA1", llvm::codeview::FileChecksumKind::SHA1);
> - io.enumCase(Kind, "SHA256", llvm::codeview::
> FileChecksumKind::SHA256);
> - }
> -};
> -
> -template <> struct ScalarBitSetTraits<llvm::codeview::LineFlags> {
> - static void bitset(IO &io, llvm::codeview::LineFlags &Flags) {
> - io.bitSetCase(Flags, "HasColumnInfo", llvm::codeview::LF_
> HaveColumns);
> - io.enumFallback<Hex16>(Flags);
> - }
> -};
> -}
> }
> -
> -void ScalarTraits<HexFormattedString>::output(const HexFormattedString
> &Value,
> - void *ctx, raw_ostream
> &Out) {
> - StringRef Bytes(reinterpret_cast<const char *>(Value.Bytes.data()),
> - Value.Bytes.size());
> - Out << toHex(Bytes);
> -}
> -
> -StringRef ScalarTraits<HexFormattedString>::input(StringRef Scalar, void
> *ctxt,
> - HexFormattedString
> &Value) {
> - std::string H = fromHex(Scalar);
> - Value.Bytes.assign(H.begin(), H.end());
> - return StringRef();
> }
>
> void MappingTraits<PdbObject>::mapping(IO &IO, PdbObject &Obj) {
> - // Create a single serialization context that will be passed through the
> - // entire process of serializing / deserializing a Tpi Stream. This is
> - // especially important when we are going from Pdb -> Yaml because we
> need
> - // to maintain state in a TypeTableBuilder across mappings, and at the
> end of
> - // the entire process, we need to have one TypeTableBuilder that has
> every
> - // record.
> - pdb::yaml::SerializationContext Context(IO, Obj.Allocator);
> -
> -
> IO.mapOptional("MSF", Obj.Headers);
> IO.mapOptional("StreamSizes", Obj.StreamSizes);
> IO.mapOptional("StreamMap", Obj.StreamMap);
> IO.mapOptional("StringTable", Obj.StringTable);
> IO.mapOptional("PdbStream", Obj.PdbStream);
> - IO.mapOptionalWithContext("DbiStream", Obj.DbiStream, Context);
> - IO.mapOptionalWithContext("TpiStream", Obj.TpiStream, Context);
> - IO.mapOptionalWithContext("IpiStream", Obj.IpiStream, Context);
> + IO.mapOptional("DbiStream", Obj.DbiStream);
> + IO.mapOptional("TpiStream", Obj.TpiStream);
> + IO.mapOptional("IpiStream", Obj.IpiStream);
> }
>
> void MappingTraits<MSFHeaders>::mapping(IO &IO, MSFHeaders &Obj) {
> @@ -239,7 +191,7 @@ void MappingTraits<PdbInfoStream>::mappi
> IO.mapOptional("Version", Obj.Version, PdbImplVC70);
> }
>
> -void MappingContextTraits<PdbDbiStream, pdb::yaml::
> SerializationContext>::mapping(IO &IO, PdbDbiStream &Obj, pdb::yaml::SerializationContext
> &Context) {
> +void MappingTraits<PdbDbiStream>::mapping(IO &IO, PdbDbiStream &Obj) {
> IO.mapOptional("VerHeader", Obj.VerHeader, PdbDbiV70);
> IO.mapOptional("Age", Obj.Age, 1U);
> IO.mapOptional("BuildNumber", Obj.BuildNumber, uint16_t(0U));
> @@ -247,13 +199,13 @@ void MappingContextTraits<PdbDbiStream,
> IO.mapOptional("PdbDllRbld", Obj.PdbDllRbld, uint16_t(0U));
> IO.mapOptional("Flags", Obj.Flags, uint16_t(1U));
> IO.mapOptional("MachineType", Obj.MachineType, PDB_Machine::x86);
> - IO.mapOptionalWithContext("Modules", Obj.ModInfos, Context);
> + IO.mapOptional("Modules", Obj.ModInfos);
> }
>
> -void MappingContextTraits<PdbTpiStream, pdb::yaml::
> SerializationContext>::mapping(
> - IO &IO, pdb::yaml::PdbTpiStream &Obj, pdb::yaml::SerializationContext
> &Context) {
> +void MappingTraits<PdbTpiStream>::mapping(IO &IO,
> + pdb::yaml::PdbTpiStream &Obj) {
> IO.mapOptional("Version", Obj.Version, PdbTpiV80);
> - IO.mapRequired("Records", Obj.Records, Context);
> + IO.mapRequired("Records", Obj.Records);
> }
>
> void MappingTraits<NamedStreamMapping>::mapping(IO &IO,
> @@ -262,9 +214,11 @@ void MappingTraits<NamedStreamMapping>::
> IO.mapRequired("StreamNum", Obj.StreamNumber);
> }
>
> -void MappingContextTraits<PdbSymbolRecord, pdb::yaml::
> SerializationContext>::mapping(IO &IO, PdbSymbolRecord &Obj, pdb::yaml::SerializationContext
> &Context) {
> +void MappingTraits<PdbSymbolRecord>::mapping(IO &IO, PdbSymbolRecord
> &Obj) {
> + BumpPtrAllocator *Alloc =
> + reinterpret_cast<BumpPtrAllocator *>(IO.getContext());
> codeview::SymbolVisitorCallbackPipeline Pipeline;
> - codeview::SymbolSerializer Serializer(Context.Allocator);
> + codeview::SymbolSerializer Serializer(*Alloc);
> codeview::SymbolDeserializer Deserializer(nullptr);
> codeview::yaml::YamlSymbolDumper Dumper(IO);
>
> @@ -283,113 +237,15 @@ void MappingContextTraits<PdbSymbolRecor
> consumeError(Visitor.visitSymbolRecord(Obj.Record));
> }
>
> -void MappingContextTraits<PdbModiStream, pdb::yaml::
> SerializationContext>::mapping(IO &IO, PdbModiStream &Obj, pdb::yaml::SerializationContext
> &Context) {
> +void MappingTraits<PdbModiStream>::mapping(IO &IO, PdbModiStream &Obj) {
> IO.mapOptional("Signature", Obj.Signature, 4U);
> - IO.mapRequired("Records", Obj.Symbols, Context);
> + IO.mapRequired("Records", Obj.Symbols);
> }
>
> -void MappingContextTraits<PdbDbiModuleInfo, pdb::yaml::
> SerializationContext>::mapping(IO &IO, PdbDbiModuleInfo &Obj, pdb::yaml::SerializationContext
> &Context) {
> +void MappingTraits<PdbDbiModuleInfo>::mapping(IO &IO, PdbDbiModuleInfo
> &Obj) {
> IO.mapRequired("Module", Obj.Mod);
> IO.mapOptional("ObjFile", Obj.Obj, Obj.Mod);
> IO.mapOptional("SourceFiles", Obj.SourceFiles);
> - IO.mapOptionalWithContext("LineInfo", Obj.FileLineInfo, Context);
> - IO.mapOptionalWithContext("Modi", Obj.Modi, Context);
> -}
> -
> -void MappingContextTraits<pdb::yaml::PdbSourceLineEntry,
> - pdb::yaml::SerializationContext>::
> - mapping(IO &IO, PdbSourceLineEntry &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - IO.mapRequired("Offset", Obj.Offset);
> - IO.mapRequired("LineStart", Obj.LineStart);
> - IO.mapRequired("IsStatement", Obj.IsStatement);
> - IO.mapRequired("EndDelta", Obj.EndDelta);
> -}
> -
> -void MappingContextTraits<pdb::yaml::PdbSourceColumnEntry,
> - pdb::yaml::SerializationContext>::
> - mapping(IO &IO, PdbSourceColumnEntry &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - IO.mapRequired("StartColumn", Obj.StartColumn);
> - IO.mapRequired("EndColumn", Obj.EndColumn);
> -}
> -
> -void MappingContextTraits<pdb::yaml::PdbSourceLineBlock,
> - pdb::yaml::SerializationContext>::
> - mapping(IO &IO, PdbSourceLineBlock &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - IO.mapRequired("FileName", Obj.FileName);
> - IO.mapRequired("Lines", Obj.Lines, Context);
> - IO.mapRequired("Columns", Obj.Columns, Context);
> -}
> -
> -void MappingContextTraits<pdb::yaml::PdbSourceFileChecksumEntry,
> - pdb::yaml::SerializationContext>::
> - mapping(IO &IO, PdbSourceFileChecksumEntry &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - IO.mapRequired("FileName", Obj.FileName);
> - IO.mapRequired("Kind", Obj.Kind);
> - IO.mapRequired("Checksum", Obj.ChecksumBytes);
> -}
> -
> -void MappingContextTraits<pdb::yaml::PdbSourceLineInfo,
> - pdb::yaml::SerializationContext>::
> - mapping(IO &IO, PdbSourceLineInfo &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - IO.mapRequired("CodeSize", Obj.CodeSize);
> -
> - IO.mapRequired("Flags", Obj.Flags);
> - IO.mapRequired("RelocOffset", Obj.RelocOffset);
> - IO.mapRequired("RelocSegment", Obj.RelocSegment);
> - IO.mapRequired("Blocks", Obj.Blocks, Context);
> -}
> -
> -void MappingContextTraits<pdb::yaml::PdbSourceFileInfo,
> - pdb::yaml::SerializationContext>::
> - mapping(IO &IO, PdbSourceFileInfo &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - IO.mapOptionalWithContext("Checksums", Obj.FileChecksums, Context);
> - IO.mapOptionalWithContext("Lines", Obj.LineFragments, Context);
> - IO.mapOptionalWithContext("InlineeLines", Obj.Inlinees, Context);
> -}
> -
> -void MappingContextTraits<PdbInlineeSite, SerializationContext>::mapping(
> - IO &IO, PdbInlineeSite &Obj, SerializationContext &Context) {
> - IO.mapRequired("FileName", Obj.FileName);
> - IO.mapRequired("LineNum", Obj.SourceLineNum);
> - IO.mapRequired("Inlinee", Obj.Inlinee);
> - IO.mapOptional("ExtraFiles", Obj.ExtraFiles);
> -}
> -
> -void MappingContextTraits<PdbInlineeInfo, SerializationContext>::mapping(
> - IO &IO, PdbInlineeInfo &Obj, SerializationContext &Context) {
> - IO.mapRequired("HasExtraFiles", Obj.HasExtraFiles);
> - IO.mapRequired("Sites", Obj.Sites, Context);
> -}
> -
> -void MappingContextTraits<PdbTpiRecord, pdb::yaml::
> SerializationContext>::
> - mapping(IO &IO, pdb::yaml::PdbTpiRecord &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - if (IO.outputting()) {
> - // For PDB to Yaml, deserialize into a high level record type, then
> dump it.
> - consumeError(codeview::visitTypeRecord(Obj.Record, Context.Dumper));
> - } else {
> - codeview::TypeVisitorCallbackPipeline Pipeline;
> - codeview::TypeSerializer Serializer(Context.Allocator);
> - pdb::TpiHashUpdater Hasher;
> - // For Yaml to PDB, extract from the high level record type, then
> write it
> - // to bytes.
> -
> - // This might be interpreted as a hack, but serializing FieldList
> - // sub-records requires having access to the same serializer being
> used by
> - // the FieldList itself.
> - Context.ActiveSerializer = &Serializer;
> - Pipeline.addCallbackToPipeline(Context.Dumper);
> - Pipeline.addCallbackToPipeline(Serializer);
> - Pipeline.addCallbackToPipeline(Hasher);
> - consumeError(codeview::visitTypeRecord(Obj.Record, Pipeline,
> - codeview::VDS_BytesExternal));
> - }
> -
> - Context.ActiveSerializer = nullptr;
> + IO.mapOptional("LineInfo", Obj.FileLineInfo);
> + IO.mapOptional("Modi", Obj.Modi);
> }
>
> Modified: llvm/trunk/tools/llvm-pdbdump/PdbYaml.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/PdbYaml.h?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/PdbYaml.h (original)
> +++ llvm/trunk/tools/llvm-pdbdump/PdbYaml.h Tue May 30 16:53:05 2017
> @@ -19,6 +19,7 @@
> #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
> #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
> #include "llvm/DebugInfo/PDB/PDBTypes.h"
> +#include "llvm/ObjectYAML/CodeViewYAML.h"
> #include "llvm/Support/Endian.h"
> #include "llvm/Support/YAMLTraits.h"
>
> @@ -65,66 +66,11 @@ struct PdbModiStream {
> std::vector<PdbSymbolRecord> Symbols;
> };
>
> -struct PdbSourceLineEntry {
> - uint32_t Offset;
> - uint32_t LineStart;
> - uint32_t EndDelta;
> - bool IsStatement;
> -};
> -
> -struct PdbSourceColumnEntry {
> - uint16_t StartColumn;
> - uint16_t EndColumn;
> -};
> -
> -struct PdbSourceLineBlock {
> - StringRef FileName;
> - std::vector<PdbSourceLineEntry> Lines;
> - std::vector<PdbSourceColumnEntry> Columns;
> -};
> -
> -struct HexFormattedString {
> - std::vector<uint8_t> Bytes;
> -};
> -
> -struct PdbSourceFileChecksumEntry {
> - StringRef FileName;
> - codeview::FileChecksumKind Kind;
> - HexFormattedString ChecksumBytes;
> -};
> -
> -struct PdbSourceLineInfo {
> - uint32_t RelocOffset;
> - uint32_t RelocSegment;
> - codeview::LineFlags Flags;
> - uint32_t CodeSize;
> -
> - std::vector<PdbSourceLineBlock> Blocks;
> -};
> -
> -struct PdbInlineeSite {
> - codeview::TypeIndex Inlinee;
> - StringRef FileName;
> - uint32_t SourceLineNum;
> - std::vector<StringRef> ExtraFiles;
> -};
> -
> -struct PdbInlineeInfo {
> - bool HasExtraFiles;
> - std::vector<PdbInlineeSite> Sites;
> -};
> -
> -struct PdbSourceFileInfo {
> - std::vector<PdbSourceFileChecksumEntry> FileChecksums;
> - std::vector<PdbSourceLineInfo> LineFragments;
> - std::vector<PdbInlineeInfo> Inlinees;
> -};
> -
> struct PdbDbiModuleInfo {
> StringRef Obj;
> StringRef Mod;
> std::vector<StringRef> SourceFiles;
> - Optional<PdbSourceFileInfo> FileLineInfo;
> + Optional<CodeViewYAML::SourceFileInfo> FileLineInfo;
> Optional<PdbModiStream> Modi;
> };
>
> @@ -140,17 +86,9 @@ struct PdbDbiStream {
> std::vector<PdbDbiModuleInfo> ModInfos;
> };
>
> -struct PdbTpiRecord {
> - codeview::CVType Record;
> -};
> -
> -struct PdbTpiFieldListRecord {
> - codeview::CVMemberRecord Record;
> -};
> -
> struct PdbTpiStream {
> PdbRaw_TpiVer Version = PdbTpiV80;
> - std::vector<PdbTpiRecord> Records;
> + std::vector<CodeViewYAML::LeafRecord> Records;
> };
>
> struct PdbObject {
> @@ -172,126 +110,16 @@ struct PdbObject {
> }
> }
>
> -namespace llvm {
> -namespace yaml {
> -
> -template <> struct MappingTraits<pdb::yaml::PdbObject> {
> - static void mapping(IO &IO, pdb::yaml::PdbObject &Obj);
> -};
> -
> -template <> struct MappingTraits<pdb::yaml::MSFHeaders> {
> - static void mapping(IO &IO, pdb::yaml::MSFHeaders &Obj);
> -};
> -
> -template <> struct MappingTraits<msf::SuperBlock> {
> - static void mapping(IO &IO, msf::SuperBlock &SB);
> -};
> -
> -template <> struct MappingTraits<pdb::yaml::StreamBlockList> {
> - static void mapping(IO &IO, pdb::yaml::StreamBlockList &SB);
> -};
> -
> -template <> struct MappingTraits<pdb::yaml::PdbInfoStream> {
> - static void mapping(IO &IO, pdb::yaml::PdbInfoStream &Obj);
> -};
> -
> -template <> struct MappingContextTraits<pdb::yaml::PdbDbiStream,
> pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbDbiStream &Obj, pdb::yaml::SerializationContext
> &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbTpiStream, pdb::yaml::SerializationContext>
> {
> - static void mapping(IO &IO, pdb::yaml::PdbTpiStream &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <> struct MappingTraits<pdb::yaml::NamedStreamMapping> {
> - static void mapping(IO &IO, pdb::yaml::NamedStreamMapping &Obj);
> -};
> -
> -template <> struct MappingContextTraits<pdb::yaml::PdbSymbolRecord,
> pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbSymbolRecord &Obj, pdb::yaml::SerializationContext
> &Context);
> -};
> -
> -template <> struct MappingContextTraits<pdb::yaml::PdbModiStream,
> pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbModiStream &Obj, pdb::yaml::SerializationContext
> &Context);
> -};
> -
> -template <> struct MappingContextTraits<pdb::yaml::PdbDbiModuleInfo,
> pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbDbiModuleInfo &Obj,
> pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbSourceLineEntry,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbSourceLineEntry &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbSourceColumnEntry,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbSourceColumnEntry &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbSourceLineBlock,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbSourceLineBlock &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbSourceFileChecksumEntry,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbSourceFileChecksumEntry &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <> struct ScalarTraits<pdb::yaml::HexFormattedString> {
> - static void output(const pdb::yaml::HexFormattedString &Value, void
> *ctx,
> - llvm::raw_ostream &Out);
> - static StringRef input(StringRef Scalar, void *ctxt,
> - pdb::yaml::HexFormattedString &Value);
> - static bool mustQuote(StringRef) { return false; }
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbSourceLineInfo,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbSourceLineInfo &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbSourceFileInfo,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbSourceFileInfo &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbInlineeInfo,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbInlineeInfo &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbInlineeSite,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbInlineeSite &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbTpiRecord,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbTpiRecord &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -}
> -}
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbObject)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::MSFHeaders)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(msf::SuperBlock)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::StreamBlockList)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbInfoStream)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbDbiStream)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbTpiStream)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::NamedStreamMapping)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbSymbolRecord)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbModiStream)
> +LLVM_YAML_DECLARE_MAPPING_TRAITS(pdb::yaml::PdbDbiModuleInfo)
>
> #endif // LLVM_TOOLS_LLVMPDBDUMP_PDBYAML_H
>
> Modified: llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/YAMLOutputStyle.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.cpp Tue May 30 16:53:05
> 2017
> @@ -28,6 +28,7 @@
> #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
> #include "llvm/DebugInfo/PDB/Native/RawError.h"
> #include "llvm/DebugInfo/PDB/Native/TpiStream.h"
> +#include "llvm/ObjectYAML/CodeViewYAML.h"
>
> using namespace llvm;
> using namespace llvm::codeview;
> @@ -104,12 +105,12 @@ Error YAMLOutputStyle::dump() {
> namespace {
> class C13YamlVisitor : public C13DebugFragmentVisitor {
> public:
> - C13YamlVisitor(llvm::pdb::yaml::PdbSourceFileInfo &Info, PDBFile &F)
> + C13YamlVisitor(CodeViewYAML::SourceFileInfo &Info, PDBFile &F)
> : C13DebugFragmentVisitor(F), Info(Info) {}
>
> Error handleFileChecksums() override {
> for (const auto &C : *Checksums) {
> - llvm::pdb::yaml::PdbSourceFileChecksumEntry Entry;
> + CodeViewYAML::SourceFileChecksumEntry Entry;
> if (auto Result = getNameFromStringTable(C.FileNameOffset))
> Entry.FileName = *Result;
> else
> @@ -143,7 +144,7 @@ public:
> return Result.takeError();
>
> for (const auto &N : L.LineNumbers) {
> - llvm::pdb::yaml::PdbSourceLineEntry Line;
> + CodeViewYAML::SourceLineEntry Line;
> Line.Offset = N.Offset;
> codeview::LineInfo LI(N.Flags);
> Line.LineStart = LI.getStartLine();
> @@ -154,7 +155,7 @@ public:
>
> if (LF.hasColumnInfo()) {
> for (const auto &C : L.Columns) {
> - llvm::pdb::yaml::PdbSourceColumnEntry Column;
> + CodeViewYAML::SourceColumnEntry Column;
> Column.StartColumn = C.StartColumn;
> Column.EndColumn = C.EndColumn;
> Block.Columns.push_back(Column);
> @@ -179,7 +180,7 @@ public:
> else
> return Result.takeError();
>
> - Site.Inlinee = IL.Header->Inlinee;
> + Site.Inlinee = IL.Header->Inlinee.getIndex();
> Site.SourceLineNum = IL.Header->SourceLineNum;
> if (ILF.hasExtraFiles()) {
> for (const auto &EF : IL.ExtraFiles) {
> @@ -195,17 +196,16 @@ public:
> }
>
> private:
> -
> - llvm::pdb::yaml::PdbSourceFileInfo &Info;
> + CodeViewYAML::SourceFileInfo &Info;
> };
> }
>
> -Expected<Optional<llvm::pdb::yaml::PdbSourceFileInfo>>
> +Expected<Optional<CodeViewYAML::SourceFileInfo>>
> YAMLOutputStyle::getFileLineInfo(const pdb::ModuleDebugStreamRef &ModS) {
> if (!ModS.hasLineInfo())
> return None;
>
> - yaml::PdbSourceFileInfo Info;
> + CodeViewYAML::SourceFileInfo Info;
> C13YamlVisitor Visitor(Info, File);
> if (auto EC =
> codeview::visitDebugSubsections(ModS.linesAndChecksums(),
> Visitor))
> @@ -378,13 +378,10 @@ Error YAMLOutputStyle::dumpTpiStream() {
> Obj.TpiStream.emplace();
> Obj.TpiStream->Version = TS.getTpiVersion();
> for (auto &Record : TS.types(nullptr)) {
> - yaml::PdbTpiRecord R;
> - // It's not necessary to set R.RecordData here. That only exists as a
> - // way to have the `PdbTpiRecord` structure own the memory that
> `R.Record`
> - // references. In the case of reading an existing PDB though, that
> memory
> - // is owned by the backing stream.
> - R.Record = Record;
> - Obj.TpiStream->Records.push_back(R);
> + auto ExpectedRecord = CodeViewYAML::LeafRecord::
> fromCodeViewRecord(Record);
> + if (!ExpectedRecord)
> + return ExpectedRecord.takeError();
> + Obj.TpiStream->Records.push_back(*ExpectedRecord);
> }
>
> return Error::success();
> @@ -402,9 +399,11 @@ Error YAMLOutputStyle::dumpIpiStream() {
> Obj.IpiStream.emplace();
> Obj.IpiStream->Version = IS.getTpiVersion();
> for (auto &Record : IS.types(nullptr)) {
> - yaml::PdbTpiRecord R;
> - R.Record = Record;
> - Obj.IpiStream->Records.push_back(R);
> + auto ExpectedRecord = CodeViewYAML::LeafRecord::
> fromCodeViewRecord(Record);
> + if (!ExpectedRecord)
> + return ExpectedRecord.takeError();
> +
> + Obj.IpiStream->Records.push_back(*ExpectedRecord);
> }
>
> return Error::success();
>
> Modified: llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/YAMLOutputStyle.h?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.h (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YAMLOutputStyle.h Tue May 30 16:53:05
> 2017
> @@ -27,7 +27,7 @@ public:
> Error dump() override;
>
> private:
> - Expected<Optional<llvm::pdb::yaml::PdbSourceFileInfo>>
> + Expected<Optional<CodeViewYAML::SourceFileInfo>>
> getFileLineInfo(const pdb::ModuleDebugStreamRef &ModS);
>
> Error dumpStringTable();
>
> Removed: llvm/trunk/tools/llvm-pdbdump/YamlSerializationContext.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/
> YamlSerializationContext.h?rev=304247&view=auto
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/YamlSerializationContext.h (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YamlSerializationContext.h (removed)
> @@ -1,39 +0,0 @@
> -//===- YamlSerializationContext.h ----------------------------- *- C++
> --*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -
> -#ifndef LLVM_TOOLS_LLVMPDBDUMP_YAMLSERIALIZATIONCONTEXT_H
> -#define LLVM_TOOLS_LLVMPDBDUMP_YAMLSERIALIZATIONCONTEXT_H
> -
> -#include "PdbYaml.h"
> -#include "YamlTypeDumper.h"
> -#include "llvm/Support/Allocator.h"
> -
> -namespace llvm {
> -namespace codeview {
> -class TypeSerializer;
> -}
> -namespace yaml {
> -class IO;
> -}
> -
> -namespace pdb {
> -namespace yaml {
> -struct SerializationContext {
> - explicit SerializationContext(llvm::yaml::IO &IO, BumpPtrAllocator
> &Allocator)
> - : Dumper(IO, *this), Allocator(Allocator) {}
> -
> - codeview::yaml::YamlTypeDumperCallbacks Dumper;
> - BumpPtrAllocator &Allocator;
> - codeview::TypeSerializer *ActiveSerializer = nullptr;
> -};
> -}
> -}
> -}
> -
> -#endif
> \ No newline at end of file
>
> Modified: llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/YamlSymbolDumper.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.cpp Tue May 30
> 16:53:05 2017
> @@ -9,7 +9,6 @@
>
> #include "YamlSymbolDumper.h"
> #include "PdbYaml.h"
> -#include "YamlTypeDumper.h"
>
> #include "llvm/DebugInfo/CodeView/CVSymbolVisitor.h"
> #include "llvm/DebugInfo/CodeView/EnumTables.h"
> @@ -27,10 +26,10 @@ 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::PdbTpiFieldListRecord)
>
> namespace llvm {
> namespace yaml {
> +
> void ScalarEnumerationTraits<SymbolKind>::enumeration(IO &io,
> SymbolKind &Value) {
> auto SymbolNames = getSymbolTypeNames();
>
> Modified: llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/YamlSymbolDumper.h?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.h (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YamlSymbolDumper.h Tue May 30 16:53:05
> 2017
> @@ -34,7 +34,7 @@ public:
> return Error::success();
> \
> }
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
>
> private:
> template <typename T>
> @@ -59,7 +59,7 @@ template <> struct ScalarEnumerationTrai
> static void mapping(IO &IO, codeview::Name &Obj);
> \
> };
> #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/CVSymbolTypes.def"
> +#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
> }
> }
>
>
> Removed: llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/YamlTypeDumper.cpp?rev=304247&view=auto
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.cpp (removed)
> @@ -1,589 +0,0 @@
> -//===- YamlTypeDumper.cpp ------------------------------------- *- C++
> --*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -
> -#include "YamlTypeDumper.h"
> -#include "PdbYaml.h"
> -#include "YamlSerializationContext.h"
> -
> -#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
> -#include "llvm/DebugInfo/CodeView/EnumTables.h"
> -#include "llvm/DebugInfo/CodeView/TypeRecord.h"
> -#include "llvm/DebugInfo/CodeView/TypeSerializer.h"
> -#include "llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h"
> -#include "llvm/DebugInfo/PDB/Native/TpiHashing.h"
> -
> -using namespace llvm;
> -using namespace llvm::codeview;
> -using namespace llvm::codeview::yaml;
> -
> -LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(TypeIndex)
> -LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint64_t)
> -LLVM_YAML_IS_SEQUENCE_VECTOR(OneMethodRecord)
> -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::PdbTpiFieldListRecord)
> -
> -namespace {
> -struct FieldListRecordSplitter : public TypeVisitorCallbacks {
> -public:
> - explicit FieldListRecordSplitter(
> - std::vector<llvm::pdb::yaml::PdbTpiFieldListRecord> &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 visitKnownMember(CVMemberRecord &CVT, Name##Record &Record)
> override { \
> - visitKnownMemberImpl(CVT);
> \
> - return Error::success();
> \
> - }
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> -
> -private:
> - void visitKnownMemberImpl(CVMemberRecord &CVT) {
> - llvm::pdb::yaml::PdbTpiFieldListRecord R;
> - R.Record = CVT;
> - Records.push_back(std::move(R));
> - }
> -
> - std::vector<llvm::pdb::yaml::PdbTpiFieldListRecord> &Records;
> -};
> -}
> -
> -namespace llvm {
> -namespace yaml {
> -template <> struct ScalarEnumerationTraits<PointerToMemberRepresentation>
> {
> - static void enumeration(IO &IO, PointerToMemberRepresentation &Value) {
> - IO.enumCase(Value, "Unknown", PointerToMemberRepresentation:
> :Unknown);
> - IO.enumCase(Value, "SingleInheritanceData",
> - PointerToMemberRepresentation::SingleInheritanceData);
> - IO.enumCase(Value, "MultipleInheritanceData",
> - PointerToMemberRepresentation::MultipleInheritanceData);
> - IO.enumCase(Value, "VirtualInheritanceData",
> - PointerToMemberRepresentation::VirtualInheritanceData);
> - IO.enumCase(Value, "GeneralData",
> - PointerToMemberRepresentation::GeneralData);
> - IO.enumCase(Value, "SingleInheritanceFunction",
> - PointerToMemberRepresentation:
> :SingleInheritanceFunction);
> - IO.enumCase(Value, "MultipleInheritanceFunction",
> - PointerToMemberRepresentation:
> :MultipleInheritanceFunction);
> - IO.enumCase(Value, "VirtualInheritanceFunction",
> - PointerToMemberRepresentation:
> :VirtualInheritanceFunction);
> - IO.enumCase(Value, "GeneralFunction",
> - PointerToMemberRepresentation::GeneralFunction);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<VFTableSlotKind> {
> - static void enumeration(IO &IO, VFTableSlotKind &Kind) {
> - IO.enumCase(Kind, "Near16", VFTableSlotKind::Near16);
> - IO.enumCase(Kind, "Far16", VFTableSlotKind::Far16);
> - IO.enumCase(Kind, "This", VFTableSlotKind::This);
> - IO.enumCase(Kind, "Outer", VFTableSlotKind::Outer);
> - IO.enumCase(Kind, "Meta", VFTableSlotKind::Meta);
> - IO.enumCase(Kind, "Near", VFTableSlotKind::Near);
> - IO.enumCase(Kind, "Far", VFTableSlotKind::Far);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<CallingConvention> {
> - static void enumeration(IO &IO, CallingConvention &Value) {
> - IO.enumCase(Value, "NearC", CallingConvention::NearC);
> - IO.enumCase(Value, "FarC", CallingConvention::FarC);
> - IO.enumCase(Value, "NearPascal", CallingConvention::NearPascal);
> - IO.enumCase(Value, "FarPascal", CallingConvention::FarPascal);
> - IO.enumCase(Value, "NearFast", CallingConvention::NearFast);
> - IO.enumCase(Value, "FarFast", CallingConvention::FarFast);
> - IO.enumCase(Value, "NearStdCall", CallingConvention::NearStdCall);
> - IO.enumCase(Value, "FarStdCall", CallingConvention::FarStdCall);
> - IO.enumCase(Value, "NearSysCall", CallingConvention::NearSysCall);
> - IO.enumCase(Value, "FarSysCall", CallingConvention::FarSysCall);
> - IO.enumCase(Value, "ThisCall", CallingConvention::ThisCall);
> - IO.enumCase(Value, "MipsCall", CallingConvention::MipsCall);
> - IO.enumCase(Value, "Generic", CallingConvention::Generic);
> - IO.enumCase(Value, "AlphaCall", CallingConvention::AlphaCall);
> - IO.enumCase(Value, "PpcCall", CallingConvention::PpcCall);
> - IO.enumCase(Value, "SHCall", CallingConvention::SHCall);
> - IO.enumCase(Value, "ArmCall", CallingConvention::ArmCall);
> - IO.enumCase(Value, "AM33Call", CallingConvention::AM33Call);
> - IO.enumCase(Value, "TriCall", CallingConvention::TriCall);
> - IO.enumCase(Value, "SH5Call", CallingConvention::SH5Call);
> - IO.enumCase(Value, "M32RCall", CallingConvention::M32RCall);
> - IO.enumCase(Value, "ClrCall", CallingConvention::ClrCall);
> - IO.enumCase(Value, "Inline", CallingConvention::Inline);
> - IO.enumCase(Value, "NearVector", CallingConvention::NearVector);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<PointerKind> {
> - static void enumeration(IO &IO, PointerKind &Kind) {
> - IO.enumCase(Kind, "Near16", PointerKind::Near16);
> - IO.enumCase(Kind, "Far16", PointerKind::Far16);
> - IO.enumCase(Kind, "Huge16", PointerKind::Huge16);
> - IO.enumCase(Kind, "BasedOnSegment", PointerKind::BasedOnSegment);
> - IO.enumCase(Kind, "BasedOnValue", PointerKind::BasedOnValue);
> - IO.enumCase(Kind, "BasedOnSegmentValue", PointerKind::
> BasedOnSegmentValue);
> - IO.enumCase(Kind, "BasedOnAddress", PointerKind::BasedOnAddress);
> - IO.enumCase(Kind, "BasedOnSegmentAddress",
> - PointerKind::BasedOnSegmentAddress);
> - IO.enumCase(Kind, "BasedOnType", PointerKind::BasedOnType);
> - IO.enumCase(Kind, "BasedOnSelf", PointerKind::BasedOnSelf);
> - IO.enumCase(Kind, "Near32", PointerKind::Near32);
> - IO.enumCase(Kind, "Far32", PointerKind::Far32);
> - IO.enumCase(Kind, "Near64", PointerKind::Near64);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<PointerMode> {
> - static void enumeration(IO &IO, PointerMode &Mode) {
> - IO.enumCase(Mode, "Pointer", PointerMode::Pointer);
> - IO.enumCase(Mode, "LValueReference", PointerMode::LValueReference);
> - IO.enumCase(Mode, "PointerToDataMember", PointerMode::
> PointerToDataMember);
> - IO.enumCase(Mode, "PointerToMemberFunction",
> - PointerMode::PointerToMemberFunction);
> - IO.enumCase(Mode, "RValueReference", PointerMode::RValueReference);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<HfaKind> {
> - static void enumeration(IO &IO, HfaKind &Value) {
> - IO.enumCase(Value, "None", HfaKind::None);
> - IO.enumCase(Value, "Float", HfaKind::Float);
> - IO.enumCase(Value, "Double", HfaKind::Double);
> - IO.enumCase(Value, "Other", HfaKind::Other);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<MemberAccess> {
> - static void enumeration(IO &IO, MemberAccess &Access) {
> - IO.enumCase(Access, "None", MemberAccess::None);
> - IO.enumCase(Access, "Private", MemberAccess::Private);
> - IO.enumCase(Access, "Protected", MemberAccess::Protected);
> - IO.enumCase(Access, "Public", MemberAccess::Public);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<MethodKind> {
> - static void enumeration(IO &IO, MethodKind &Kind) {
> - IO.enumCase(Kind, "Vanilla", MethodKind::Vanilla);
> - IO.enumCase(Kind, "Virtual", MethodKind::Virtual);
> - IO.enumCase(Kind, "Static", MethodKind::Static);
> - IO.enumCase(Kind, "Friend", MethodKind::Friend);
> - IO.enumCase(Kind, "IntroducingVirtual", MethodKind::
> IntroducingVirtual);
> - IO.enumCase(Kind, "PureVirtual", MethodKind::PureVirtual);
> - IO.enumCase(Kind, "PureIntroducingVirtual",
> - MethodKind::PureIntroducingVirtual);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<WindowsRTClassKind> {
> - static void enumeration(IO &IO, WindowsRTClassKind &Value) {
> - IO.enumCase(Value, "None", WindowsRTClassKind::None);
> - IO.enumCase(Value, "Ref", WindowsRTClassKind::RefClass);
> - IO.enumCase(Value, "Value", WindowsRTClassKind::ValueClass);
> - IO.enumCase(Value, "Interface", WindowsRTClassKind::Interface);
> - }
> -};
> -
> -template <> struct ScalarEnumerationTraits<LabelType> {
> - static void enumeration(IO &IO, LabelType &Value) {
> - IO.enumCase(Value, "Near", LabelType::Near);
> - IO.enumCase(Value, "Far", LabelType::Far);
> - }
> -};
> -
> -template <> struct ScalarBitSetTraits<PointerOptions> {
> - static void bitset(IO &IO, PointerOptions &Options) {
> - IO.bitSetCase(Options, "None", PointerOptions::None);
> - IO.bitSetCase(Options, "Flat32", PointerOptions::Flat32);
> - IO.bitSetCase(Options, "Volatile", PointerOptions::Volatile);
> - IO.bitSetCase(Options, "Const", PointerOptions::Const);
> - IO.bitSetCase(Options, "Unaligned", PointerOptions::Unaligned);
> - IO.bitSetCase(Options, "Restrict", PointerOptions::Restrict);
> - IO.bitSetCase(Options, "WinRTSmartPointer",
> - PointerOptions::WinRTSmartPointer);
> - }
> -};
> -
> -template <> struct ScalarBitSetTraits<ModifierOptions> {
> - static void bitset(IO &IO, ModifierOptions &Options) {
> - IO.bitSetCase(Options, "None", ModifierOptions::None);
> - IO.bitSetCase(Options, "Const", ModifierOptions::Const);
> - IO.bitSetCase(Options, "Volatile", ModifierOptions::Volatile);
> - IO.bitSetCase(Options, "Unaligned", ModifierOptions::Unaligned);
> - }
> -};
> -
> -template <> struct ScalarBitSetTraits<FunctionOptions> {
> - static void bitset(IO &IO, FunctionOptions &Options) {
> - IO.bitSetCase(Options, "None", FunctionOptions::None);
> - IO.bitSetCase(Options, "CxxReturnUdt", FunctionOptions::CxxReturnUdt)
> ;
> - IO.bitSetCase(Options, "Constructor", FunctionOptions::Constructor);
> - IO.bitSetCase(Options, "ConstructorWithVirtualBases",
> - FunctionOptions::ConstructorWithVirtualBases);
> - }
> -};
> -
> -template <> struct ScalarBitSetTraits<ClassOptions> {
> - static void bitset(IO &IO, ClassOptions &Options) {
> - IO.bitSetCase(Options, "None", ClassOptions::None);
> - IO.bitSetCase(Options, "HasConstructorOrDestructor",
> - ClassOptions::HasConstructorOrDestructor);
> - IO.bitSetCase(Options, "HasOverloadedOperator",
> - ClassOptions::HasOverloadedOperator);
> - IO.bitSetCase(Options, "Nested", ClassOptions::Nested);
> - IO.bitSetCase(Options, "ContainsNestedClass",
> - ClassOptions::ContainsNestedClass);
> - IO.bitSetCase(Options, "HasOverloadedAssignmentOperator",
> - ClassOptions::HasOverloadedAssignmentOperator);
> - IO.bitSetCase(Options, "HasConversionOperator",
> - ClassOptions::HasConversionOperator);
> - IO.bitSetCase(Options, "ForwardReference", ClassOptions::
> ForwardReference);
> - IO.bitSetCase(Options, "Scoped", ClassOptions::Scoped);
> - IO.bitSetCase(Options, "HasUniqueName", ClassOptions::HasUniqueName);
> - IO.bitSetCase(Options, "Sealed", ClassOptions::Sealed);
> - IO.bitSetCase(Options, "Intrinsic", ClassOptions::Intrinsic);
> - }
> -};
> -
> -template <> struct ScalarBitSetTraits<MethodOptions> {
> - static void bitset(IO &IO, MethodOptions &Options) {
> - IO.bitSetCase(Options, "None", MethodOptions::None);
> - IO.bitSetCase(Options, "Pseudo", MethodOptions::Pseudo);
> - IO.bitSetCase(Options, "NoInherit", MethodOptions::NoInherit);
> - IO.bitSetCase(Options, "NoConstruct", MethodOptions::NoConstruct);
> - IO.bitSetCase(Options, "CompilerGenerated",
> - MethodOptions::CompilerGenerated);
> - IO.bitSetCase(Options, "Sealed", MethodOptions::Sealed);
> - }
> -};
> -
> -void ScalarTraits<APSInt>::output(const APSInt &S, void *,
> - llvm::raw_ostream &OS) {
> - S.print(OS, true);
> -}
> -StringRef ScalarTraits<APSInt>::input(StringRef Scalar, void *Ctx,
> APSInt &S) {
> - S = APSInt(Scalar);
> - return "";
> -}
> -
> -bool ScalarTraits<APSInt>::mustQuote(StringRef Scalar) { return false; }
> -
> -void MappingContextTraits<CVType, pdb::yaml::SerializationContext>::
> mapping(
> - IO &IO, CVType &Record, pdb::yaml::SerializationContext &Context) {
> - if (IO.outputting())
> - consumeError(codeview::visitTypeRecord(Record, Context.Dumper));
> -}
> -
> -void MappingTraits<StringIdRecord>::mapping(IO &IO, StringIdRecord
> &String) {
> - IO.mapRequired("Id", String.Id);
> - IO.mapRequired("String", String.String);
> -}
> -
> -void MappingTraits<ArgListRecord>::mapping(IO &IO, ArgListRecord &Args) {
> - IO.mapRequired("ArgIndices", Args.ArgIndices);
> -}
> -
> -void MappingTraits<StringListRecord>::mapping(IO &IO, StringListRecord
> &Strings) {
> - IO.mapRequired("StringIndices", Strings.StringIndices);
> -}
> -
> -void MappingTraits<ClassRecord>::mapping(IO &IO, ClassRecord &Class) {
> - IO.mapRequired("MemberCount", Class.MemberCount);
> - IO.mapRequired("Options", Class.Options);
> - IO.mapRequired("FieldList", Class.FieldList);
> - IO.mapRequired("Name", Class.Name);
> - IO.mapRequired("UniqueName", Class.UniqueName);
> - IO.mapRequired("DerivationList", Class.DerivationList);
> - IO.mapRequired("VTableShape", Class.VTableShape);
> - IO.mapRequired("Size", Class.Size);
> -}
> -
> -void MappingTraits<UnionRecord>::mapping(IO &IO, UnionRecord &Union) {
> - IO.mapRequired("MemberCount", Union.MemberCount);
> - IO.mapRequired("Options", Union.Options);
> - IO.mapRequired("FieldList", Union.FieldList);
> - IO.mapRequired("Name", Union.Name);
> - IO.mapRequired("UniqueName", Union.UniqueName);
> - IO.mapRequired("Size", Union.Size);
> -}
> -
> -void MappingTraits<EnumRecord>::mapping(IO &IO, EnumRecord &Enum) {
> - IO.mapRequired("NumEnumerators", Enum.MemberCount);
> - IO.mapRequired("Options", Enum.Options);
> - IO.mapRequired("FieldList", Enum.FieldList);
> - IO.mapRequired("Name", Enum.Name);
> - IO.mapRequired("UniqueName", Enum.UniqueName);
> - IO.mapRequired("UnderlyingType", Enum.UnderlyingType);
> -}
> -
> -void MappingTraits<ArrayRecord>::mapping(IO &IO, ArrayRecord &AT) {
> - IO.mapRequired("ElementType", AT.ElementType);
> - IO.mapRequired("IndexType", AT.IndexType);
> - IO.mapRequired("Size", AT.Size);
> - IO.mapRequired("Name", AT.Name);
> -}
> -
> -void MappingTraits<VFTableRecord>::mapping(IO &IO, VFTableRecord &VFT) {
> - IO.mapRequired("CompleteClass", VFT.CompleteClass);
> - IO.mapRequired("OverriddenVFTable", VFT.OverriddenVFTable);
> - IO.mapRequired("VFPtrOffset", VFT.VFPtrOffset);
> - IO.mapRequired("MethodNames", VFT.MethodNames);
> -}
> -
> -void MappingTraits<MemberFuncIdRecord>::mapping(IO &IO,
> - MemberFuncIdRecord &Id) {
> - IO.mapRequired("ClassType", Id.ClassType);
> - IO.mapRequired("FunctionType", Id.FunctionType);
> - IO.mapRequired("Name", Id.Name);
> -}
> -
> -void MappingTraits<ProcedureRecord>::mapping(IO &IO, ProcedureRecord
> &Proc) {
> - IO.mapRequired("ReturnType", Proc.ReturnType);
> - IO.mapRequired("CallConv", Proc.CallConv);
> - IO.mapRequired("Options", Proc.Options);
> - IO.mapRequired("ParameterCount", Proc.ParameterCount);
> - IO.mapRequired("ArgumentList", Proc.ArgumentList);
> -}
> -
> -void MappingTraits<MemberFunctionRecord>::mapping(IO &IO,
> - MemberFunctionRecord
> &MF) {
> - IO.mapRequired("ReturnType", MF.ReturnType);
> - IO.mapRequired("ClassType", MF.ClassType);
> - IO.mapRequired("ThisType", MF.ThisType);
> - IO.mapRequired("CallConv", MF.CallConv);
> - IO.mapRequired("Options", MF.Options);
> - IO.mapRequired("ParameterCount", MF.ParameterCount);
> - IO.mapRequired("ArgumentList", MF.ArgumentList);
> - IO.mapRequired("ThisPointerAdjustment", MF.ThisPointerAdjustment);
> -}
> -
> -void MappingTraits<MethodOverloadListRecord>::mapping(
> - IO &IO, MethodOverloadListRecord &MethodList) {
> - IO.mapRequired("Methods", MethodList.Methods);
> -}
> -
> -void MappingTraits<FuncIdRecord>::mapping(IO &IO, FuncIdRecord &Func) {
> - IO.mapRequired("ParentScope", Func.ParentScope);
> - IO.mapRequired("FunctionType", Func.FunctionType);
> - IO.mapRequired("Name", Func.Name);
> -}
> -
> -void MappingTraits<TypeServer2Record>::mapping(IO &IO, TypeServer2Record
> &TS) {
> - IO.mapRequired("Guid", TS.Guid);
> - IO.mapRequired("Age", TS.Age);
> - IO.mapRequired("Name", TS.Name);
> -}
> -
> -void MappingTraits<PointerRecord>::mapping(IO &IO, PointerRecord &Ptr) {
> - IO.mapRequired("ReferentType", Ptr.ReferentType);
> - IO.mapRequired("Attrs", Ptr.Attrs);
> - IO.mapOptional("MemberInfo", Ptr.MemberInfo);
> -}
> -
> -void MappingTraits<MemberPointerInfo>::mapping(IO &IO, MemberPointerInfo
> &MPI) {
> - IO.mapRequired("ContainingType", MPI.ContainingType);
> - IO.mapRequired("Representation", MPI.Representation);
> -}
> -
> -void MappingTraits<ModifierRecord>::mapping(IO &IO, ModifierRecord &Mod)
> {
> - IO.mapRequired("ModifiedType", Mod.ModifiedType);
> - IO.mapRequired("Modifiers", Mod.Modifiers);
> -}
> -
> -void MappingTraits<BitFieldRecord>::mapping(IO &IO, BitFieldRecord
> &BitField) {
> - IO.mapRequired("Type", BitField.Type);
> - IO.mapRequired("BitSize", BitField.BitSize);
> - IO.mapRequired("BitOffset", BitField.BitOffset);
> -}
> -
> -void MappingTraits<VFTableShapeRecord>::mapping(IO &IO,
> - VFTableShapeRecord
> &Shape) {
> - IO.mapRequired("Slots", Shape.Slots);
> -}
> -
> -void MappingTraits<UdtSourceLineRecord>::mapping(IO &IO,
> - UdtSourceLineRecord
> &Line) {
> - IO.mapRequired("UDT", Line.UDT);
> - IO.mapRequired("SourceFile", Line.SourceFile);
> - IO.mapRequired("LineNumber", Line.LineNumber);
> -}
> -
> -void MappingTraits<UdtModSourceLineRecord>::mapping(
> - IO &IO, UdtModSourceLineRecord &Line) {
> - IO.mapRequired("UDT", Line.UDT);
> - IO.mapRequired("SourceFile", Line.SourceFile);
> - IO.mapRequired("LineNumber", Line.LineNumber);
> - IO.mapRequired("Module", Line.Module);
> -}
> -
> -void MappingTraits<BuildInfoRecord>::mapping(IO &IO, BuildInfoRecord
> &Args) {
> - IO.mapRequired("ArgIndices", Args.ArgIndices);
> -}
> -
> -void MappingTraits<LabelRecord>::mapping(IO &IO, LabelRecord &R) {
> - IO.mapRequired("Mode", R.Mode);
> -}
> -
> -void MappingTraits<NestedTypeRecord>::mapping(IO &IO,
> - NestedTypeRecord &Nested) {
> - IO.mapRequired("Type", Nested.Type);
> - IO.mapRequired("Name", Nested.Name);
> -}
> -
> -void MappingTraits<OneMethodRecord>::mapping(IO &IO, OneMethodRecord
> &Method) {
> - IO.mapRequired("Type", Method.Type);
> - IO.mapRequired("Attrs", Method.Attrs.Attrs);
> - IO.mapRequired("VFTableOffset", Method.VFTableOffset);
> - IO.mapRequired("Name", Method.Name);
> -}
> -
> -void MappingTraits<OverloadedMethodRecord>::mapping(
> - IO &IO, OverloadedMethodRecord &Method) {
> - IO.mapRequired("NumOverloads", Method.NumOverloads);
> - IO.mapRequired("MethodList", Method.MethodList);
> - IO.mapRequired("Name", Method.Name);
> -}
> -
> -void MappingTraits<DataMemberRecord>::mapping(IO &IO, DataMemberRecord
> &Field) {
> - IO.mapRequired("Attrs", Field.Attrs.Attrs);
> - IO.mapRequired("Type", Field.Type);
> - IO.mapRequired("FieldOffset", Field.FieldOffset);
> - IO.mapRequired("Name", Field.Name);
> -}
> -
> -void MappingTraits<StaticDataMemberRecord>::mapping(
> - IO &IO, StaticDataMemberRecord &Field) {
> - IO.mapRequired("Attrs", Field.Attrs.Attrs);
> - IO.mapRequired("Type", Field.Type);
> - IO.mapRequired("Name", Field.Name);
> -}
> -
> -void MappingTraits<VFPtrRecord>::mapping(IO &IO, VFPtrRecord &VFTable) {
> - IO.mapRequired("Type", VFTable.Type);
> -}
> -
> -void MappingTraits<EnumeratorRecord>::mapping(IO &IO, EnumeratorRecord
> &Enum) {
> - IO.mapRequired("Attrs", Enum.Attrs.Attrs);
> - IO.mapRequired("Value", Enum.Value);
> - IO.mapRequired("Name", Enum.Name);
> -}
> -
> -void MappingTraits<BaseClassRecord>::mapping(IO &IO, BaseClassRecord
> &Base) {
> - IO.mapRequired("Attrs", Base.Attrs.Attrs);
> - IO.mapRequired("Type", Base.Type);
> - IO.mapRequired("Offset", Base.Offset);
> -}
> -
> -void MappingTraits<VirtualBaseClassRecord>::mapping(
> - IO &IO, VirtualBaseClassRecord &Base) {
> - IO.mapRequired("Attrs", Base.Attrs.Attrs);
> - IO.mapRequired("BaseType", Base.BaseType);
> - IO.mapRequired("VBPtrType", Base.VBPtrType);
> - IO.mapRequired("VBPtrOffset", Base.VBPtrOffset);
> - IO.mapRequired("VTableIndex", Base.VTableIndex);
> -}
> -
> -void MappingTraits<ListContinuationRecord>::mapping(
> - IO &IO, ListContinuationRecord &Cont) {
> - IO.mapRequired("ContinuationIndex", Cont.ContinuationIndex);
> -}
> -
> -void ScalarTraits<codeview::TypeIndex>::output(const codeview::TypeIndex
> &S,
> - void *, llvm::raw_ostream
> &OS) {
> - OS << S.getIndex();
> -}
> -StringRef ScalarTraits<codeview::TypeIndex>::input(StringRef Scalar,
> void *Ctx,
> - codeview::TypeIndex
> &S) {
> - uint32_t I;
> - StringRef Result = ScalarTraits<uint32_t>::input(Scalar, Ctx, I);
> - if (!Result.empty())
> - return Result;
> - S = TypeIndex(I);
> - return "";
> -}
> -bool ScalarTraits<codeview::TypeIndex>::mustQuote(StringRef Scalar) {
> - return false;
> -}
> -
> -void ScalarEnumerationTraits<TypeLeafKind>::enumeration(IO &io,
> - TypeLeafKind
> &Value) {
> - auto TypeLeafNames = getTypeLeafNames();
> - for (const auto &E : TypeLeafNames)
> - io.enumCase(Value, E.Name.str().c_str(), E.Value);
> -}
> -}
> -}
> -
> -Error llvm::codeview::yaml::YamlTypeDumperCallbacks::visitTypeBegin(
> - CVType &CVR) {
> - YamlIO.mapRequired("Kind", CVR.Type);
> - return Error::success();
> -}
> -
> -Error llvm::codeview::yaml::YamlTypeDumperCallbacks::visitMemberBegin(
> - CVMemberRecord &Record) {
> - YamlIO.mapRequired("Kind", Record.Kind);
> - return Error::success();
> -}
> -
> -void llvm::codeview::yaml::YamlTypeDumperCallbacks::visitKnownRecordImpl(
> - const char *Name, CVType &CVR, FieldListRecord &FieldList) {
> - std::vector<llvm::pdb::yaml::PdbTpiFieldListRecord> FieldListRecords;
> - if (YamlIO.outputting()) {
> - // If we are outputting, then `FieldList.Data` contains a huge chunk
> of data
> - // representing the serialized list of members. We need to split it
> up into
> - // individual CVType records where each record represents an
> individual
> - // member. This way, we can simply map the entire thing as a Yaml
> sequence,
> - // which will recurse back to the standard handler for top-level
> fields
> - // (top-level and member fields all have the exact same Yaml syntax
> so use
> - // the same parser).
> - FieldListRecordSplitter Splitter(FieldListRecords);
> - consumeError(codeview::visitMemberRecordStream(FieldList.Data,
> Splitter));
> - }
> - // Note that if we're not outputting (i.e. Yaml -> PDB) the result of
> this
> - // mapping gets lost, as the records are simply stored in this locally
> scoped
> - // vector. What's important though is they are all sharing a single
> - // Serializer
> - // instance (in `Context.ActiveSerializer`), and that is building up a
> list of
> - // all the types. The fact that we need a throwaway vector here is
> just to
> - // appease the YAML API to treat this as a sequence and do this mapping
> once
> - // for each YAML Sequence element in the input Yaml stream.
> - YamlIO.mapRequired("FieldList", FieldListRecords, Context);
> -}
> -
> -namespace llvm {
> -namespace yaml {
> -template <>
> -struct MappingContextTraits<pdb::yaml::PdbTpiFieldListRecord,
> - pdb::yaml::SerializationContext> {
> - static void mapping(IO &IO, pdb::yaml::PdbTpiFieldListRecord &Obj,
> - pdb::yaml::SerializationContext &Context) {
> - if (IO.outputting())
> - consumeError(codeview::visitMemberRecord(Obj.Record,
> Context.Dumper));
> - else {
> - // If we are not outputting, then the array contains no data
> starting out,
> - // and is instead populated from the sequence represented by the
> yaml --
> - // again, using the same logic that we use for top-level records.
> - assert(Context.ActiveSerializer && "There is no active
> serializer!");
> - codeview::TypeVisitorCallbackPipeline Pipeline;
> - pdb::TpiHashUpdater Hasher;
> -
> - Pipeline.addCallbackToPipeline(Context.Dumper);
> - Pipeline.addCallbackToPipeline(*Context.ActiveSerializer);
> - Pipeline.addCallbackToPipeline(Hasher);
> - consumeError(
> - codeview::visitMemberRecord(Obj.Record, Pipeline,
> VDS_BytesExternal));
> - }
> - }
> -};
> -}
> -}
>
> Removed: llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/YamlTypeDumper.h?rev=304247&view=auto
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.h (original)
> +++ llvm/trunk/tools/llvm-pdbdump/YamlTypeDumper.h (removed)
> @@ -1,116 +0,0 @@
> -//===- YamlTypeDumper.h --------------------------------------- *- C++
> --*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===------------------------------------------------------
> ----------------===//
> -
> -#ifndef LLVM_TOOLS_LLVMPDBDUMP_YAMLTYPEDUMPER_H
> -#define LLVM_TOOLS_LLVMPDBDUMP_YAMLTYPEDUMPER_H
> -
> -#include "llvm/DebugInfo/CodeView/CodeView.h"
> -#include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
> -#include "llvm/Support/YAMLTraits.h"
> -
> -namespace llvm {
> -namespace pdb {
> -namespace yaml {
> -struct SerializationContext;
> -}
> -}
> -namespace codeview {
> -namespace yaml {
> -class YamlTypeDumperCallbacks : public TypeVisitorCallbacks {
> -public:
> - YamlTypeDumperCallbacks(llvm::yaml::IO &IO,
> - llvm::pdb::yaml::SerializationContext &Context)
> - : YamlIO(IO), Context(Context) {}
> -
> - virtual Error visitTypeBegin(CVType &Record) override;
> - virtual Error visitMemberBegin(CVMemberRecord &Record) override;
> -
> -#define TYPE_RECORD(EnumName, EnumVal, Name)
> \
> - Error visitKnownRecord(CVRecord<TypeLeafKind> &CVR, Name##Record
> &Record) \
> - override {
> \
> - visitKnownRecordImpl(#Name, CVR, Record);
> \
> - return Error::success();
> \
> - }
> -#define MEMBER_RECORD(EnumName, EnumVal, Name)
> \
> - Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record)
> override { \
> - visitKnownMemberImpl(#Name, Record);
> \
> - return Error::success();
> \
> - }
> -#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> -
> -private:
> - template <typename T> void visitKnownMemberImpl(const char *Name, T
> &Record) {
> - YamlIO.mapRequired(Name, Record);
> - }
> -
> - template <typename T>
> - void visitKnownRecordImpl(const char *Name, CVType &Type, T &Record) {
> - YamlIO.mapRequired(Name, Record);
> - }
> -
> - void visitKnownRecordImpl(const char *Name, CVType &CVR,
> - FieldListRecord &FieldList);
> -
> - llvm::yaml::IO &YamlIO;
> - llvm::pdb::yaml::SerializationContext &Context;
> -};
> -}
> -}
> -namespace pdb {
> -namespace yaml {
> -struct SerializationContext;
> -}
> -}
> -}
> -
> -namespace llvm {
> -namespace yaml {
> -
> -template <> struct ScalarTraits<APSInt> {
> - static void output(const APSInt &S, void *, llvm::raw_ostream &OS);
> - static StringRef input(StringRef Scalar, void *Ctx, APSInt &S);
> - static bool mustQuote(StringRef Scalar);
> -};
> -
> -template <> struct ScalarTraits<codeview::TypeIndex> {
> - static void output(const codeview::TypeIndex &S, void *,
> - llvm::raw_ostream &OS);
> - static StringRef input(StringRef Scalar, void *Ctx, codeview::TypeIndex
> &S);
> - static bool mustQuote(StringRef Scalar);
> -};
> -
> -template <> struct MappingTraits<codeview::MemberPointerInfo> {
> - static void mapping(IO &IO, codeview::MemberPointerInfo &Obj);
> -};
> -
> -template <>
> -struct MappingContextTraits<codeview::CVType, pdb::yaml::SerializationContext>
> {
> - static void mapping(IO &IO, codeview::CVType &Obj,
> - pdb::yaml::SerializationContext &Context);
> -};
> -
> -template <> struct ScalarEnumerationTraits<codeview::TypeLeafKind> {
> - static void enumeration(IO &io, codeview::TypeLeafKind &Value);
> -};
> -
> -#define TYPE_RECORD(EnumName, EnumVal, Name)
> \
> - template <> struct MappingTraits<codeview::Name##Record> {
> \
> - static void mapping(IO &IO, codeview::Name##Record &Obj);
> \
> - };
> -#define MEMBER_RECORD(EnumName, EnumVal, Name)
> \
> - TYPE_RECORD(EnumName, EnumVal, Name)
> -#define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
> -#include "llvm/DebugInfo/CodeView/TypeRecords.def"
> -}
> -}
> -
> -#endif
>
> Modified: llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-
> pdbdump/llvm-pdbdump.cpp?rev=304248&r1=304247&r2=304248&view=diff
> ============================================================
> ==================
> --- llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp Tue May 30 16:53:05
> 2017
> @@ -61,6 +61,7 @@
> #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
> #include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
> #include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
> +#include "llvm/ObjectYAML/CodeViewYAML.h"
> #include "llvm/Support/BinaryByteStream.h"
> #include "llvm/Support/COM.h"
> #include "llvm/Support/CommandLine.h"
> @@ -476,6 +477,7 @@ static void yamlToPdb(StringRef Path) {
> std::unique_ptr<MemoryBuffer> &Buffer = ErrorOrBuffer.get();
>
> llvm::yaml::Input In(Buffer->getBuffer());
> + In.setContext(&Allocator);
> pdb::yaml::PdbObject YamlObj(Allocator);
> In >> YamlObj;
>
> @@ -584,7 +586,7 @@ static void yamlToPdb(StringRef Path) {
> auto Inlinees = llvm::make_unique<DebugInlineeLinesSubsection>(
> ChecksumRef, Inlinee.HasExtraFiles);
> for (const auto &Site : Inlinee.Sites) {
> - Inlinees->addInlineSite(Site.Inlinee, Site.FileName,
> + Inlinees->addInlineSite(TypeIndex(Site.Inlinee), Site.FileName,
> Site.SourceLineNum);
> if (!Inlinee.HasExtraFiles)
> continue;
> @@ -601,14 +603,18 @@ static void yamlToPdb(StringRef Path) {
> auto &TpiBuilder = Builder.getTpiBuilder();
> const auto &Tpi = YamlObj.TpiStream.getValueOr(DefaultTpiStream);
> TpiBuilder.setVersionHeader(Tpi.Version);
> - for (const auto &R : Tpi.Records)
> - TpiBuilder.addTypeRecord(R.Record.data(), R.Record.Hash);
> + for (const auto &R : Tpi.Records) {
> + CVType Type = R.toCodeViewRecord(Allocator);
> + TpiBuilder.addTypeRecord(Type.RecordData, None);
> + }
>
> const auto &Ipi = YamlObj.IpiStream.getValueOr(DefaultIpiStream);
> auto &IpiBuilder = Builder.getIpiBuilder();
> IpiBuilder.setVersionHeader(Ipi.Version);
> - for (const auto &R : Ipi.Records)
> - IpiBuilder.addTypeRecord(R.Record.data(), R.Record.Hash);
> + for (const auto &R : Ipi.Records) {
> + CVType Type = R.toCodeViewRecord(Allocator);
> + IpiBuilder.addTypeRecord(Type.RecordData, None);
> + }
>
> ExitOnErr(Builder.commit(opts::yaml2pdb::YamlPdbOutputFile));
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
--
--
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170530/1ca3159c/attachment-0001.html>
More information about the llvm-commits
mailing list