<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.hoenzb
        {mso-style-name:hoenzb;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hello Reid,
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I’m seeing a different build error on gcc 4.7.2 that I think is caused by 257658<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">/work/llvm/llvm/tools/llvm-readobj/COFFDumper.cpp: In member function ‘void {anonymous}::COFFDumper::printCodeViewSymbolSection(llvm::StringRef, const llvm::object::SectionRef&)’:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">/work/llvm/llvm/tools/llvm-readobj/COFFDumper.cpp:996:30: error: ‘class std::map<llvm::StringRef, const llvm::codeview::FrameData*>’ has no member named ‘emplace’
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">libstdc++ for gcc 4.7 doesn’t implement emplace in std::map, it looks to be first implemented in 4.8.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">My understanding from http://llvm.org/docs/GettingStarted.html  is that gcc 4.7.0 is the minimum required for building llvm. I’m assuming this applies to llvm_readobj.
 Would it be possible to use an alternative to emplace?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Kind regards<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Peter<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvm-commits [mailto:llvm-commits-bounces@lists.llvm.org]
<b>On Behalf Of </b>Reid Kleckner via llvm-commits<br>
<b>Sent:</b> 13 January 2016 20:43<br>
<b>To:</b> Teresa Johnson<br>
<b>Cc:</b> llvm-commits<br>
<b>Subject:</b> Re: [llvm] r257658 - [readobj] Expand CodeView dumping functionality<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Sorry, fixed in <span style="color:black">r257665.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Jan 13, 2016 at 12:37 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" target="_blank">tejohnson@google.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Hi Reid,<br>
<br>
I'm getting an error when I build using clang:<br>
<br>
[305/2751] Building CXX object lib/Deb...s/LLVMDebugInfoPDB.dir/PDBExtras.cpp.o<br>
FAILED: /usr/local/google/home/tejohnson/extra/clang+llvm-3.7.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++<br>
  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS<br>
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC<br>
-fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter<br>
-Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic<br>
-Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor<br>
-Wdelete-non-virtual-dtor -Werror -std=c++11 -fcolor-diagnostics -g<br>
-Ilib/DebugInfo/PDB<br>
-I/usr/local/google/home/tejohnson/llvm/llvm_13/lib/DebugInfo/PDB<br>
-Iinclude -I/usr/local/google/home/tejohnson/llvm/llvm_13/include<br>
-fno-exceptions -fno-rtti -MMD -MT<br>
lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBExtras.cpp.o -MF<br>
"lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBExtras.cpp.o.d"<br>
-o lib/DebugInfo/PDB/CMakeFiles/LLVMDebugInfoPDB.dir/PDBExtras.cpp.o<br>
-c /usr/local/google/home/tejohnson/llvm/llvm_13/lib/DebugInfo/PDB/PDBExtras.cpp<br>
/usr/local/google/home/tejohnson/llvm/llvm_13/lib/DebugInfo/PDB/PDBExtras.cpp:70:3:<br>
error: default label in switch which covers all enumeration values<br>
[-Werror,-Wcovered-switch-default]<br>
  default:<br>
  ^<br>
1 error generated.<br>
<br>
Looks like this is caused by this commit?<br>
Teresa<br>
<br>
On Wed, Jan 13, 2016 at 11:32 AM, Reid Kleckner via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: rnk<br>
> Date: Wed Jan 13 13:32:35 2016<br>
> New Revision: 257658<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257658&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=257658&view=rev</a><br>
> Log:<br>
> [readobj] Expand CodeView dumping functionality<br>
><br>
> This rewrites and expands the existing codeview dumping functionality in<br>
> llvm-readobj using techniques similar to those in lib/Object. This defines a<br>
> number of new records and enums useful for reading memory mapped codeview<br>
> sections in COFF objects.<br>
><br>
> The dumper is intended as a testing tool for LLVM as it grows more codeview<br>
> output capabilities.<br>
><br>
> Reviewers: majnemer<br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D16104" target="_blank">
http://reviews.llvm.org/D16104</a><br>
><br>
> Added:<br>
>     llvm/trunk/tools/llvm-readobj/CVLeafTypes.def<br>
>     llvm/trunk/tools/llvm-readobj/CVSymbolTypes.def<br>
>     llvm/trunk/tools/llvm-readobj/CodeView.h<br>
> Modified:<br>
>     llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h<br>
>     llvm/trunk/include/llvm/DebugInfo/CodeView/TypeIndex.h<br>
>     llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h<br>
>     llvm/trunk/include/llvm/Support/COFF.h<br>
>     llvm/trunk/include/llvm/Support/Endian.h<br>
>     llvm/trunk/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp<br>
>     llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp<br>
>     llvm/trunk/test/DebugInfo/COFF/asm.ll<br>
>     llvm/trunk/test/DebugInfo/COFF/cpp-mangling.ll<br>
>     llvm/trunk/test/DebugInfo/COFF/multifile.ll<br>
>     llvm/trunk/test/DebugInfo/COFF/multifunction.ll<br>
>     llvm/trunk/test/DebugInfo/COFF/simple.ll<br>
>     llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test<br>
>     llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp<br>
>     llvm/trunk/tools/llvm-readobj/COFFDumper.cpp<br>
>     llvm/trunk/tools/llvm-readobj/StreamWriter.h<br>
>     llvm/trunk/tools/llvm-readobj/llvm-readobj.h<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/CodeView.h Wed Jan 13 13:32:35 2016<br>
> @@ -15,6 +15,97 @@<br>
>  namespace llvm {<br>
>  namespace codeview {<br>
><br>
> +/// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented<br>
> +/// here: <a href="https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx" target="_blank">
https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx</a><br>
> +enum class CPUType : uint16_t {<br>
> +  Intel8080 = 0x0,<br>
> +  Intel8086 = 0x1,<br>
> +  Intel80286 = 0x2,<br>
> +  Intel80386 = 0x3,<br>
> +  Intel80486 = 0x4,<br>
> +  Pentium = 0x5,<br>
> +  PentiumPro = 0x6,<br>
> +  Pentium3 = 0x7,<br>
> +  MIPS = 0x10,<br>
> +  MIPS16 = 0x11,<br>
> +  MIPS32 = 0x12,<br>
> +  MIPS64 = 0x13,<br>
> +  MIPSI = 0x14,<br>
> +  MIPSII = 0x15,<br>
> +  MIPSIII = 0x16,<br>
> +  MIPSIV = 0x17,<br>
> +  MIPSV = 0x18,<br>
> +  M68000 = 0x20,<br>
> +  M68010 = 0x21,<br>
> +  M68020 = 0x22,<br>
> +  M68030 = 0x23,<br>
> +  M68040 = 0x24,<br>
> +  Alpha = 0x30,<br>
> +  Alpha21164 = 0x31,<br>
> +  Alpha21164A = 0x32,<br>
> +  Alpha21264 = 0x33,<br>
> +  Alpha21364 = 0x34,<br>
> +  PPC601 = 0x40,<br>
> +  PPC603 = 0x41,<br>
> +  PPC604 = 0x42,<br>
> +  PPC620 = 0x43,<br>
> +  PPCFP = 0x44,<br>
> +  PPCBE = 0x45,<br>
> +  SH3 = 0x50,<br>
> +  SH3E = 0x51,<br>
> +  SH3DSP = 0x52,<br>
> +  SH4 = 0x53,<br>
> +  SHMedia = 0x54,<br>
> +  ARM3 = 0x60,<br>
> +  ARM4 = 0x61,<br>
> +  ARM4T = 0x62,<br>
> +  ARM5 = 0x63,<br>
> +  ARM5T = 0x64,<br>
> +  ARM6 = 0x65,<br>
> +  ARM_XMAC = 0x66,<br>
> +  ARM_WMMX = 0x67,<br>
> +  ARM7 = 0x68,<br>
> +  Omni = 0x70,<br>
> +  Ia64 = 0x80,<br>
> +  Ia64_2 = 0x81,<br>
> +  CEE = 0x90,<br>
> +  AM33 = 0xa0,<br>
> +  M32R = 0xb0,<br>
> +  TriCore = 0xc0,<br>
> +  X64 = 0xd0,<br>
> +  EBC = 0xe0,<br>
> +  Thumb = 0xf0,<br>
> +  ARMNT = 0xf4,<br>
> +  D3D11_Shader = 0x100,<br>
> +};<br>
> +<br>
> +/// These values correspond to the CV_CFL_LANG enumeration, and are documented<br>
> +/// here: <a href="https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx" target="_blank">
https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx</a><br>
> +enum SourceLanguage : uint8_t {<br>
> +  C = 0x00,<br>
> +  Cpp = 0x01,<br>
> +  Fortran = 0x02,<br>
> +  Masm = 0x03,<br>
> +  Pascal = 0x04,<br>
> +  Basic = 0x05,<br>
> +  Cobol = 0x06,<br>
> +  Link = 0x07,<br>
> +  Cvtres = 0x08,<br>
> +  Cvtpgd = 0x09,<br>
> +  CSharp = 0x0a,<br>
> +  VB = 0x0b,<br>
> +  ILAsm = 0x0c,<br>
> +  Java = 0x0d,<br>
> +  JScript = 0x0e,<br>
> +  MSIL = 0x0f,<br>
> +  HLSL = 0x10<br>
> +};<br>
> +<br>
> +/// These values correspond to the CV_call_e enumeration, and are documented<br>
> +/// at the following locations:<br>
> +///   <a href="https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx" target="_blank">https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx</a><br>
> +///   <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx" target="_blank">https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx</a><br>
> +///<br>
>  enum class CallingConvention : uint8_t {<br>
>    NearC = 0x00,       // near right to left push, caller pops stack<br>
>    FarC = 0x01,        // far right to left push, caller pops stack<br>
> @@ -140,6 +231,7 @@ enum class HfaKind : uint8_t {<br>
>    Other = 0x03<br>
>  };<br>
><br>
> +/// Source-level access specifier. (CV_access_e)<br>
>  enum class MemberAccess : uint8_t {<br>
>    None = 0,<br>
>    Private = 1,<br>
> @@ -147,6 +239,7 @@ enum class MemberAccess : uint8_t {<br>
>    Public = 3<br>
>  };<br>
><br>
> +/// Part of member attribute flags. (CV_methodprop_e)<br>
>  enum class MethodKind : uint8_t {<br>
>    Vanilla = 0x00,<br>
>    Virtual = 0x01,<br>
> @@ -157,9 +250,14 @@ enum class MethodKind : uint8_t {<br>
>    PureIntroducingVirtual = 0x06<br>
>  };<br>
><br>
> +/// Equivalent to CV_fldattr_t bitfield.<br>
>  enum class MethodOptions : uint16_t {<br>
>    None = 0x0000,<br>
> +  AccessMask = 0x0003,<br>
> +  MethodKindMask = 0x001c,<br>
>    Pseudo = 0x0020,<br>
> +  NoInherit = 0x0040,<br>
> +  NoConstruct = 0x0080,<br>
>    CompilerGenerated = 0x0100,<br>
>    Sealed = 0x0200<br>
>  };<br>
> @@ -178,6 +276,7 @@ inline MethodOptions operator~(MethodOpt<br>
>    return static_cast<MethodOptions>(~static_cast<uint16_t>(a));<br>
>  }<br>
><br>
> +/// Equivalent to CV_modifier_t.<br>
>  enum class ModifierOptions : uint16_t {<br>
>    None = 0x0000,<br>
>    Const = 0x0001,<br>
> @@ -207,9 +306,18 @@ enum class ModuleSubstreamKind : uint32_<br>
>    FrameData = 0xf5,<br>
>    InlineeLines = 0xf6,<br>
>    CrossScopeImports = 0xf7,<br>
> -  CrossScopeExports = 0xf8<br>
> +  CrossScopeExports = 0xf8,<br>
> +<br>
> +  // These appear to relate to .Net assembly info.<br>
> +  ILLines = 0xf9,<br>
> +  FuncMDTokenMap = 0xfa,<br>
> +  TypeMDTokenMap = 0xfb,<br>
> +  MergedAssemblyInput = 0xfc,<br>
> +<br>
> +  CoffSymbolRVA = 0xfd,<br>
>  };<br>
><br>
> +/// Equivalent to CV_ptrtype_e.<br>
>  enum class PointerKind : uint8_t {<br>
>    Near16 = 0x00,                // 16 bit pointer<br>
>    Far16 = 0x01,                 // 16:16 far pointer<br>
> @@ -226,6 +334,7 @@ enum class PointerKind : uint8_t {<br>
>    Near64 = 0x0c                 // 64 bit pointer<br>
>  };<br>
><br>
> +/// Equivalent to CV_ptrmode_e.<br>
>  enum class PointerMode : uint8_t {<br>
>    Pointer = 0x00,                 // "normal" pointer<br>
>    LValueReference = 0x01,         // "old" reference<br>
> @@ -234,6 +343,7 @@ enum class PointerMode : uint8_t {<br>
>    RValueReference = 0x04          // r-value reference<br>
>  };<br>
><br>
> +/// Equivalent to misc lfPointerAttr bitfields.<br>
>  enum class PointerOptions : uint32_t {<br>
>    None = 0x00000000,<br>
>    Flat32 = 0x00000100,<br>
> @@ -258,6 +368,7 @@ inline PointerOptions operator~(PointerO<br>
>    return static_cast<PointerOptions>(~static_cast<uint16_t>(a));<br>
>  }<br>
><br>
> +/// Equivalent to CV_pmtype_e.<br>
>  enum class PointerToMemberRepresentation : uint16_t {<br>
>    Unknown = 0x00,                     // not specified (pre VC8)<br>
>    SingleInheritanceData = 0x01,       // member data, single inheritance<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeIndex.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeIndex.h?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeIndex.h?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeIndex.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeIndex.h Wed Jan 13 13:32:35 2016<br>
> @@ -74,6 +74,9 @@ enum class SimpleTypeMode : uint32_t {<br>
>    NearPointer128 = 0x00000700 // 128 bit near pointer<br>
>  };<br>
><br>
> +/// A 32-bit type reference. Types are indexed by their order of appearance in<br>
> +/// .debug$T plus 0x1000. Type indices less than 0x1000 are "simple" types,<br>
> +/// composed of a SimpleTypeMode byte followed by a SimpleTypeKind byte.<br>
>  class TypeIndex {<br>
>  public:<br>
>    static const uint32_t FirstNonSimpleIndex = 0x1000;<br>
> @@ -91,6 +94,8 @@ public:<br>
>    uint32_t getIndex() const { return Index; }<br>
>    bool isSimple() const { return Index < FirstNonSimpleIndex; }<br>
><br>
> +  bool isNoType() const { return Index == 0; }<br>
> +<br>
>    SimpleTypeKind getSimpleKind() const {<br>
>      assert(isSimple());<br>
>      return static_cast<SimpleTypeKind>(Index & SimpleKindMask);<br>
> @@ -144,7 +149,7 @@ public:<br>
>    static TypeIndex Float64() { return TypeIndex(SimpleTypeKind::Float64); }<br>
><br>
>  private:<br>
> -  uint32_t Index;<br>
> +  ulittle32_t Index;<br>
>  };<br>
><br>
>  inline bool operator==(const TypeIndex &A, const TypeIndex &B) {<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/PDB/PDBTypes.h Wed Jan 13 13:32:35 2016<br>
> @@ -11,6 +11,7 @@<br>
>  #define LLVM_DEBUGINFO_PDB_PDBTYPES_H<br>
><br>
>  #include "llvm/Config/llvm-config.h"<br>
> +#include "llvm/DebugInfo/CodeView/CodeView.h"<br>
>  #include "llvm/Support/Endian.h"<br>
>  #include <functional><br>
>  #include <stdint.h><br>
> @@ -108,67 +109,7 @@ enum class PDB_Checksum { None = 0, MD5<br>
><br>
>  /// These values correspond to the CV_CPU_TYPE_e enumeration, and are documented<br>
>  /// here: <a href="https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx" target="_blank">
https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx</a><br>
> -enum class PDB_Cpu {<br>
> -  Intel8080 = 0x0,<br>
> -  Intel8086 = 0x1,<br>
> -  Intel80286 = 0x2,<br>
> -  Intel80386 = 0x3,<br>
> -  Intel80486 = 0x4,<br>
> -  Pentium = 0x5,<br>
> -  PentiumPro = 0x6,<br>
> -  Pentium3 = 0x7,<br>
> -  MIPS = 0x10,<br>
> -  MIPS16 = 0x11,<br>
> -  MIPS32 = 0x12,<br>
> -  MIPS64 = 0x13,<br>
> -  MIPSI = 0x14,<br>
> -  MIPSII = 0x15,<br>
> -  MIPSIII = 0x16,<br>
> -  MIPSIV = 0x17,<br>
> -  MIPSV = 0x18,<br>
> -  M68000 = 0x20,<br>
> -  M68010 = 0x21,<br>
> -  M68020 = 0x22,<br>
> -  M68030 = 0x23,<br>
> -  M68040 = 0x24,<br>
> -  Alpha = 0x30,<br>
> -  Alpha21164 = 0x31,<br>
> -  Alpha21164A = 0x32,<br>
> -  Alpha21264 = 0x33,<br>
> -  Alpha21364 = 0x34,<br>
> -  PPC601 = 0x40,<br>
> -  PPC603 = 0x41,<br>
> -  PPC604 = 0x42,<br>
> -  PPC620 = 0x43,<br>
> -  PPCFP = 0x44,<br>
> -  PPCBE = 0x45,<br>
> -  SH3 = 0x50,<br>
> -  SH3E = 0x51,<br>
> -  SH3DSP = 0x52,<br>
> -  SH4 = 0x53,<br>
> -  SHMedia = 0x54,<br>
> -  ARM3 = 0x60,<br>
> -  ARM4 = 0x61,<br>
> -  ARM4T = 0x62,<br>
> -  ARM5 = 0x63,<br>
> -  ARM5T = 0x64,<br>
> -  ARM6 = 0x65,<br>
> -  ARM_XMAC = 0x66,<br>
> -  ARM_WMMX = 0x67,<br>
> -  ARM7 = 0x68,<br>
> -  Omni = 0x70,<br>
> -  Ia64 = 0x80,<br>
> -  Ia64_2 = 0x81,<br>
> -  CEE = 0x90,<br>
> -  AM33 = 0xa0,<br>
> -  M32R = 0xb0,<br>
> -  TriCore = 0xc0,<br>
> -  X64 = 0xd0,<br>
> -  EBC = 0xe0,<br>
> -  Thumb = 0xf0,<br>
> -  ARMNT = 0xf4,<br>
> -  D3D11_Shader = 0x100,<br>
> -};<br>
> +typedef codeview::CPUType PDB_Cpu;<br>
><br>
>  enum class PDB_Machine {<br>
>    Invalid = 0xffff,<br>
> @@ -200,56 +141,11 @@ enum class PDB_Machine {<br>
>  ///   <a href="https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx" target="_blank">https://msdn.microsoft.com/en-us/library/b2fc64ek.aspx</a><br>
>  ///   <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx" target="_blank">https://msdn.microsoft.com/en-us/library/windows/desktop/ms680207(v=vs.85).aspx</a><br>
>  ///<br>
> -enum class PDB_CallingConv {<br>
> -  NearCdecl = 0x00,<br>
> -  FarCdecl = 0x01,<br>
> -  NearPascal = 0x02,<br>
> -  FarPascal = 0x03,<br>
> -  NearFastcall = 0x04,<br>
> -  FarFastcall = 0x05,<br>
> -  Skipped = 0x06,<br>
> -  NearStdcall = 0x07,<br>
> -  FarStdcall = 0x08,<br>
> -  NearSyscall = 0x09,<br>
> -  FarSyscall = 0x0a,<br>
> -  Thiscall = 0x0b,<br>
> -  MipsCall = 0x0c,<br>
> -  Generic = 0x0d,<br>
> -  Alphacall = 0x0e,<br>
> -  Ppccall = 0x0f,<br>
> -  SuperHCall = 0x10,<br>
> -  Armcall = 0x11,<br>
> -  AM33call = 0x12,<br>
> -  Tricall = 0x13,<br>
> -  Sh5call = 0x14,<br>
> -  M32R = 0x15,<br>
> -  Clrcall = 0x16,<br>
> -  Inline = 0x17,<br>
> -  NearVectorcall = 0x18,<br>
> -  Reserved = 0x19,<br>
> -};<br>
> +typedef codeview::CallingConvention PDB_CallingConv;<br>
><br>
>  /// These values correspond to the CV_CFL_LANG enumeration, and are documented<br>
>  /// here: <a href="https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx" target="_blank">
https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx</a><br>
> -enum class PDB_Lang {<br>
> -  C = 0x00,<br>
> -  Cpp = 0x01,<br>
> -  Fortran = 0x02,<br>
> -  Masm = 0x03,<br>
> -  Pascal = 0x04,<br>
> -  Basic = 0x05,<br>
> -  Cobol = 0x06,<br>
> -  Link = 0x07,<br>
> -  Cvtres = 0x08,<br>
> -  Cvtpgd = 0x09,<br>
> -  CSharp = 0x0a,<br>
> -  VB = 0x0b,<br>
> -  ILAsm = 0x0c,<br>
> -  Java = 0x0d,<br>
> -  JScript = 0x0e,<br>
> -  MSIL = 0x0f,<br>
> -  HLSL = 0x10<br>
> -};<br>
> +typedef codeview::SourceLanguage PDB_Lang;<br>
><br>
>  /// These values correspond to the DataKind enumeration, and are documented<br>
>  /// here: <a href="https://msdn.microsoft.com/en-us/library/b2x2t313.aspx" target="_blank">
https://msdn.microsoft.com/en-us/library/b2x2t313.aspx</a><br>
><br>
> Modified: llvm/trunk/include/llvm/Support/COFF.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/COFF.h?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/COFF.h?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/COFF.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/COFF.h Wed Jan 13 13:32:35 2016<br>
> @@ -674,6 +674,7 @@ namespace COFF {<br>
>      DEBUG_INDEX_SUBSECTION = 0xF4,<br>
><br>
>      // Symbol subsections are split into records of different types.<br>
> +    DEBUG_SYMBOL_TYPE_LOCAL_PROC_START = 0x1146,<br>
>      DEBUG_SYMBOL_TYPE_PROC_START = 0x1147,<br>
>      DEBUG_SYMBOL_TYPE_PROC_END = 0x114F<br>
>    };<br>
><br>
> Modified: llvm/trunk/include/llvm/Support/Endian.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Endian.h?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Endian.h?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/Endian.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/Endian.h Wed Jan 13 13:32:35 2016<br>
> @@ -173,6 +173,10 @@ template<typename value_type,<br>
>           endianness endian,<br>
>           std::size_t alignment><br>
>  struct packed_endian_specific_integral {<br>
> +  packed_endian_specific_integral() = default;<br>
> +<br>
> +  explicit packed_endian_specific_integral(value_type val) { *this = val; }<br>
> +<br>
>    operator value_type() const {<br>
>      return endian::read<value_type, endian, alignment>(<br>
>        (const void*)Value.buffer);<br>
><br>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp (original)<br>
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/WinCodeViewLineTables.cpp Wed Jan 13 13:32:35 2016<br>
> @@ -199,7 +199,6 @@ void WinCodeViewLineTables::emitDebugInf<br>
>      return;<br>
>    assert(FI.End && "Don't know where the function ends?");<br>
><br>
> -  StringRef GVName = GV->getName();<br>
>    StringRef FuncName;<br>
>    if (auto *SP = getDISubprogram(GV))<br>
>      FuncName = SP->getDisplayName();<br>
> @@ -208,8 +207,8 @@ void WinCodeViewLineTables::emitDebugInf<br>
>    // "namespace_foo::bar" function, see PR21528.  Luckily, dbghelp.dll is trying<br>
>    // to demangle display names anyways, so let's just put a mangled name into<br>
>    // the symbols subsection until Clang gives us what we need.<br>
> -  if (GVName.startswith("\01?"))<br>
> -    FuncName = GVName.substr(1);<br>
> +  if (FuncName.empty())<br>
> +    FuncName = GlobalValue::getRealLinkageName(GV->getName());<br>
>    // Emit a symbol subsection, required by VS2012+ to find function boundaries.<br>
>    MCSymbol *SymbolsBegin = Asm->MMI->getContext().createTempSymbol(),<br>
>             *SymbolsEnd = Asm->MMI->getContext().createTempSymbol();<br>
><br>
> Modified: llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp (original)<br>
> +++ llvm/trunk/lib/DebugInfo/PDB/PDBExtras.cpp Wed Jan 13 13:32:35 2016<br>
> @@ -43,32 +43,30 @@ raw_ostream &llvm::operator<<(raw_ostrea<br>
>  raw_ostream &llvm::operator<<(raw_ostream &OS, const PDB_CallingConv &Conv) {<br>
>    OS << "__";<br>
>    switch (Conv) {<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearCdecl, "cdecl", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarCdecl, "cdecl", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearPascal, "pascal", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarPascal, "pascal", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearFastcall, "fastcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarFastcall, "fastcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Skipped, "skippedcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearStdcall, "stdcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarStdcall, "stdcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearSyscall, "syscall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarSyscall, "syscall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Thiscall, "thiscall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, MipsCall, "mipscall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Generic, "genericcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Alphacall, "alphacall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Ppccall, "ppccall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, SuperHCall, "superhcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Armcall, "armcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, AM33call, "am33call", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Tricall, "tricall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Sh5call, "sh5call", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, M32R, "m32rcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Clrcall, "clrcall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Inline, "inlinecall", OS)<br>
> -    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearVectorcall, "vectorcall",<br>
> -                               OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearC      , "cdecl", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarC       , "cdecl", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearPascal , "pascal", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarPascal  , "pascal", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearFast   , "fastcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarFast    , "fastcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearStdCall, "stdcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarStdCall , "stdcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearSysCall, "syscall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, FarSysCall , "syscall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, ThisCall   , "thiscall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, MipsCall   , "mipscall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Generic    , "genericcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, AlphaCall  , "alphacall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, PpcCall    , "ppccall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, SHCall     , "superhcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, ArmCall    , "armcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, AM33Call   , "am33call", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, TriCall    , "tricall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, SH5Call    , "sh5call", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, M32RCall   , "m32rcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, ClrCall    , "clrcall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, Inline     , "inlinecall", OS)<br>
> +    CASE_OUTPUT_ENUM_CLASS_STR(PDB_CallingConv, NearVector , "vectorcall", OS)<br>
>    default:<br>
>      OS << "unknowncall";<br>
>    }<br>
><br>
> Modified: llvm/trunk/test/DebugInfo/COFF/asm.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/asm.ll?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/asm.ll?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/DebugInfo/COFF/asm.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/COFF/asm.ll Wed Jan 13 13:32:35 2016<br>
> @@ -96,14 +96,14 @@<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:    CodeViewDebugInfo [<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF1<br>
> +; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ32-NOT:    ]<br>
>  ; OBJ32:        ProcStart {<br>
> -; OBJ32-NEXT:     DisplayName: f<br>
> -; OBJ32-NEXT:     Section: _f<br>
> -; OBJ32-NEXT:     CodeSize: 0x6<br>
> -; OBJ32-NEXT:   }<br>
> -; OBJ32-NEXT:   ProcEnd<br>
> +; OBJ32:          CodeSize: 0x6<br>
> +; OBJ32:          DisplayName: f<br>
> +; OBJ32:          LinkageName: _f<br>
> +; OBJ32:        }<br>
> +; OBJ32:        ProcEnd<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      FunctionLineTable [<br>
>  ; OBJ32-NEXT:   Name: _f<br>
> @@ -228,13 +228,13 @@<br>
>  ; OBJ64-NEXT:   0x48 IMAGE_REL_AMD64_SECTION f<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF1<br>
> +; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ64-NOT:    ]<br>
>  ; OBJ64:        ProcStart {<br>
> -; OBJ64-NEXT:     DisplayName: f<br>
> -; OBJ64-NEXT:     Section: f<br>
> -; OBJ64-NEXT:     CodeSize: 0xE<br>
> -; OBJ64-NEXT:   }<br>
> +; OBJ64:          CodeSize: 0xE<br>
> +; OBJ64:          DisplayName: f<br>
> +; OBJ64:          LinkageName: f<br>
> +; OBJ64:        }<br>
>  ; OBJ64-NEXT:   ProcEnd<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      FunctionLineTable [<br>
><br>
> Modified: llvm/trunk/test/DebugInfo/COFF/cpp-mangling.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/cpp-mangling.ll?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/cpp-mangling.ll?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/DebugInfo/COFF/cpp-mangling.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/COFF/cpp-mangling.ll Wed Jan 13 13:32:35 2016<br>
> @@ -10,8 +10,8 @@<br>
><br>
>  ; CHECK:        ProcStart {<br>
>  ; FIXME: The display name should in fact be "foo::bar", see PR21528<br>
> -; CHECK-NEXT:     DisplayName: ?bar@foo@@YAHH@Z<br>
> -; CHECK-NEXT:     Section: ?bar@foo@@YAHH@Z<br>
> +; CHECK:     DisplayName: ?bar@foo@@YAHH@Z<br>
> +; CHECK-NEXT:     LinkageName: ?bar@foo@@YAHH@Z<br>
><br>
>  ; Function Attrs: nounwind<br>
>  define i32 @"\01?bar@foo@@YAHH@Z"(i32 %x) #0 {<br>
><br>
> Modified: llvm/trunk/test/DebugInfo/COFF/multifile.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/multifile.ll?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/multifile.ll?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/DebugInfo/COFF/multifile.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/COFF/multifile.ll Wed Jan 13 13:32:35 2016<br>
> @@ -122,13 +122,13 @@<br>
>  ; OBJ32-NEXT:   0x48 IMAGE_REL_I386_SECTION _f<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF1<br>
> +; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ32-NOT:    ]<br>
>  ; OBJ32:        ProcStart {<br>
> -; OBJ32-NEXT:     DisplayName: f<br>
> -; OBJ32-NEXT:     Section: _f<br>
> -; OBJ32-NEXT:     CodeSize: 0x10<br>
> -; OBJ32-NEXT:   }<br>
> +; OBJ32:          CodeSize: 0x10<br>
> +; OBJ32:          DisplayName: f<br>
> +; OBJ32:          LinkageName: _f<br>
> +; OBJ32:        }<br>
>  ; OBJ32-NEXT:   ProcEnd<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      FunctionLineTable [<br>
> @@ -298,14 +298,14 @@<br>
>  ; OBJ64-NEXT:   0x48 IMAGE_REL_AMD64_SECTION f<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF1<br>
> +; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ64-NOT:    ]<br>
>  ; OBJ64:        ProcStart {<br>
> -; OBJ64-NEXT:     DisplayName: f<br>
> -; OBJ64-NEXT:     Section: f<br>
> -; OBJ64-NEXT:     CodeSize: 0x18<br>
> -; OBJ64-NEXT:   }<br>
> -; OBJ64-NEXT:   ProcEnd<br>
> +; OBJ64:          CodeSize: 0x18<br>
> +; OBJ64:          DisplayName: f<br>
> +; OBJ64:          LinkageName: f<br>
> +; OBJ64:        }<br>
> +; OBJ64:        ProcEnd<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      FunctionLineTable [<br>
>  ; OBJ64-NEXT:   Name: f<br>
><br>
> Modified: llvm/trunk/test/DebugInfo/COFF/multifunction.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/multifunction.ll?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/multifunction.ll?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/DebugInfo/COFF/multifunction.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/COFF/multifunction.ll Wed Jan 13 13:32:35 2016<br>
> @@ -221,43 +221,43 @@<br>
>  ; OBJ32-NEXT:   0x128 IMAGE_REL_I386_SECTION _f<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF1<br>
> +; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ32-NOT:    ]<br>
>  ; OBJ32:        ProcStart {<br>
> -; OBJ32-NEXT:     DisplayName: x<br>
> -; OBJ32-NEXT:     Section: _x<br>
> -; OBJ32-NEXT:     CodeSize: 0x6<br>
> -; OBJ32-NEXT:   }<br>
> -; OBJ32-NEXT:   ProcEnd<br>
> +; OBJ32:          CodeSize: 0x6<br>
> +; OBJ32:          DisplayName: x<br>
> +; OBJ32:          LinkageName: _x<br>
> +; OBJ32:        }<br>
> +; OBJ32:        ProcEnd<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF2<br>
> +; OBJ32-NEXT:   SubSectionType: Lines (0xF2)<br>
>  ; OBJ32:      ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF1<br>
> +; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ32-NOT:    ]<br>
>  ; OBJ32:        ProcStart {<br>
> -; OBJ32-NEXT:     DisplayName: y<br>
> -; OBJ32-NEXT:     Section: _y<br>
> -; OBJ32-NEXT:     CodeSize: 0x6<br>
> -; OBJ32-NEXT:   }<br>
> -; OBJ32-NEXT:   ProcEnd<br>
> +; OBJ32:          CodeSize: 0x6<br>
> +; OBJ32:          DisplayName: y<br>
> +; OBJ32:          LinkageName: _y<br>
> +; OBJ32:        }<br>
> +; OBJ32:        ProcEnd<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF2<br>
> +; OBJ32-NEXT:   SubSectionType: Lines (0xF2)<br>
>  ; OBJ32:      ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF1<br>
> +; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ32-NOT:    ]<br>
>  ; OBJ32:        ProcStart {<br>
> -; OBJ32-NEXT:     DisplayName: f<br>
> -; OBJ32-NEXT:     Section: _f<br>
> -; OBJ32-NEXT:     CodeSize: 0x10<br>
> -; OBJ32-NEXT:   }<br>
> -; OBJ32-NEXT:   ProcEnd<br>
> +; OBJ32:          CodeSize: 0x10<br>
> +; OBJ32:          DisplayName: f<br>
> +; OBJ32:          LinkageName: _f<br>
> +; OBJ32:        }<br>
> +; OBJ32:        ProcEnd<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF2<br>
> +; OBJ32-NEXT:   SubSectionType: Lines (0xF2)<br>
>  ; OBJ32:      ]<br>
>  ; OBJ32:      FunctionLineTable [<br>
>  ; OBJ32-NEXT:   Name: _x<br>
> @@ -564,43 +564,43 @@<br>
>  ; OBJ64-NEXT:   0x140 IMAGE_REL_AMD64_SECTION f<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF1<br>
> +; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ64-NOT:    ]<br>
>  ; OBJ64:        ProcStart {<br>
> -; OBJ64-NEXT:     DisplayName: x<br>
> -; OBJ64-NEXT:     Section: x<br>
> -; OBJ64-NEXT:     CodeSize: 0xE<br>
> -; OBJ64-NEXT:   }<br>
> -; OBJ64-NEXT:   ProcEnd<br>
> +; OBJ64:          CodeSize: 0xE<br>
> +; OBJ64:          DisplayName: x<br>
> +; OBJ64:          LinkageName: x<br>
> +; OBJ64:        }<br>
> +; OBJ64:        ProcEnd<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF2<br>
> +; OBJ64-NEXT:   SubSectionType: Lines (0xF2)<br>
>  ; OBJ64:      ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF1<br>
> +; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ64-NOT:    ]<br>
>  ; OBJ64:        ProcStart {<br>
> -; OBJ64-NEXT:     DisplayName: y<br>
> -; OBJ64-NEXT:     Section: y<br>
> -; OBJ64-NEXT:     CodeSize: 0xE<br>
> -; OBJ64-NEXT:   }<br>
> -; OBJ64-NEXT:   ProcEnd<br>
> +; OBJ64:          CodeSize: 0xE<br>
> +; OBJ64:          DisplayName: y<br>
> +; OBJ64:          LinkageName: y<br>
> +; OBJ64:        }<br>
> +; OBJ64:        ProcEnd<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF2<br>
> +; OBJ64-NEXT:   SubSectionType: Lines (0xF2)<br>
>  ; OBJ64:      ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF1<br>
> +; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ64-NOT:    ]<br>
>  ; OBJ64:        ProcStart {<br>
> -; OBJ64-NEXT:     DisplayName: f<br>
> -; OBJ64-NEXT:     Section: f<br>
> -; OBJ64-NEXT:     CodeSize: 0x18<br>
> -; OBJ64-NEXT:   }<br>
> -; OBJ64-NEXT:   ProcEnd<br>
> +; OBJ64:          CodeSize: 0x18<br>
> +; OBJ64:          DisplayName: f<br>
> +; OBJ64:          LinkageName: f<br>
> +; OBJ64:        }<br>
> +; OBJ64:        ProcEnd<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF2<br>
> +; OBJ64-NEXT:   SubSectionType: Lines (0xF2)<br>
>  ; OBJ64:      ]<br>
>  ; OBJ64:      FunctionLineTable [<br>
>  ; OBJ64-NEXT:   LinkageName: x<br>
><br>
> Modified: llvm/trunk/test/DebugInfo/COFF/simple.ll<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/simple.ll?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/simple.ll?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/DebugInfo/COFF/simple.ll (original)<br>
> +++ llvm/trunk/test/DebugInfo/COFF/simple.ll Wed Jan 13 13:32:35 2016<br>
> @@ -89,13 +89,13 @@<br>
>  ; OBJ32-NEXT:   0x48 IMAGE_REL_I386_SECTION _f<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      Subsection [<br>
> -; OBJ32-NEXT:   Type: 0xF1<br>
> +; OBJ32-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ32-NOT:    ]<br>
>  ; OBJ32:        ProcStart {<br>
> -; OBJ32-NEXT:     DisplayName: f<br>
> -; OBJ32-NEXT:     Section: _f<br>
> -; OBJ32-NEXT:     CodeSize: 0x6<br>
> -; OBJ32-NEXT:   }<br>
> +; OBJ32:          CodeSize: 0x6<br>
> +; OBJ32:          DisplayName: f<br>
> +; OBJ32:          LinkageName: _f<br>
> +; OBJ32:        }<br>
>  ; OBJ32-NEXT:   ProcEnd<br>
>  ; OBJ32-NEXT: ]<br>
>  ; OBJ32:      FunctionLineTable [<br>
> @@ -207,13 +207,13 @@<br>
>  ; OBJ64-NEXT:   0x48 IMAGE_REL_AMD64_SECTION f<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      Subsection [<br>
> -; OBJ64-NEXT:   Type: 0xF1<br>
> +; OBJ64-NEXT:   SubSectionType: Symbols (0xF1)<br>
>  ; OBJ64-NOT:    ]<br>
>  ; OBJ64:        ProcStart {<br>
> -; OBJ64-NEXT:     DisplayName: f<br>
> -; OBJ64-NEXT:     Section: f<br>
> -; OBJ64-NEXT:     CodeSize: 0xE<br>
> -; OBJ64-NEXT:   }<br>
> +; OBJ64:          CodeSize: 0xE<br>
> +; OBJ64:          DisplayName: f<br>
> +; OBJ64:          LinkageName: f<br>
> +; OBJ64:        }<br>
>  ; OBJ64-NEXT:   ProcEnd<br>
>  ; OBJ64-NEXT: ]<br>
>  ; OBJ64:      FunctionLineTable [<br>
><br>
> Modified: llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test (original)<br>
> +++ llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test Wed Jan 13 13:32:35 2016<br>
> @@ -28,79 +28,80 @@ RUN: llvm-readobj -s -codeview -section-<br>
>  RUN:   | FileCheck %s -check-prefix MFUN64<br>
><br>
>  MFUN32:      CodeViewDebugInfo [<br>
> +MFUN32-NEXT:   Section: .debug$S (2)<br>
>  MFUN32-NEXT:   Magic: 0x4<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF1<br>
> -MFUN32-NEXT:     PayloadSize: 0x52<br>
> +MFUN32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x52<br>
>  MFUN32:        ]<br>
> -MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF5<br>
> -MFUN32-NEXT:     PayloadSize: 0x24<br>
> +MFUN32:       Subsection [<br>
> +MFUN32-NEXT:     SubSectionType: FrameData (0xF5)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x24<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF1<br>
> -MFUN32-NEXT:     PayloadSize: 0x4B<br>
> +MFUN32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x4B<br>
>  MFUN32:          ProcStart {<br>
> -MFUN32-NEXT:       DisplayName: x<br>
> -MFUN32-NEXT:       Section: _x<br>
> -MFUN32-NEXT:       CodeSize: 0xA<br>
> -MFUN32-NEXT:     }<br>
> -MFUN32-NEXT:     ProcEnd<br>
> +MFUN32:            CodeSize: 0xA<br>
> +MFUN32:            DisplayName: x<br>
> +MFUN32:            LinkageName: _x<br>
> +MFUN32:          }<br>
> +MFUN32:          ProcEnd<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF2<br>
> -MFUN32-NEXT:     PayloadSize: 0x30<br>
> +MFUN32-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x30<br>
>  MFUN32:          LinkageName: _x<br>
>  MFUN32-NEXT:   ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF5<br>
> -MFUN32-NEXT:     PayloadSize: 0x24<br>
> +MFUN32-NEXT:     SubSectionType: FrameData (0xF5)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x24<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF1<br>
> -MFUN32-NEXT:     PayloadSize: 0x4B<br>
> +MFUN32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x4B<br>
>  MFUN32:          ProcStart {<br>
> -MFUN32-NEXT:       DisplayName: y<br>
> -MFUN32-NEXT:       Section: _y<br>
> -MFUN32-NEXT:       CodeSize: 0xA<br>
> -MFUN32-NEXT:     }<br>
> -MFUN32-NEXT:     ProcEnd<br>
> +MFUN32:            CodeSize: 0xA<br>
> +MFUN32:            DisplayName: y<br>
> +MFUN32:            LinkageName: _y<br>
> +MFUN32:          }<br>
> +MFUN32:          ProcEnd<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF2<br>
> -MFUN32-NEXT:     PayloadSize: 0x30<br>
> +MFUN32-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x30<br>
>  MFUN32:          LinkageName: _y<br>
>  MFUN32-NEXT:   ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF5<br>
> -MFUN32-NEXT:     PayloadSize: 0x24<br>
> +MFUN32-NEXT:     SubSectionType: FrameData (0xF5)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x24<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF1<br>
> -MFUN32-NEXT:     PayloadSize: 0x4B<br>
> +MFUN32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x4B<br>
>  MFUN32:          ProcStart {<br>
> -MFUN32-NEXT:       DisplayName: f<br>
> -MFUN32-NEXT:       Section: _f<br>
> -MFUN32-NEXT:       CodeSize: 0x14<br>
> -MFUN32-NEXT:     }<br>
> -MFUN32-NEXT:     ProcEnd<br>
> +MFUN32:            CodeSize: 0x14<br>
> +MFUN32:            DisplayName: f<br>
> +MFUN32:            LinkageName: _f<br>
> +MFUN32:          }<br>
> +MFUN32:          ProcEnd<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF2<br>
> -MFUN32-NEXT:     PayloadSize: 0x40<br>
> +MFUN32-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x40<br>
>  MFUN32:          LinkageName: _f<br>
>  MFUN32-NEXT:   ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF4<br>
> -MFUN32-NEXT:     PayloadSize: 0x18<br>
> +MFUN32-NEXT:     SubSectionType: FileChecksums (0xF4)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x18<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF3<br>
> -MFUN32-NEXT:     PayloadSize: 0x46<br>
> +MFUN32-NEXT:     SubSectionType: StringTable (0xF3)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x46<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   Subsection [<br>
> -MFUN32-NEXT:     Type: 0xF1<br>
> -MFUN32-NEXT:     PayloadSize: 0x8<br>
> +MFUN32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN32-NEXT:     SubSectionSize: 0x8<br>
>  MFUN32:        ]<br>
>  MFUN32-NEXT:   FunctionLineTable [<br>
>  MFUN32-NEXT      LinkageName: _x<br>
> @@ -181,70 +182,70 @@ MFUN32-NEXT          IsStatement: Yes<br>
>  MFUN32-NEXT        ]<br>
>  MFUN32-NEXT      ]<br>
>  MFUN32-NEXT    ]<br>
> -MFUN32-NEXT  ]<br>
> +MFUN32:      ]<br>
><br>
>  MFUN64:      CodeViewDebugInfo [<br>
> -MFUN64-NEXT:   Magic: 0x4<br>
> +MFUN64:        Magic: 0x4<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF1<br>
> -MFUN64-NEXT:     PayloadSize: 0x52<br>
> +MFUN64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x52<br>
>  MFUN64:        ]<br>
> -MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF1<br>
> -MFUN64-NEXT:     PayloadSize: 0x4B<br>
> +MFUN64:        Subsection [<br>
> +MFUN64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x4B<br>
>  MFUN64:          ProcStart {<br>
> -MFUN64-NEXT:       DisplayName: x<br>
> -MFUN64-NEXT:       Section: x<br>
> -MFUN64-NEXT:       CodeSize: 0xE<br>
> -MFUN64-NEXT:     }<br>
> -MFUN64-NEXT:     ProcEnd<br>
> +MFUN64:            CodeSize: 0xE<br>
> +MFUN64:            DisplayName: x<br>
> +MFUN64:            LinkageName: x<br>
> +MFUN64:          }<br>
> +MFUN64:          ProcEnd<br>
>  MFUN64:        ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF2<br>
> -MFUN64-NEXT:     PayloadSize: 0x30<br>
> +MFUN64-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x30<br>
>  MFUN64:          LinkageName: x<br>
>  MFUN64-NEXT:   ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF1<br>
> -MFUN64-NEXT:     PayloadSize: 0x4B<br>
> +MFUN64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x4B<br>
>  MFUN64:          ProcStart {<br>
> -MFUN64-NEXT:       DisplayName: y<br>
> -MFUN64-NEXT:       Section: y<br>
> -MFUN64-NEXT:       CodeSize: 0xE<br>
> -MFUN64-NEXT:     }<br>
> -MFUN64-NEXT:     ProcEnd<br>
> +MFUN64:            CodeSize: 0xE<br>
> +MFUN64:            DisplayName: y<br>
> +MFUN64:            LinkageName: y<br>
> +MFUN64:          }<br>
> +MFUN64:          ProcEnd<br>
>  MFUN64:        ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF2<br>
> -MFUN64-NEXT:     PayloadSize: 0x30<br>
> +MFUN64-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x30<br>
>  MFUN64:          LinkageName: y<br>
>  MFUN64-NEXT:   ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF1<br>
> -MFUN64-NEXT:     PayloadSize: 0x4B<br>
> +MFUN64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x4B<br>
>  MFUN64:          ProcStart {<br>
> -MFUN64-NEXT:       DisplayName: f<br>
> -MFUN64-NEXT:       Section: f<br>
> -MFUN64-NEXT:       CodeSize: 0x18<br>
> -MFUN64-NEXT:     }<br>
> -MFUN64-NEXT:     ProcEnd<br>
> +MFUN64:            CodeSize: 0x18<br>
> +MFUN64:            DisplayName: f<br>
> +MFUN64:            LinkageName: f<br>
> +MFUN64:          }<br>
> +MFUN64:          ProcEnd<br>
>  MFUN64:        ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF2<br>
> -MFUN64-NEXT:     PayloadSize: 0x40<br>
> +MFUN64-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x40<br>
>  MFUN64:          LinkageName: f<br>
>  MFUN64-NEXT:   ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF4<br>
> -MFUN64-NEXT:     PayloadSize: 0x18<br>
> +MFUN64-NEXT:     SubSectionType: FileChecksums (0xF4)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x18<br>
>  MFUN64:        ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF3<br>
> -MFUN64-NEXT:     PayloadSize: 0xD<br>
> +MFUN64-NEXT:     SubSectionType: StringTable (0xF3)<br>
> +MFUN64-NEXT:     SubSectionSize: 0xD<br>
>  MFUN64:        ]<br>
>  MFUN64-NEXT:   Subsection [<br>
> -MFUN64-NEXT:     Type: 0xF1<br>
> -MFUN64-NEXT:     PayloadSize: 0x8<br>
> +MFUN64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFUN64-NEXT:     SubSectionSize: 0x8<br>
>  MFUN64:        ]<br>
>  MFUN64-NEXT:   FunctionLineTable [<br>
>  MFUN64-NEXT:     LinkageName: x<br>
> @@ -325,7 +326,7 @@ MFUN64-NEXT:         IsStatement: Yes<br>
>  MFUN64-NEXT:       ]<br>
>  MFUN64-NEXT:     ]<br>
>  MFUN64-NEXT:   ]<br>
> -MFUN64-NEXT: ]<br>
> +MFUN64:      ]<br>
><br>
>  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
>  ; The following two object files were generated using the following command:<br>
> @@ -352,41 +353,41 @@ RUN: llvm-readobj -s -codeview -section-<br>
>  RUN:   | FileCheck %s -check-prefix MFILE64<br>
><br>
>  MFILE32:      CodeViewDebugInfo [<br>
> -MFILE32-NEXT:   Magic: 0x4<br>
> +MFILE32:        Magic: 0x4<br>
>  MFILE32-NEXT:   Subsection [<br>
> -MFILE32-NEXT:     Type: 0xF1<br>
> -MFILE32-NEXT:     PayloadSize: 0x51<br>
> +MFILE32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFILE32-NEXT:     SubSectionSize: 0x51<br>
>  MFILE32:        ]<br>
> -MFILE32-NEXT:   Subsection [<br>
> -MFILE32-NEXT:     Type: 0xF5<br>
> -MFILE32-NEXT:     PayloadSize: 0x24<br>
> +MFILE32:        Subsection [<br>
> +MFILE32-NEXT:     SubSectionType: FrameData (0xF5)<br>
> +MFILE32-NEXT:     SubSectionSize: 0x24<br>
>  MFILE32:        ]<br>
>  MFILE32-NEXT:   Subsection [<br>
> -MFILE32-NEXT:     Type: 0xF1<br>
> -MFILE32-NEXT:     PayloadSize: 0x4B<br>
> +MFILE32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFILE32-NEXT:     SubSectionSize: 0x4B<br>
>  MFILE32:          ProcStart {<br>
> -MFILE32-NEXT:       DisplayName: f<br>
> -MFILE32-NEXT:       Section: _f<br>
> -MFILE32-NEXT:       CodeSize: 0x14<br>
> -MFILE32-NEXT:     }<br>
> -MFILE32-NEXT:     ProcEnd<br>
> +MFILE32:            CodeSize: 0x14<br>
> +MFILE32:            DisplayName: f<br>
> +MFILE32:            LinkageName: _f<br>
> +MFILE32:          }<br>
> +MFILE32:          ProcEnd<br>
>  MFILE32:        ]<br>
>  MFILE32-NEXT:   Subsection [<br>
> -MFILE32-NEXT:     Type: 0xF2<br>
> -MFILE32-NEXT:     PayloadSize: 0x64<br>
> +MFILE32-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFILE32-NEXT:     SubSectionSize: 0x64<br>
>  MFILE32:          LinkageName: _f<br>
>  MFILE32-NEXT:   ]<br>
>  MFILE32-NEXT:   Subsection [<br>
> -MFILE32-NEXT:     Type: 0xF4<br>
> -MFILE32-NEXT:     PayloadSize: 0x28<br>
> +MFILE32-NEXT:     SubSectionType: FileChecksums (0xF4)<br>
> +MFILE32-NEXT:     SubSectionSize: 0x28<br>
>  MFILE32:        ]<br>
>  MFILE32-NEXT:   Subsection [<br>
> -MFILE32-NEXT:     Type: 0xF3<br>
> -MFILE32-NEXT:     PayloadSize: 0x57<br>
> +MFILE32-NEXT:     SubSectionType: StringTable (0xF3)<br>
> +MFILE32-NEXT:     SubSectionSize: 0x57<br>
>  MFILE32:        ]<br>
>  MFILE32-NEXT:   Subsection [<br>
> -MFILE32-NEXT:     Type: 0xF1<br>
> -MFILE32-NEXT:     PayloadSize: 0x8<br>
> +MFILE32-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFILE32-NEXT:     SubSectionSize: 0x8<br>
>  MFILE32:        ]<br>
>  MFILE32-NEXT:   FunctionLineTable [<br>
>  MFILE32-NEXT:     LinkageName: _f<br>
> @@ -430,40 +431,40 @@ MFILE32-NEXT:         IsStatement: Yes<br>
>  MFILE32-NEXT:       ]<br>
>  MFILE32-NEXT:     ]<br>
>  MFILE32-NEXT:   ]<br>
> -MFILE32-NEXT: ]<br>
> +MFILE32:      ]<br>
><br>
>  MFILE64:      CodeViewDebugInfo [<br>
> -MFILE64-NEXT:   Magic: 0x4<br>
> +MFILE64:        Magic: 0x4<br>
>  MFILE64-NEXT:   Subsection [<br>
> -MFILE64-NEXT:     Type: 0xF1<br>
> -MFILE64-NEXT:     PayloadSize: 0x51<br>
> +MFILE64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFILE64-NEXT:     SubSectionSize: 0x51<br>
>  MFILE64:        ]<br>
> -MFILE64-NEXT:   Subsection [<br>
> -MFILE64-NEXT:     Type: 0xF1<br>
> -MFILE64-NEXT:     PayloadSize: 0x4B<br>
> +MFILE64:        Subsection [<br>
> +MFILE64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFILE64-NEXT:     SubSectionSize: 0x4B<br>
>  MFILE64:          ProcStart {<br>
> -MFILE64-NEXT:       DisplayName: f<br>
> -MFILE64-NEXT:       Section: f<br>
> -MFILE64-NEXT:       CodeSize: 0x18<br>
> -MFILE64-NEXT:     }<br>
> -MFILE64-NEXT:     ProcEnd<br>
> +MFILE64:            CodeSize: 0x18<br>
> +MFILE64:            DisplayName: f<br>
> +MFILE64:            LinkageName: f<br>
> +MFILE64:          }<br>
> +MFILE64:          ProcEnd<br>
>  MFILE64:        ]<br>
>  MFILE64-NEXT:   Subsection [<br>
> -MFILE64-NEXT:     Type: 0xF2<br>
> -MFILE64-NEXT:     PayloadSize: 0x64<br>
> +MFILE64-NEXT:     SubSectionType: Lines (0xF2)<br>
> +MFILE64-NEXT:     SubSectionSize: 0x64<br>
>  MFILE64:          LinkageName: f<br>
>  MFILE64-NEXT:   ]<br>
>  MFILE64-NEXT:   Subsection [<br>
> -MFILE64-NEXT:     Type: 0xF4<br>
> -MFILE64-NEXT:     PayloadSize: 0x28<br>
> +MFILE64-NEXT:     SubSectionType: FileChecksums (0xF4)<br>
> +MFILE64-NEXT:     SubSectionSize: 0x28<br>
>  MFILE64:        ]<br>
>  MFILE64-NEXT:   Subsection [<br>
> -MFILE64-NEXT:     Type: 0xF3<br>
> -MFILE64-NEXT:     PayloadSize: 0x1E<br>
> +MFILE64-NEXT:     SubSectionType: StringTable (0xF3)<br>
> +MFILE64-NEXT:     SubSectionSize: 0x1E<br>
>  MFILE64:        ]<br>
>  MFILE64-NEXT:   Subsection [<br>
> -MFILE64-NEXT:     Type: 0xF1<br>
> -MFILE64-NEXT:     PayloadSize: 0x8<br>
> +MFILE64-NEXT:     SubSectionType: Symbols (0xF1)<br>
> +MFILE64-NEXT:     SubSectionSize: 0x8<br>
>  MFILE64:        ]<br>
>  MFILE64-NEXT:  FunctionLineTable [<br>
>  MFILE64-NEXT:    LinkageName: f<br>
> @@ -506,7 +507,7 @@ MFILE64-NEXT:        LineNumberEndDelta:<br>
>  MFILE64-NEXT:        IsStatement: Yes<br>
>  MFILE64-NEXT:      ]<br>
>  MFILE64-NEXT:    ]<br>
> -MFILE64-NEXT: ]<br>
> +MFILE64:      ]<br>
><br>
>  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
>  ; The following object files were generated using the following command:<br>
> @@ -528,10 +529,10 @@ RUN: llvm-readobj -s -codeview -section-<br>
>  RUN:   | FileCheck %s -check-prefix MCOMDAT<br>
><br>
>  MCOMDAT:      ProcStart {<br>
> -MCOMDAT-NEXT:   DisplayName: f<br>
> -MCOMDAT-NEXT:   Section: ?f@@YAHXZ<br>
> -MCOMDAT-NEXT:   CodeSize: 0x7<br>
> -MCOMDAT-NEXT: }<br>
> +MCOMDAT:        CodeSize: 0x7<br>
> +MCOMDAT:        DisplayName: f<br>
> +MCOMDAT:        LinkageName: ?f@@YAHXZ<br>
> +MCOMDAT:      }<br>
>  MCOMDAT:      FunctionLineTable [<br>
>  MCOMDAT-NEXT:   LinkageName: ?f@@YAHXZ<br>
>  MCOMDAT-NEXT:   Flags: 0x0<br>
> @@ -556,10 +557,10 @@ MCOMDAT-NEXT:     ]<br>
>  MCOMDAT-NEXT:   ]<br>
>  MCOMDAT-NEXT: ]<br>
>  MCOMDAT:      ProcStart {<br>
> -MCOMDAT-NEXT:   DisplayName: g<br>
> -MCOMDAT-NEXT:   Section: ?g@@YAHXZ<br>
> -MCOMDAT-NEXT:   CodeSize: 0x7<br>
> -MCOMDAT-NEXT: }<br>
> +MCOMDAT:        CodeSize: 0x7<br>
> +MCOMDAT:        DisplayName: g<br>
> +MCOMDAT:        LinkageName: ?g@@YAHXZ<br>
> +MCOMDAT:      }<br>
>  MCOMDAT:      FunctionLineTable [<br>
>  MCOMDAT-NEXT:   LinkageName: ?g@@YAHXZ<br>
>  MCOMDAT-NEXT:   Flags: 0x0<br>
><br>
> Modified: llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp (original)<br>
> +++ llvm/trunk/tools/llvm-pdbdump/FunctionDumper.cpp Wed Jan 13 13:32:35 2016<br>
> @@ -27,6 +27,7 @@<br>
>  #include "llvm/Support/Format.h"<br>
><br>
>  using namespace llvm;<br>
> +using namespace llvm::codeview;<br>
><br>
>  namespace {<br>
>  template <class T><br>
> @@ -57,10 +58,10 @@ void FunctionDumper::start(const PDBSymb<br>
>        Symbol.getSession().getConcreteSymbolById<PDBSymbolTypeUDT>(<br>
>            ClassParentId);<br>
><br>
> -  PDB_CallingConv CC = Symbol.getCallingConvention();<br>
> +  CallingConvention CC = Symbol.getCallingConvention();<br>
>    bool ShouldDumpCallingConvention = true;<br>
> -  if ((ClassParent && CC == PDB_CallingConv::Thiscall) ||<br>
> -      (!ClassParent && CC == PDB_CallingConv::NearStdcall)) {<br>
> +  if ((ClassParent && CC == CallingConvention::ThisCall) ||<br>
> +      (!ClassParent && CC == CallingConvention::NearStdCall)) {<br>
>      ShouldDumpCallingConvention = false;<br>
>    }<br>
><br>
> @@ -152,12 +153,12 @@ void FunctionDumper::start(const PDBSymb<br>
>    Printer << " ";<br>
><br>
>    auto ClassParent = Symbol.getClassParent();<br>
> -  PDB_CallingConv CC = Signature->getCallingConvention();<br>
> +  CallingConvention CC = Signature->getCallingConvention();<br>
>    if (Pointer != FunctionDumper::PointerType::None)<br>
>      Printer << "(";<br>
><br>
> -  if ((ClassParent && CC != PDB_CallingConv::Thiscall) ||<br>
> -      (!ClassParent && CC != PDB_CallingConv::NearStdcall)) {<br>
> +  if ((ClassParent && CC != CallingConvention::ThisCall) ||<br>
> +      (!ClassParent && CC != CallingConvention::NearStdCall)) {<br>
>      WithColor(Printer, PDB_ColorItem::Keyword).get()<br>
>          << Signature->getCallingConvention() << " ";<br>
>    }<br>
><br>
> Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)<br>
> +++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Wed Jan 13 13:32:35 2016<br>
> @@ -14,6 +14,7 @@<br>
><br>
>  #include "llvm-readobj.h"<br>
>  #include "ARMWinEHPrinter.h"<br>
> +#include "CodeView.h"<br>
>  #include "Error.h"<br>
>  #include "ObjDumper.h"<br>
>  #include "StackMapPrinter.h"<br>
> @@ -22,6 +23,7 @@<br>
>  #include "llvm/ADT/DenseMap.h"<br>
>  #include "llvm/ADT/SmallString.h"<br>
>  #include "llvm/ADT/StringExtras.h"<br>
> +#include "llvm/ADT/StringSet.h"<br>
>  #include "llvm/Object/COFF.h"<br>
>  #include "llvm/Object/ObjectFile.h"<br>
>  #include "llvm/Support/COFF.h"<br>
> @@ -39,6 +41,7 @@<br>
><br>
>  using namespace llvm;<br>
>  using namespace llvm::object;<br>
> +using namespace llvm::codeview;<br>
>  using namespace llvm::Win64EH;<br>
><br>
>  namespace {<br>
> @@ -72,12 +75,18 @@ private:<br>
>    void printBaseOfDataField(const pe32_header *Hdr);<br>
>    void printBaseOfDataField(const pe32plus_header *Hdr);<br>
><br>
> -  void printCodeViewSection(const SectionRef &Section);<br>
> +  void printCodeViewSymbolSection(StringRef SectionName, const SectionRef &Section);<br>
> +  void printCodeViewTypeSection(StringRef SectionName, const SectionRef &Section);<br>
> +  void printCodeViewFieldList(StringRef FieldData);<br>
> +  StringRef getTypeName(TypeIndex Ty);<br>
> +  void printTypeIndex(StringRef FieldName, TypeIndex TI);<br>
><br>
>    void printCodeViewSymbolsSubsection(StringRef Subsection,<br>
>                                        const SectionRef &Section,<br>
>                                        uint32_t Offset);<br>
><br>
> +  void printMemberAttributes(MemberAttributes Attrs);<br>
> +<br>
>    void cacheRelocations();<br>
><br>
>    std::error_code resolveSymbol(const coff_section *Section, uint64_t Offset,<br>
> @@ -96,6 +105,13 @@ private:<br>
>    RelocMapTy RelocMap;<br>
>    StringRef CVFileIndexToStringOffsetTable;<br>
>    StringRef CVStringTable;<br>
> +<br>
> +  /// All user defined type records in .debug$T live in here. Type indices<br>
> +  /// greater than 0x1000 are user defined. Subtract 0x1000 from the index to<br>
> +  /// index into this vector.<br>
> +  SmallVector<StringRef, 10> CVUDTNames;<br>
> +<br>
> +  StringSet<> TypeNames;<br>
>  };<br>
><br>
>  } // namespace<br>
> @@ -331,6 +347,353 @@ WeakExternalCharacteristics[] = {<br>
>    { "Alias"    , COFF::IMAGE_WEAK_EXTERN_SEARCH_ALIAS     }<br>
>  };<br>
><br>
> +static const EnumEntry<CompileSym3::Flags> CompileSym3Flags[] = {<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, EC),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, NoDbgInfo),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, LTCG),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, NoDataAlign),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, ManagedPresent),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, SecurityChecks),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, HotPatch),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, CVTCIL),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, MSILModule),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, Sdl),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, PGO),<br>
> +    LLVM_READOBJ_ENUM_ENT(CompileSym3, Exp),<br>
> +};<br>
> +<br>
> +static const EnumEntry<codeview::SourceLanguage> SourceLanguages[] = {<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, C),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Cpp),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Fortran),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Masm),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Pascal),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Basic),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Cobol),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Link),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Cvtres),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Cvtpgd),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, CSharp),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, VB),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, ILAsm),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, Java),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, JScript),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, MSIL),<br>
> +    LLVM_READOBJ_ENUM_ENT(SourceLanguage, HLSL),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint32_t> SubSectionTypes[] = {<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, Symbols),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, Lines),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, StringTable),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, FileChecksums),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, FrameData),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, InlineeLines),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, CrossScopeImports),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, CrossScopeExports),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, ILLines),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, FuncMDTokenMap),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, TypeMDTokenMap),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, MergedAssemblyInput),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ModuleSubstreamKind, CoffSymbolRVA),<br>
> +};<br>
> +<br>
> +static const EnumEntry<unsigned> CPUTypeNames[] = {<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Intel8080),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Intel8086),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Intel80286),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Intel80386),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Intel80486),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Pentium),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, PentiumPro),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Pentium3),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPS),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPS16),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPS32),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPS64),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPSI),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPSII),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPSIII),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPSIV),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, MIPSV),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, M68000),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, M68010),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, M68020),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, M68030),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, M68040),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Alpha),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Alpha21164),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Alpha21164A),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Alpha21264),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Alpha21364),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, PPC601),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, PPC603),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, PPC604),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, PPC620),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, PPCFP),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, PPCBE),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, SH3),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, SH3E),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, SH3DSP),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, SH4),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, SHMedia),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM3),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM4),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM4T),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM5),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM5T),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM6),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM_XMAC),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM_WMMX),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARM7),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Omni),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Ia64),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Ia64_2),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, CEE),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, AM33),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, M32R),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, TriCore),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, X64),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, EBC),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, Thumb),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, ARMNT),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(CPUType, D3D11_Shader),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint8_t> ProcSymFlags[] = {<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, HasFP),<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, HasIRET),<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, HasFRET),<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, IsNoReturn),<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, IsUnreachable),<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, HasCustomCallingConv),<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, IsNoInline),<br>
> +    LLVM_READOBJ_ENUM_ENT(ProcFlags, HasOptimizedDebugInfo),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint32_t> FrameProcSymFlags[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, HasAlloca),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, HasSetJmp),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, HasLongJmp),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, HasInlineAssembly),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, HasExceptionHandling),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, MarkedInline),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions,<br>
> +                                HasStructuredExceptionHandling),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, Naked),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, SecurityChecks),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions,<br>
> +                                AsynchronousExceptionHandling),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions,<br>
> +                                NoStackOrderingForSecurityChecks),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, Inlined),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, StrictSecurityChecks),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, SafeBuffers),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions,<br>
> +                                ProfileGuidedOptimization),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, ValidProfileCounts),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, OptimizedForSpeed),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, GuardCfg),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FrameProcedureOptions, GuardCfw),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint32_t> FrameDataFlags[] = {<br>
> +    LLVM_READOBJ_ENUM_ENT(FrameData, HasSEH),<br>
> +    LLVM_READOBJ_ENUM_ENT(FrameData, HasEH),<br>
> +    LLVM_READOBJ_ENUM_ENT(FrameData, IsFunctionStart),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint16_t> LocalFlags[] = {<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsParameter),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsAddressTaken),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsCompilerGenerated),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsAggregate),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsAggregated),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsAliased),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsAlias),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsReturnValue),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsOptimizedOut),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsEnregisteredGlobal),<br>
> +    LLVM_READOBJ_ENUM_ENT(LocalSym, IsEnregisteredStatic),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint16_t> FrameCookieKinds[] = {<br>
> +    LLVM_READOBJ_ENUM_ENT(FrameCookieSym, Copy),<br>
> +    LLVM_READOBJ_ENUM_ENT(FrameCookieSym, XorStackPointer),<br>
> +    LLVM_READOBJ_ENUM_ENT(FrameCookieSym, XorFramePointer),<br>
> +    LLVM_READOBJ_ENUM_ENT(FrameCookieSym, XorR13),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint16_t> ClassOptionNames[] = {<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, Packed),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, HasConstructorOrDestructor),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, HasOverloadedOperator),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, Nested),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, ContainsNestedClass),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, HasOverloadedAssignmentOperator),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, HasConversionOperator),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, ForwardReference),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, Scoped),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, HasUniqueName),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, Sealed),<br>
> +  LLVM_READOBJ_ENUM_CLASS_ENT(ClassOptions, Intrinsic),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint8_t> MemberAccessNames[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MemberAccess, None),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MemberAccess, Private),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MemberAccess, Protected),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MemberAccess, Public),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint16_t> MethodOptionNames[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodOptions, Pseudo),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodOptions, NoInherit),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodOptions, NoConstruct),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodOptions, CompilerGenerated),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodOptions, Sealed),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint16_t> MemberKindNames[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodKind, Vanilla),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodKind, Virtual),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodKind, Static),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodKind, Friend),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodKind, IntroducingVirtual),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodKind, PureVirtual),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(MethodKind, PureIntroducingVirtual),<br>
> +};<br>
> +<br>
> +/// The names here all end in "*". If the simple type is a pointer type, we<br>
> +/// return the whole name. Otherwise we lop off the last character in our<br>
> +/// StringRef.<br>
> +static const EnumEntry<SimpleTypeKind> SimpleTypeNames[] = {<br>
> +    {"void*", SimpleTypeKind::Void},<br>
> +    {"<not translated>*", SimpleTypeKind::NotTranslated},<br>
> +    {"HRESULT*", SimpleTypeKind::HResult},<br>
> +    {"signed char*", SimpleTypeKind::SignedCharacter},<br>
> +    {"unsigned char*", SimpleTypeKind::UnsignedCharacter},<br>
> +    {"char*", SimpleTypeKind::NarrowCharacter},<br>
> +    {"wchar_t*", SimpleTypeKind::WideCharacter},<br>
> +    {"__int8*", SimpleTypeKind::SByte},<br>
> +    {"unsigned __int8*", SimpleTypeKind::Byte},<br>
> +    {"short*", SimpleTypeKind::Int16Short},<br>
> +    {"unsigned short*", SimpleTypeKind::UInt16Short},<br>
> +    {"__int16*", SimpleTypeKind::Int16},<br>
> +    {"unsigned __int16*", SimpleTypeKind::UInt16},<br>
> +    {"long*", SimpleTypeKind::Int32Long},<br>
> +    {"unsigned long*", SimpleTypeKind::UInt32Long},<br>
> +    {"int*", SimpleTypeKind::Int32},<br>
> +    {"unsigned*", SimpleTypeKind::UInt32},<br>
> +    {"__int64*", SimpleTypeKind::Int64Quad},<br>
> +    {"unsigned __int64*", SimpleTypeKind::UInt64Quad},<br>
> +    {"__int64*", SimpleTypeKind::Int64},<br>
> +    {"unsigned __int64*", SimpleTypeKind::UInt64},<br>
> +    {"__int128*", SimpleTypeKind::Int128},<br>
> +    {"unsigned __int128*", SimpleTypeKind::UInt128},<br>
> +    {"__half*", SimpleTypeKind::Float16},<br>
> +    {"float*", SimpleTypeKind::Float32},<br>
> +    {"float*", SimpleTypeKind::Float32PartialPrecision},<br>
> +    {"__float48*", SimpleTypeKind::Float48},<br>
> +    {"double*", SimpleTypeKind::Float64},<br>
> +    {"long double*", SimpleTypeKind::Float80},<br>
> +    {"__float128*", SimpleTypeKind::Float128},<br>
> +    {"_Complex float*", SimpleTypeKind::Complex32},<br>
> +    {"_Complex double*", SimpleTypeKind::Complex64},<br>
> +    {"_Complex long double*", SimpleTypeKind::Complex80},<br>
> +    {"_Complex __float128*", SimpleTypeKind::Complex128},<br>
> +    {"bool*", SimpleTypeKind::Boolean8},<br>
> +    {"__bool16*", SimpleTypeKind::Boolean16},<br>
> +    {"__bool32*", SimpleTypeKind::Boolean32},<br>
> +    {"__bool64*", SimpleTypeKind::Boolean64},<br>
> +};<br>
> +<br>
> +static const EnumEntry<LeafType> LeafTypeNames[] = {<br>
> +#define LEAF_TYPE(name, val) LLVM_READOBJ_ENUM_ENT(LeafType, name),<br>
> +#include "CVLeafTypes.def"<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint8_t> PtrKindNames[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, Near16),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, Far16),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, Huge16),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, BasedOnSegment),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, BasedOnValue),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentValue),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, BasedOnAddress),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, BasedOnSegmentAddress),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, BasedOnType),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, BasedOnSelf),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, Near32),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, Far32),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerKind, Near64),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint8_t> PtrModeNames[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerMode, Pointer),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerMode, LValueReference),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerMode, PointerToDataMember),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerMode, PointerToMemberFunction),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerMode, RValueReference),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint16_t> PtrMemberRepNames[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation, Unknown),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation,<br>
> +                                SingleInheritanceData),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation,<br>
> +                                MultipleInheritanceData),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation,<br>
> +                                VirtualInheritanceData),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralData),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation,<br>
> +                                SingleInheritanceFunction),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation,<br>
> +                                MultipleInheritanceFunction),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation,<br>
> +                                VirtualInheritanceFunction),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(PointerToMemberRepresentation, GeneralFunction),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint16_t> TypeModifierNames[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(ModifierOptions, Const),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(ModifierOptions, Volatile),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(ModifierOptions, Unaligned),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint8_t> CallingConventions[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, NearC),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, FarC),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, NearPascal),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, FarPascal),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, NearFast),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, FarFast),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, NearStdCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, FarStdCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, NearSysCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, FarSysCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, ThisCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, MipsCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, Generic),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, AlphaCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, PpcCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, SHCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, ArmCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, AM33Call),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, TriCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, SH5Call),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, M32RCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, ClrCall),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, Inline),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(CallingConvention, NearVector),<br>
> +};<br>
> +<br>
> +static const EnumEntry<uint8_t> FunctionOptionEnum[] = {<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FunctionOptions, CxxReturnUdt),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FunctionOptions, Constructor),<br>
> +    LLVM_READOBJ_ENUM_CLASS_ENT(FunctionOptions, ConstructorWithVirtualBases),<br>
> +};<br>
> +<br>
>  template <typename T><br>
>  static std::error_code getSymbolAuxData(const COFFObjectFile *Obj,<br>
>                                          COFFSymbolRef Symbol,<br>
> @@ -476,110 +839,165 @@ void COFFDumper::printBaseOfDataField(co<br>
>  void COFFDumper::printBaseOfDataField(const pe32plus_header *) {}<br>
><br>
>  void COFFDumper::printCodeViewDebugInfo() {<br>
> +  // Print types first to build CVUDTNames, then print symbols.<br>
>    for (const SectionRef &S : Obj->sections()) {<br>
> -    StringRef SecName;<br>
> -    error(S.getName(SecName));<br>
> -    if (SecName == ".debug$S")<br>
> -      printCodeViewSection(S);<br>
> +    StringRef SectionName;<br>
> +    error(S.getName(SectionName));<br>
> +    if (SectionName == ".debug$T")<br>
> +      printCodeViewTypeSection(SectionName, S);<br>
> +  }<br>
> +  for (const SectionRef &S : Obj->sections()) {<br>
> +    StringRef SectionName;<br>
> +    error(S.getName(SectionName));<br>
> +    if (SectionName == ".debug$S")<br>
> +      printCodeViewSymbolSection(SectionName, S);<br>
>    }<br>
>  }<br>
><br>
> -void COFFDumper::printCodeViewSection(const SectionRef &Section) {<br>
> -  StringRef Data;<br>
> -  error(Section.getContents(Data));<br>
> +/// Consumes sizeof(T) bytes from the given byte sequence. Returns an error if<br>
> +/// there are not enough bytes remaining. Reinterprets the consumed bytes as a<br>
> +/// T object and points 'Res' at them.<br>
> +template <typename T><br>
> +static std::error_code consumeObject(StringRef &Data, const T *&Res) {<br>
> +  if (Data.size() < sizeof(*Res))<br>
> +    return object_error::parse_failed;<br>
> +  Res = reinterpret_cast<const T *>(Data.data());<br>
> +  Data = Data.drop_front(sizeof(*Res));<br>
> +  return std::error_code();<br>
> +}<br>
> +<br>
> +static std::error_code consumeUInt32(StringRef &Data, uint32_t &Res) {<br>
> +  const ulittle32_t *IntPtr;<br>
> +  if (auto EC = consumeObject(Data, IntPtr))<br>
> +    return EC;<br>
> +  Res = *IntPtr;<br>
> +  return std::error_code();<br>
> +}<br>
> +<br>
> +void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,<br>
> +                                            const SectionRef &Section) {<br>
> +  StringRef SectionContents;<br>
> +  error(Section.getContents(SectionContents));<br>
> +  StringRef Data = SectionContents;<br>
><br>
>    SmallVector<StringRef, 10> FunctionNames;<br>
>    StringMap<StringRef> FunctionLineTables;<br>
> +  std::map<StringRef, const FrameData *> FunctionFrameData;<br>
><br>
>    ListScope D(W, "CodeViewDebugInfo");<br>
> -  {<br>
> -    // FIXME: Add more offset correctness checks.<br>
> -    DataExtractor DE(Data, true, 4);<br>
> -    uint32_t Offset = 0,<br>
> -             Magic = DE.getU32(&Offset);<br>
> -    W.printHex("Magic", Magic);<br>
> -    if (Magic != COFF::DEBUG_SECTION_MAGIC) {<br>
> -      error(object_error::parse_failed);<br>
> -      return;<br>
> -    }<br>
> +  // Print the section to allow correlation with printSections.<br>
> +  W.printNumber("Section", SectionName, Obj->getSectionID(Section));<br>
><br>
> -    bool Finished = false;<br>
> -    while (DE.isValidOffset(Offset) && !Finished) {<br>
> -      // The section consists of a number of subsection in the following format:<br>
> -      // |Type|PayloadSize|Payload...|<br>
> -      uint32_t SubSectionType = DE.getU32(&Offset),<br>
> -               PayloadSize = DE.getU32(&Offset);<br>
> -      ListScope S(W, "Subsection");<br>
> -      W.printHex("Type", SubSectionType);<br>
> -      W.printHex("PayloadSize", PayloadSize);<br>
> -      if (PayloadSize > Data.size() - Offset) {<br>
> +  uint32_t Magic;<br>
> +  error(consumeUInt32(Data, Magic));<br>
> +  W.printHex("Magic", Magic);<br>
> +  if (Magic != COFF::DEBUG_SECTION_MAGIC)<br>
> +    return error(object_error::parse_failed);<br>
> +<br>
> +  while (!Data.empty()) {<br>
> +    // The section consists of a number of subsection in the following format:<br>
> +    // |SubSectionType|SubSectionSize|Contents...|<br>
> +    uint32_t SubType, SubSectionSize;<br>
> +    error(consumeUInt32(Data, SubType));<br>
> +    error(consumeUInt32(Data, SubSectionSize));<br>
> +<br>
> +    ListScope S(W, "Subsection");<br>
> +    W.printEnum("SubSectionType", SubType, makeArrayRef(SubSectionTypes));<br>
> +    W.printHex("SubSectionSize", SubSectionSize);<br>
> +<br>
> +    // Get the contents of the subsection.<br>
> +    if (SubSectionSize > Data.size())<br>
> +      return error(object_error::parse_failed);<br>
> +    StringRef Contents = Data.substr(0, SubSectionSize);<br>
> +<br>
> +    // Add SubSectionSize to the current offset and align that offset to find<br>
> +    // the next subsection.<br>
> +    size_t SectionOffset = Data.data() - SectionContents.data();<br>
> +    size_t NextOffset = SectionOffset + SubSectionSize;<br>
> +    NextOffset = RoundUpToAlignment(NextOffset, 4);<br>
> +    Data = SectionContents.drop_front(NextOffset);<br>
> +<br>
> +    // Optionally print the subsection bytes in case our parsing gets confused<br>
> +    // later.<br>
> +    if (opts::CodeViewSubsectionBytes)<br>
> +      W.printBinaryBlock("SubSectionContents", Contents);<br>
> +<br>
> +    switch (ModuleSubstreamKind(SubType)) {<br>
> +    case ModuleSubstreamKind::Symbols:<br>
> +      printCodeViewSymbolsSubsection(Contents, Section, SectionOffset);<br>
> +      break;<br>
> +    case ModuleSubstreamKind::Lines: {<br>
> +      // Holds a PC to file:line table.  Some data to parse this subsection is<br>
> +      // stored in the other subsections, so just check sanity and store the<br>
> +      // pointers for deferred processing.<br>
> +<br>
> +      if (SubSectionSize < 12) {<br>
> +        // There should be at least three words to store two function<br>
> +        // relocations and size of the code.<br>
>          error(object_error::parse_failed);<br>
>          return;<br>
>        }<br>
><br>
> -      StringRef Contents = Data.substr(Offset, PayloadSize);<br>
> -      if (opts::CodeViewSubsectionBytes) {<br>
> -        // Print the raw contents to simplify debugging if anything goes wrong<br>
> -        // afterwards.<br>
> -        W.printBinaryBlock("Contents", Contents);<br>
> -      }<br>
> -<br>
> -      switch (SubSectionType) {<br>
> -      case COFF::DEBUG_SYMBOL_SUBSECTION:<br>
> -        printCodeViewSymbolsSubsection(Contents, Section, Offset);<br>
> -        break;<br>
> -      case COFF::DEBUG_LINE_TABLE_SUBSECTION: {<br>
> -        // Holds a PC to file:line table.  Some data to parse this subsection is<br>
> -        // stored in the other subsections, so just check sanity and store the<br>
> -        // pointers for deferred processing.<br>
> -<br>
> -        if (PayloadSize < 12) {<br>
> -          // There should be at least three words to store two function<br>
> -          // relocations and size of the code.<br>
> -          error(object_error::parse_failed);<br>
> -          return;<br>
> -        }<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section), SectionOffset,<br>
> +                              LinkageName));<br>
> +      W.printString("LinkageName", LinkageName);<br>
> +      if (FunctionLineTables.count(LinkageName) != 0) {<br>
> +        // Saw debug info for this function already?<br>
> +        error(object_error::parse_failed);<br>
> +        return;<br>
> +      }<br>
><br>
> -        StringRef LinkageName;<br>
> -        error(resolveSymbolName(Obj->getCOFFSection(Section), Offset,<br>
> -                                LinkageName));<br>
> -        W.printString("LinkageName", LinkageName);<br>
> -        if (FunctionLineTables.count(LinkageName) != 0) {<br>
> -          // Saw debug info for this function already?<br>
> -          error(object_error::parse_failed);<br>
> -          return;<br>
> -        }<br>
> +      FunctionLineTables[LinkageName] = Contents;<br>
> +      FunctionNames.push_back(LinkageName);<br>
> +      break;<br>
> +    }<br>
> +    case ModuleSubstreamKind::StringTable:<br>
> +      if (SubSectionSize == 0 || CVStringTable.data() != nullptr ||<br>
> +          Contents.back() != '\0') {<br>
> +        // Empty or duplicate or non-null-terminated subsection.<br>
> +        error(object_error::parse_failed);<br>
> +        return;<br>
> +      }<br>
> +      CVStringTable = Contents;<br>
> +      break;<br>
> +    case ModuleSubstreamKind::FileChecksums:<br>
> +      // Holds the translation table from file indices<br>
> +      // to offsets in the string table.<br>
> +<br>
> +      if (SubSectionSize == 0 ||<br>
> +          CVFileIndexToStringOffsetTable.data() != nullptr) {<br>
> +        // Empty or duplicate subsection.<br>
> +        error(object_error::parse_failed);<br>
> +        return;<br>
> +      }<br>
> +      CVFileIndexToStringOffsetTable = Contents;<br>
> +      break;<br>
> +    case ModuleSubstreamKind::FrameData: {<br>
> +      const size_t RelocationSize = 4;<br>
> +      if (SubSectionSize != sizeof(FrameData) + RelocationSize) {<br>
> +        // There should be exactly one relocation followed by the FrameData<br>
> +        // contents.<br>
> +        error(object_error::parse_failed);<br>
> +        return;<br>
> +      }<br>
><br>
> -        FunctionLineTables[LinkageName] = Contents;<br>
> -        FunctionNames.push_back(LinkageName);<br>
> -        break;<br>
> -      }<br>
> -      case COFF::DEBUG_STRING_TABLE_SUBSECTION:<br>
> -        if (PayloadSize == 0 || CVStringTable.data() != nullptr ||<br>
> -            Contents.back() != '\0') {<br>
> -          // Empty or duplicate or non-null-terminated subsection.<br>
> -          error(object_error::parse_failed);<br>
> -          return;<br>
> -        }<br>
> -        CVStringTable = Contents;<br>
> -        break;<br>
> -      case COFF::DEBUG_INDEX_SUBSECTION:<br>
> -        // Holds the translation table from file indices<br>
> -        // to offsets in the string table.<br>
> -<br>
> -        if (PayloadSize == 0 ||<br>
> -            CVFileIndexToStringOffsetTable.data() != nullptr) {<br>
> -          // Empty or duplicate subsection.<br>
> -          error(object_error::parse_failed);<br>
> -          return;<br>
> -        }<br>
> -        CVFileIndexToStringOffsetTable = Contents;<br>
> -        break;<br>
> +      const auto *FD = reinterpret_cast<const FrameData *>(<br>
> +          Contents.drop_front(RelocationSize).data());<br>
> +<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section), SectionOffset,<br>
> +                              LinkageName));<br>
> +      if (!FunctionFrameData.emplace(LinkageName, FD).second) {<br>
> +        error(object_error::parse_failed);<br>
> +        return;<br>
>        }<br>
> -      Offset += PayloadSize;<br>
> +      break;<br>
> +    }<br>
><br>
> -      // Align the reading pointer by 4.<br>
> -      Offset += (-Offset) % 4;<br>
> +    // Do nothing for unrecognized subsections.<br>
> +    default:<br>
> +      break;<br>
>      }<br>
>    }<br>
><br>
> @@ -674,89 +1092,1099 @@ void COFFDumper::printCodeViewSection(co<br>
>        }<br>
>      }<br>
>    }<br>
> +<br>
> +  for (auto FrameDataPair : FunctionFrameData) {<br>
> +    StringRef LinkageName = FrameDataPair.first;<br>
> +    const FrameData *FD = FrameDataPair.second;<br>
> +    ListScope S(W, "FunctionFrameData");<br>
> +    W.printString("LinkageName", LinkageName);<br>
> +    W.printHex("RvaStart", FD->RvaStart);<br>
> +    W.printHex("CodeSize", FD->CodeSize);<br>
> +    W.printHex("LocalSize", FD->LocalSize);<br>
> +    W.printHex("ParamsSize", FD->ParamsSize);<br>
> +    W.printHex("MaxStackSize", FD->MaxStackSize);<br>
> +    W.printString("FrameFunc", StringRef(CVStringTable.data() + FD->FrameFunc));<br>
> +    W.printHex("PrologSize", FD->PrologSize);<br>
> +    W.printHex("SavedRegsSize", FD->SavedRegsSize);<br>
> +    W.printFlags("Flags", FD->Flags, makeArrayRef(FrameDataFlags));<br>
> +  }<br>
> +}<br>
> +<br>
> +static std::error_code decodeNumerictLeaf(StringRef &Data, APSInt &Num) {<br>
> +  // Used to avoid overload ambiguity on APInt construtor.<br>
> +  bool FalseVal = false;<br>
> +  if (Data.size() < 2)<br>
> +    return object_error::parse_failed;<br>
> +  uint16_t Short = *reinterpret_cast<const ulittle16_t *>(Data.data());<br>
> +  Data = Data.drop_front(2);<br>
> +  if (Short < LF_NUMERIC) {<br>
> +    Num = APSInt(APInt(/*numBits=*/16, Short, /*isSigned=*/false),<br>
> +                 /*isUnsigned=*/true);<br>
> +    return std::error_code();<br>
> +  }<br>
> +  switch (Short) {<br>
> +  case LF_CHAR:<br>
> +    Num = APSInt(APInt(/*numBits=*/8,<br>
> +                       *reinterpret_cast<const int8_t *>(Data.data()),<br>
> +                       /*isSigned=*/true),<br>
> +                 /*isUnsigned=*/false);<br>
> +    Data = Data.drop_front(1);<br>
> +    return std::error_code();<br>
> +  case LF_SHORT:<br>
> +    Num = APSInt(APInt(/*numBits=*/16,<br>
> +                       *reinterpret_cast<const little16_t *>(Data.data()),<br>
> +                       /*isSigned=*/true),<br>
> +                 /*isUnsigned=*/false);<br>
> +    Data = Data.drop_front(2);<br>
> +    return std::error_code();<br>
> +  case LF_USHORT:<br>
> +    Num = APSInt(APInt(/*numBits=*/16,<br>
> +                       *reinterpret_cast<const ulittle16_t *>(Data.data()),<br>
> +                       /*isSigned=*/false),<br>
> +                 /*isUnsigned=*/true);<br>
> +    Data = Data.drop_front(2);<br>
> +    return std::error_code();<br>
> +  case LF_LONG:<br>
> +    Num = APSInt(APInt(/*numBits=*/32,<br>
> +                       *reinterpret_cast<const little32_t *>(Data.data()),<br>
> +                       /*isSigned=*/true),<br>
> +                 /*isUnsigned=*/false);<br>
> +    Data = Data.drop_front(4);<br>
> +    return std::error_code();<br>
> +  case LF_ULONG:<br>
> +    Num = APSInt(APInt(/*numBits=*/32,<br>
> +                       *reinterpret_cast<const ulittle32_t *>(Data.data()),<br>
> +                       /*isSigned=*/FalseVal),<br>
> +                 /*isUnsigned=*/true);<br>
> +    Data = Data.drop_front(4);<br>
> +    return std::error_code();<br>
> +  case LF_QUADWORD:<br>
> +    Num = APSInt(APInt(/*numBits=*/64,<br>
> +                       *reinterpret_cast<const little64_t *>(Data.data()),<br>
> +                       /*isSigned=*/true),<br>
> +                 /*isUnsigned=*/false);<br>
> +    Data = Data.drop_front(8);<br>
> +    return std::error_code();<br>
> +  case LF_UQUADWORD:<br>
> +    Num = APSInt(APInt(/*numBits=*/64,<br>
> +                       *reinterpret_cast<const ulittle64_t *>(Data.data()),<br>
> +                       /*isSigned=*/false),<br>
> +                 /*isUnsigned=*/true);<br>
> +    Data = Data.drop_front(8);<br>
> +    return std::error_code();<br>
> +  }<br>
> +  return object_error::parse_failed;<br>
> +}<br>
> +<br>
> +/// Decode an unsigned integer numeric leaf value.<br>
> +std::error_code decodeUIntLeaf(StringRef &Data, uint64_t &Num) {<br>
> +  APSInt N;<br>
> +  if (std::error_code err = decodeNumerictLeaf(Data, N))<br>
> +    return err;<br>
> +  if (N.isSigned() || !N.isIntN(64))<br>
> +    return object_error::parse_failed;<br>
> +  Num = N.getLimitedValue();<br>
> +  return std::error_code();<br>
>  }<br>
><br>
>  void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection,<br>
>                                                  const SectionRef &Section,<br>
>                                                  uint32_t OffsetInSection) {<br>
> -  if (Subsection.size() == 0) {<br>
> -    error(object_error::parse_failed);<br>
> -    return;<br>
> -  }<br>
> -  DataExtractor DE(Subsection, true, 4);<br>
> -  uint32_t Offset = 0;<br>
> +  if (Subsection.size() < sizeof(SymRecord))<br>
> +    return error(object_error::parse_failed);<br>
> +<br>
> +  // This holds the remaining data to parse.<br>
> +  StringRef Data = Subsection;<br>
><br>
> -  // Function-level subsections have "procedure start" and "procedure end"<br>
> -  // commands that should come in pairs and surround relevant info.<br>
>    bool InFunctionScope = false;<br>
> -  while (DE.isValidOffset(Offset)) {<br>
> -    // Read subsection segments one by one.<br>
> -    uint16_t Size = DE.getU16(&Offset);<br>
> -    // The section size includes the size of the type identifier.<br>
> -    if (Size < 2 || !DE.isValidOffsetForDataOfSize(Offset, Size)) {<br>
> -      error(object_error::parse_failed);<br>
> -      return;<br>
> -    }<br>
> -    Size -= 2;<br>
> -    uint16_t Type = DE.getU16(&Offset);<br>
> +  while (!Data.empty()) {<br>
> +    const SymRecord *Rec;<br>
> +    error(consumeObject(Data, Rec));<br>
> +<br>
> +    StringRef SymData = Data.substr(0, Rec->RecordLength - 2);<br>
> +<br>
> +    Data = Data.drop_front(Rec->RecordLength - 2);<br>
> +<br>
> +    SymType Type = static_cast<SymType>(uint16_t(Rec->RecordType));<br>
>      switch (Type) {<br>
> -    case COFF::DEBUG_SYMBOL_TYPE_PROC_START: {<br>
> +    case S_LPROC32:<br>
> +    case S_GPROC32:<br>
> +    case S_GPROC32_ID:<br>
> +    case S_LPROC32_ID:<br>
> +    case S_LPROC32_DPC:<br>
> +    case S_LPROC32_DPC_ID: {<br>
>        DictScope S(W, "ProcStart");<br>
> -      if (InFunctionScope || Size < 36) {<br>
> -        error(object_error::parse_failed);<br>
> -        return;<br>
> -      }<br>
> +      const ProcSym *Proc;<br>
> +      error(consumeObject(SymData, Proc));<br>
> +      if (InFunctionScope)<br>
> +        return error(object_error::parse_failed);<br>
>        InFunctionScope = true;<br>
><br>
> -      // We're currently interested in a limited subset of fields in this<br>
> -      // segment, just ignore the rest of the fields for now.<br>
> -      uint8_t Unused[12];<br>
> -      DE.getU8(&Offset, Unused, 12);<br>
> -      uint32_t CodeSize = DE.getU32(&Offset);<br>
> -      DE.getU8(&Offset, Unused, 12);<br>
> -      StringRef SectionName;<br>
> +      // In a COFF object file, the CodeOffset field is typically zero and has a<br>
> +      // relocation applied to it. Go and look up the symbol for that<br>
> +      // relocation.<br>
> +      ptrdiff_t SecOffsetOfCodeOffset =<br>
> +          reinterpret_cast<const char *>(&Proc->CodeOffset) - Subsection.data();<br>
> +      StringRef LinkageName;<br>
>        error(resolveSymbolName(Obj->getCOFFSection(Section),<br>
> -                              OffsetInSection + Offset, SectionName));<br>
> -      Offset += 4;<br>
> -      DE.getU8(&Offset, Unused, 3);<br>
> -      StringRef DisplayName = DE.getCStr(&Offset);<br>
> -      if (!DE.isValidOffset(Offset)) {<br>
> -        error(object_error::parse_failed);<br>
> -        return;<br>
> -      }<br>
> -      W.printString("DisplayName", DisplayName);<br>
> -      W.printString("Section", SectionName);<br>
> -      W.printHex("CodeSize", CodeSize);<br>
> +                              OffsetInSection + SecOffsetOfCodeOffset,<br>
> +                              LinkageName));<br>
><br>
> +      StringRef DisplayName = SymData.split('\0').first;<br>
> +      W.printHex("PtrParent", Proc->PtrParent);<br>
> +      W.printHex("PtrEnd", Proc->PtrEnd);<br>
> +      W.printHex("PtrNext", Proc->PtrNext);<br>
> +      W.printHex("CodeSize", Proc->CodeSize);<br>
> +      W.printHex("DbgStart", Proc->DbgStart);<br>
> +      W.printHex("DbgEnd", Proc->DbgEnd);<br>
> +      printTypeIndex("FunctionType", Proc->FunctionType);<br>
> +      W.printHex("CodeOffset", Proc->CodeOffset);<br>
> +      W.printHex("Segment", Proc->Segment);<br>
> +      W.printFlags("Flags", Proc->Flags, makeArrayRef(ProcSymFlags));<br>
> +      W.printString("DisplayName", DisplayName);<br>
> +      W.printString("LinkageName", LinkageName);<br>
>        break;<br>
>      }<br>
> -    case COFF::DEBUG_SYMBOL_TYPE_PROC_END: {<br>
> +<br>
> +    case S_PROC_ID_END: {<br>
>        W.startLine() << "ProcEnd\n";<br>
> -      if (!InFunctionScope || Size > 0) {<br>
> -        error(object_error::parse_failed);<br>
> -        return;<br>
> -      }<br>
>        InFunctionScope = false;<br>
>        break;<br>
>      }<br>
> +<br>
> +    case S_BLOCK32: {<br>
> +      DictScope S(W, "BlockStart");<br>
> +      const BlockSym *Block;<br>
> +      error(consumeObject(SymData, Block));<br>
> +<br>
> +      // In a COFF object file, the CodeOffset field is typically zero and has a<br>
> +      // relocation applied to it. Go and look up the symbol for that<br>
> +      // relocation.<br>
> +      ptrdiff_t SecOffsetOfCodeOffset =<br>
> +          reinterpret_cast<const char *>(&Block->CodeOffset) - Subsection.data();<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section),<br>
> +                              OffsetInSection + SecOffsetOfCodeOffset,<br>
> +                              LinkageName));<br>
> +<br>
> +      StringRef BlockName = SymData.split('\0').first;<br>
> +      W.printHex("PtrParent", Block->PtrParent);<br>
> +      W.printHex("PtrEnd", Block->PtrEnd);<br>
> +      W.printHex("CodeSize", Block->CodeSize);<br>
> +      W.printHex("CodeOffset", Block->CodeOffset);<br>
> +      W.printHex("Segment", Block->Segment);<br>
> +      W.printString("BlockName", BlockName);<br>
> +      W.printString("LinkageName", LinkageName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_END: {<br>
> +      W.startLine() << "BlockEnd\n";<br>
> +      InFunctionScope = false;<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_LABEL32: {<br>
> +      DictScope S(W, "Label");<br>
> +      const LabelSym *Label;<br>
> +      error(consumeObject(SymData, Label));<br>
> +<br>
> +      // In a COFF object file, the CodeOffset field is typically zero and has a<br>
> +      // relocation applied to it. Go and look up the symbol for that<br>
> +      // relocation.<br>
> +      ptrdiff_t SecOffsetOfCodeOffset =<br>
> +          reinterpret_cast<const char *>(&Label->CodeOffset) - Subsection.data();<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section),<br>
> +                              OffsetInSection + SecOffsetOfCodeOffset,<br>
> +                              LinkageName));<br>
> +<br>
> +      StringRef DisplayName = SymData.split('\0').first;<br>
> +      W.printHex("CodeOffset", Label->CodeOffset);<br>
> +      W.printHex("Segment", Label->Segment);<br>
> +      W.printHex("Flags", Label->Flags);<br>
> +      W.printFlags("Flags", Label->Flags, makeArrayRef(ProcSymFlags));<br>
> +      W.printString("DisplayName", DisplayName);<br>
> +      W.printString("LinkageName", LinkageName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_INLINESITE: {<br>
> +      DictScope S(W, "InlineSite");<br>
> +      const InlineSiteSym *InlineSite;<br>
> +      error(consumeObject(SymData, InlineSite));<br>
> +      W.printHex("PtrParent", InlineSite->PtrParent);<br>
> +      W.printHex("PtrEnd", InlineSite->PtrEnd);<br>
> +      printTypeIndex("Inlinee", InlineSite->Inlinee);<br>
> +      W.printBinaryBlock("BinaryAnnotations", SymData);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_INLINESITE_END: {<br>
> +      DictScope S(W, "InlineSiteEnd");<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_LOCAL: {<br>
> +      DictScope S(W, "Local");<br>
> +      const LocalSym *Local;<br>
> +      error(consumeObject(SymData, Local));<br>
> +      printTypeIndex("Type", Local->Type);<br>
> +      W.printFlags("Flags", uint16_t(Local->Flags), makeArrayRef(LocalFlags));<br>
> +      StringRef VarName = SymData.split('\0').first;<br>
> +      W.printString("VarName", VarName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_CALLSITEINFO: {<br>
> +      DictScope S(W, "CallSiteInfo");<br>
> +      const CallSiteInfoSym *CallSiteInfo;<br>
> +      error(consumeObject(SymData, CallSiteInfo));<br>
> +<br>
> +      // In a COFF object file, the CodeOffset field is typically zero and has a<br>
> +      // relocation applied to it. Go and look up the symbol for that<br>
> +      // relocation.<br>
> +      ptrdiff_t SecOffsetOfCodeOffset =<br>
> +          reinterpret_cast<const char *>(&CallSiteInfo->CodeOffset) - Subsection.data();<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section),<br>
> +                              OffsetInSection + SecOffsetOfCodeOffset,<br>
> +                              LinkageName));<br>
> +      W.printHex("CodeOffset", CallSiteInfo->CodeOffset);<br>
> +      W.printHex("Segment", CallSiteInfo->Segment);<br>
> +      W.printHex("Reserved", CallSiteInfo->Reserved);<br>
> +      printTypeIndex("Type", CallSiteInfo->Type);<br>
> +      W.printString("LinkageName", LinkageName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_HEAPALLOCSITE: {<br>
> +      DictScope S(W, "HeapAllocationSite");<br>
> +      const HeapAllocationSiteSym *HeapAllocationSite;<br>
> +      error(consumeObject(SymData, HeapAllocationSite));<br>
> +<br>
> +      // In a COFF object file, the CodeOffset field is typically zero and has a<br>
> +      // relocation applied to it. Go and look up the symbol for that<br>
> +      // relocation.<br>
> +      ptrdiff_t SecOffsetOfCodeOffset =<br>
> +          reinterpret_cast<const char *>(&HeapAllocationSite->CodeOffset) -<br>
> +          Subsection.data();<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section),<br>
> +                              OffsetInSection + SecOffsetOfCodeOffset,<br>
> +                              LinkageName));<br>
> +      W.printHex("CodeOffset", HeapAllocationSite->CodeOffset);<br>
> +      W.printHex("Segment", HeapAllocationSite->Segment);<br>
> +      W.printHex("CallInstructionSize",<br>
> +                 HeapAllocationSite->CallInstructionSize);<br>
> +      printTypeIndex("Type", HeapAllocationSite->Type);<br>
> +      W.printString("LinkageName", LinkageName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_FRAMECOOKIE: {<br>
> +      DictScope S(W, "FrameCookie");<br>
> +      const FrameCookieSym *FrameCookie;<br>
> +      error(consumeObject(SymData, FrameCookie));<br>
> +      W.printHex("CodeOffset", FrameCookie->CodeOffset);<br>
> +      W.printHex("Register", FrameCookie->Register);<br>
> +      W.printEnum("CookieKind", uint16_t(FrameCookie->CookieKind),<br>
> +                  makeArrayRef(FrameCookieKinds));<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_LDATA32:<br>
> +    case S_GDATA32:<br>
> +    case S_LMANDATA:<br>
> +    case S_GMANDATA: {<br>
> +      DictScope S(W, "DataSym");<br>
> +      const DataSym *Data;<br>
> +      error(consumeObject(SymData, Data));<br>
> +<br>
> +      // In a COFF object file, the DataOffset field is typically zero and has a<br>
> +      // relocation applied to it. Go and look up the symbol for that<br>
> +      // relocation.<br>
> +      ptrdiff_t SecOffsetOfDataOffset =<br>
> +          reinterpret_cast<const char *>(&Data->DataOffset) - Subsection.data();<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section),<br>
> +                              OffsetInSection + SecOffsetOfDataOffset,<br>
> +                              LinkageName));<br>
> +      StringRef DisplayName = SymData.split('\0').first;<br>
> +      W.printHex("DataOffset", Data->DataOffset);<br>
> +      printTypeIndex("Type", Data->Type);<br>
> +      W.printString("DisplayName", DisplayName);<br>
> +      W.printString("LinkageName", LinkageName);<br>
> +      break;<br>
> +    }<br>
> +    case S_LTHREAD32:<br>
> +    case S_GTHREAD32: {<br>
> +      DictScope S(W, "ThreadLocalDataSym");<br>
> +      const DataSym *Data;<br>
> +      error(consumeObject(SymData, Data));<br>
> +<br>
> +      // In a COFF object file, the DataOffset field is typically zero and has a<br>
> +      // relocation applied to it. Go and look up the symbol for that<br>
> +      // relocation.<br>
> +      ptrdiff_t SecOffsetOfDataOffset =<br>
> +          reinterpret_cast<const char *>(&Data->DataOffset) - Subsection.data();<br>
> +      StringRef LinkageName;<br>
> +      error(resolveSymbolName(Obj->getCOFFSection(Section),<br>
> +                              OffsetInSection + SecOffsetOfDataOffset,<br>
> +                              LinkageName));<br>
> +      StringRef DisplayName = SymData.split('\0').first;<br>
> +      W.printHex("DataOffset", Data->DataOffset);<br>
> +      printTypeIndex("Type", Data->Type);<br>
> +      W.printString("DisplayName", DisplayName);<br>
> +      W.printString("LinkageName", LinkageName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_OBJNAME: {<br>
> +      DictScope S(W, "ObjectName");<br>
> +      const ObjNameSym *ObjName;<br>
> +      error(consumeObject(SymData, ObjName));<br>
> +      W.printHex("Signature", ObjName->Signature);<br>
> +      StringRef ObjectName = SymData.split('\0').first;<br>
> +      W.printString("ObjectName", ObjectName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_COMPILE3: {<br>
> +      DictScope S(W, "CompilerFlags");<br>
> +      const CompileSym3 *CompFlags;<br>
> +      error(consumeObject(SymData, CompFlags));<br>
> +      W.printEnum("Language", CompFlags->getLanguage(),<br>
> +                  makeArrayRef(SourceLanguages));<br>
> +      W.printFlags("Flags", CompFlags->flags & ~0xff,<br>
> +                   makeArrayRef(CompileSym3Flags));<br>
> +      W.printEnum("Machine", unsigned(CompFlags->Machine),<br>
> +                  makeArrayRef(CPUTypeNames));<br>
> +      std::string FrontendVersion;<br>
> +      {<br>
> +        raw_string_ostream Out(FrontendVersion);<br>
> +        Out << CompFlags->VersionFrontendMajor << '.'<br>
> +            << CompFlags->VersionFrontendMinor << '.'<br>
> +            << CompFlags->VersionFrontendBuild << '.'<br>
> +            << CompFlags->VersionFrontendQFE;<br>
> +      }<br>
> +      std::string BackendVersion;<br>
> +      {<br>
> +        raw_string_ostream Out(BackendVersion);<br>
> +        Out << CompFlags->VersionBackendMajor << '.'<br>
> +            << CompFlags->VersionBackendMinor << '.'<br>
> +            << CompFlags->VersionBackendBuild << '.'<br>
> +            << CompFlags->VersionBackendQFE;<br>
> +      }<br>
> +      W.printString("FrontendVersion", FrontendVersion);<br>
> +      W.printString("BackendVersion", BackendVersion);<br>
> +      StringRef VersionName = SymData.split('\0').first;<br>
> +      W.printString("VersionName", VersionName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_FRAMEPROC: {<br>
> +      DictScope S(W, "FrameProc");<br>
> +      const FrameProcSym *FrameProc;<br>
> +      error(consumeObject(SymData, FrameProc));<br>
> +      W.printHex("TotalFrameBytes", FrameProc->TotalFrameBytes);<br>
> +      W.printHex("PaddingFrameBytes", FrameProc->PaddingFrameBytes);<br>
> +      W.printHex("OffsetToPadding", FrameProc->OffsetToPadding);<br>
> +      W.printHex("BytesOfCalleeSavedRegisters", FrameProc->BytesOfCalleeSavedRegisters);<br>
> +      W.printHex("OffsetOfExceptionHandler", FrameProc->OffsetOfExceptionHandler);<br>
> +      W.printHex("SectionIdOfExceptionHandler", FrameProc->SectionIdOfExceptionHandler);<br>
> +      W.printFlags("Flags", FrameProc->Flags, makeArrayRef(FrameProcSymFlags));<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_UDT:<br>
> +    case S_COBOLUDT: {<br>
> +      DictScope S(W, "UDT");<br>
> +      const UDTSym *UDT;<br>
> +      error(consumeObject(SymData, UDT));<br>
> +      printTypeIndex("Type", UDT->Type);<br>
> +      StringRef UDTName = SymData.split('\0').first;<br>
> +      W.printString("UDTName", UDTName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_BPREL32: {<br>
> +      DictScope S(W, "BPRelativeSym");<br>
> +      const BPRelativeSym *BPRel;<br>
> +      error(consumeObject(SymData, BPRel));<br>
> +      W.printHex("Offset", BPRel->Offset);<br>
> +      printTypeIndex("Type", BPRel->Type);<br>
> +      StringRef VarName = SymData.split('\0').first;<br>
> +      W.printString("VarName", VarName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_REGREL32: {<br>
> +      DictScope S(W, "RegRelativeSym");<br>
> +      const RegRelativeSym *RegRel;<br>
> +      error(consumeObject(SymData, RegRel));<br>
> +      W.printHex("Offset", RegRel->Offset);<br>
> +      printTypeIndex("Type", RegRel->Type);<br>
> +      W.printHex("Register", RegRel->Register);<br>
> +      StringRef VarName = SymData.split('\0').first;<br>
> +      W.printString("VarName", VarName);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_BUILDINFO: {<br>
> +      DictScope S(W, "BuildInfo");<br>
> +      const BuildInfoSym *BuildInfo;<br>
> +      error(consumeObject(SymData, BuildInfo));<br>
> +      W.printNumber("BuildId", BuildInfo->BuildId);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case S_CONSTANT:<br>
> +    case S_MANCONSTANT: {<br>
> +      DictScope S(W, "Constant");<br>
> +      const ConstantSym *Constant;<br>
> +      error(consumeObject(SymData, Constant));<br>
> +      printTypeIndex("Type", Constant->Type);<br>
> +      APSInt Value;<br>
> +      error(decodeNumerictLeaf(SymData, Value));<br>
> +      W.printNumber("Value", Value);<br>
> +      StringRef Name = SymData.split('\0').first;<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
>      default: {<br>
> -      if (opts::CodeViewSubsectionBytes) {<br>
> -        ListScope S(W, "Record");<br>
> -        W.printHex("Size", Size);<br>
> -        W.printHex("Type", Type);<br>
> +      DictScope S(W, "UnknownSym");<br>
> +      W.printHex("Type", unsigned(Type));<br>
> +      W.printHex("Size", Rec->RecordLength);<br>
> +      W.printBinaryBlock("SymData", SymData);<br>
> +      break;<br>
> +    }<br>
> +    }<br>
> +  }<br>
> +}<br>
> +<br>
> +StringRef getRemainingTypeBytes(const TypeRecord *Rec, const char *Start) {<br>
> +  ptrdiff_t StartOffset = Start - reinterpret_cast<const char *>(Rec);<br>
> +  size_t RecSize = Rec->Len + 2;<br>
> +  assert(StartOffset >= 0 && "negative start-offset!");<br>
> +  assert(static_cast<size_t>(StartOffset) <= RecSize &&<br>
> +         "Start beyond the end of Rec");<br>
> +  return StringRef(Start, RecSize - StartOffset);<br>
> +}<br>
> +<br>
> +StringRef getRemainingBytesAsString(const TypeRecord *Rec, const char *Start) {<br>
> +  StringRef Remaining = getRemainingTypeBytes(Rec, Start);<br>
> +  StringRef Leading, Trailing;<br>
> +  std::tie(Leading, Trailing) = Remaining.split('\0');<br>
> +  return Leading;<br>
> +}<br>
> +<br>
> +StringRef COFFDumper::getTypeName(TypeIndex TI) {<br>
> +  if (TI.isNoType())<br>
> +    return "<no type>";<br>
> +<br>
> +  if (TI.isSimple()) {<br>
> +    // This is a simple type.<br>
> +    for (const auto &SimpleTypeName : SimpleTypeNames) {<br>
> +      if (SimpleTypeName.Value == TI.getSimpleKind()) {<br>
> +        if (TI.getSimpleMode() == SimpleTypeMode::Direct)<br>
> +          return SimpleTypeName.Name.drop_back(1);<br>
> +        // Otherwise, this is a pointer type. We gloss over the distinction<br>
> +        // between near, far, 64, 32, etc, and just give a pointer type.<br>
> +        return SimpleTypeName.Name;<br>
> +      }<br>
> +    }<br>
> +    return "<unknown simple type>";<br>
> +  }<br>
> +<br>
> +  // User-defined type.<br>
> +  StringRef UDTName;<br>
> +  unsigned UDTIndex = TI.getIndex() - 0x1000;<br>
> +  if (UDTIndex < CVUDTNames.size())<br>
> +    return CVUDTNames[UDTIndex];<br>
> +<br>
> +  return "<unknown UDT>";<br>
> +}<br>
> +<br>
> +void COFFDumper::printTypeIndex(StringRef FieldName, TypeIndex TI) {<br>
> +  StringRef TypeName;<br>
> +  if (!TI.isNoType())<br>
> +    TypeName = getTypeName(TI);<br>
> +  if (!TypeName.empty())<br>
> +    W.printHex(FieldName, TypeName, TI.getIndex());<br>
> +  else<br>
> +    W.printHex(FieldName, TI.getIndex());<br>
> +}<br>
> +<br>
> +static StringRef getLeafTypeName(LeafType LT) {<br>
> +  switch (LT) {<br>
> +  case LF_STRING_ID: return "StringId";<br>
> +  case LF_FIELDLIST: return "FieldList";<br>
> +  case LF_ARGLIST:<br>
> +  case LF_SUBSTR_LIST: return "ArgList";<br>
> +  case LF_CLASS:<br>
> +  case LF_STRUCTURE:<br>
> +  case LF_INTERFACE: return "ClassType";<br>
> +  case LF_UNION: return "UnionType";<br>
> +  case LF_ENUM: return "EnumType";<br>
> +  case LF_ARRAY: return "ArrayType";<br>
> +  case LF_VFTABLE: return "VFTableType";<br>
> +  case LF_MFUNC_ID: return "MemberFuncId";<br>
> +  case LF_PROCEDURE: return "ProcedureType";<br>
> +  case LF_MFUNCTION: return "MemberFunctionType";<br>
> +  case LF_METHODLIST: return "MethodListEntry";<br>
> +  case LF_FUNC_ID: return "FuncId";<br>
> +  case LF_TYPESERVER2: return "TypeServer2";<br>
> +  case LF_POINTER: return "PointerType";<br>
> +  case LF_MODIFIER: return "TypeModifier";<br>
> +  case LF_VTSHAPE: return "VTableShape";<br>
> +  case LF_UDT_SRC_LINE: return "UDTSrcLine";<br>
> +  case LF_BUILDINFO: return "BuildInfo";<br>
> +  default: break;<br>
> +  }<br>
> +  return "UnknownLeaf";<br>
> +}<br>
> +<br>
> +void COFFDumper::printCodeViewTypeSection(StringRef SectionName,<br>
> +                                          const SectionRef &Section) {<br>
> +  ListScope D(W, "CodeViewTypes");<br>
> +  W.printNumber("Section", SectionName, Obj->getSectionID(Section));<br>
> +  StringRef Data;<br>
> +  error(Section.getContents(Data));<br>
> +  W.printBinaryBlock("Data", Data);<br>
> +<br>
> +  unsigned Magic = *reinterpret_cast<const ulittle32_t *>(Data.data());<br>
> +  W.printHex("Magic", Magic);<br>
> +<br>
> +  Data = Data.drop_front(4);<br>
> +<br>
> +  while (!Data.empty()) {<br>
> +    const TypeRecord *Rec;<br>
> +    error(consumeObject(Data, Rec));<br>
> +    auto Leaf = static_cast<LeafType>(uint16_t(Rec->Leaf));<br>
> +<br>
> +    // This record is 'Len - 2' bytes, and the next one starts immediately<br>
> +    // afterwards.<br>
> +    StringRef LeafData = Data.substr(0, Rec->Len - 2);<br>
> +    StringRef RemainingData = Data.drop_front(LeafData.size());<br>
> +<br>
> +    // Find the name of this leaf type.<br>
> +    StringRef LeafName = getLeafTypeName(Leaf);<br>
> +    DictScope S(W, LeafName);<br>
> +    unsigned NextTypeIndex = 0x1000 + CVUDTNames.size();<br>
> +    W.printEnum("LeafType", unsigned(Leaf), makeArrayRef(LeafTypeNames));<br>
> +    W.printHex("TypeIndex", NextTypeIndex);<br>
> +<br>
> +    // Fill this in inside the switch to get something in CVUDTNames.<br>
> +    StringRef Name;<br>
> +<br>
> +    switch (Leaf) {<br>
> +    default: {<br>
> +      W.printHex("Size", Rec->Len);<br>
> +      if (opts::CodeViewSubsectionBytes)<br>
> +        W.printBinaryBlock("LeafData", LeafData);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_STRING_ID: {<br>
> +      const StringId *String;<br>
> +      error(consumeObject(LeafData, String));<br>
> +      W.printHex("Id", String->id.getIndex());<br>
> +      StringRef StringData = getRemainingBytesAsString(Rec, LeafData.data());<br>
> +      W.printString("StringData", StringData);<br>
> +      // Put this in CVUDTNames so it gets printed with LF_UDT_SRC_LINE.<br>
> +      Name = StringData;<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_FIELDLIST: {<br>
> +      W.printHex("Size", Rec->Len);<br>
> +      // FieldList has no fixed prefix that can be described with a struct. All<br>
> +      // the bytes must be interpreted as more records.<br>
> +      printCodeViewFieldList(LeafData);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_ARGLIST:<br>
> +    case LF_SUBSTR_LIST: {<br>
> +      const ArgList *Args;<br>
> +      error(consumeObject(LeafData, Args));<br>
> +      W.printNumber("NumArgs", Args->NumArgs);<br>
> +      ListScope Arguments(W, "Arguments");<br>
> +      SmallString<256> TypeName("(");<br>
> +      for (uint32_t ArgI = 0; ArgI != Args->NumArgs; ++ArgI) {<br>
> +        const TypeIndex *Type;<br>
> +        error(consumeObject(LeafData, Type));<br>
> +        printTypeIndex("ArgType", *Type);<br>
> +        StringRef ArgTypeName = getTypeName(*Type);<br>
> +        TypeName.append(ArgTypeName);<br>
> +        if (ArgI + 1 != Args->NumArgs)<br>
> +          TypeName.append(", ");<br>
> +      }<br>
> +      TypeName.push_back(')');<br>
> +      Name = TypeNames.insert(TypeName).first->getKey();<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_CLASS:<br>
> +    case LF_STRUCTURE:<br>
> +    case LF_INTERFACE: {<br>
> +      const ClassType *Class;<br>
> +      error(consumeObject(LeafData, Class));<br>
> +      W.printNumber("MemberCount", Class->MemberCount);<br>
> +      uint16_t Props = Class->Properties;<br>
> +      W.printFlags("Properties", Props, makeArrayRef(ClassOptionNames));<br>
> +      printTypeIndex("FieldList", Class->FieldList);<br>
> +      printTypeIndex("DerivedFrom", Class->DerivedFrom);<br>
> +      printTypeIndex("VShape", Class->VShape);<br>
> +      uint64_t SizeOf;<br>
> +      error(decodeUIntLeaf(LeafData, SizeOf));<br>
> +      W.printNumber("SizeOf", SizeOf);<br>
> +      StringRef LinkageName;<br>
> +      std::tie(Name, LinkageName) = LeafData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      if (Props & uint16_t(ClassOptions::HasUniqueName)) {<br>
> +        LinkageName = getRemainingBytesAsString(Rec, LinkageName.data());<br>
> +        if (LinkageName.empty())<br>
> +          return error(object_error::parse_failed);<br>
> +        W.printString("LinkageName", LinkageName);<br>
> +      }<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_UNION: {<br>
> +      const UnionType *Union;<br>
> +      error(consumeObject(LeafData, Union));<br>
> +      W.printNumber("MemberCount", Union->MemberCount);<br>
> +      uint16_t Props = Union->Properties;<br>
> +      W.printFlags("Properties", Props, makeArrayRef(ClassOptionNames));<br>
> +      printTypeIndex("FieldList", Union->FieldList);<br>
> +      uint64_t SizeOf;<br>
> +      error(decodeUIntLeaf(LeafData, SizeOf));<br>
> +      W.printNumber("SizeOf", SizeOf);<br>
> +      StringRef LinkageName;<br>
> +      std::tie(Name, LinkageName) = LeafData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      if (Props & uint16_t(ClassOptions::HasUniqueName)) {<br>
> +        LinkageName = getRemainingBytesAsString(Rec, LinkageName.data());<br>
> +        if (LinkageName.empty())<br>
> +          return error(object_error::parse_failed);<br>
> +        W.printString("LinkageName", LinkageName);<br>
> +      }<br>
> +      break;<br>
> +    }<br>
><br>
> -        StringRef Contents = DE.getData().substr(Offset, Size);<br>
> -        W.printBinaryBlock("Contents", Contents);<br>
> +    case LF_ENUM: {<br>
> +      const EnumType *Enum;<br>
> +      error(consumeObject(LeafData, Enum));<br>
> +      W.printNumber("NumEnumerators", Enum->NumEnumerators);<br>
> +      W.printFlags("Properties", uint16_t(Enum->Properties),<br>
> +                   makeArrayRef(ClassOptionNames));<br>
> +      printTypeIndex("UnderlyingType", Enum->UnderlyingType);<br>
> +      printTypeIndex("FieldListType", Enum->FieldListType);<br>
> +      Name = LeafData.split('\0').first;<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_ARRAY: {<br>
> +      const ArrayType *AT;<br>
> +      error(consumeObject(LeafData, AT));<br>
> +      printTypeIndex("ElementType", AT->ElementType);<br>
> +      printTypeIndex("IndexType", AT->IndexType);<br>
> +      uint64_t SizeOf;<br>
> +      error(decodeUIntLeaf(LeafData, SizeOf));<br>
> +      W.printNumber("SizeOf", SizeOf);<br>
> +      Name = LeafData.split('\0').first;<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_VFTABLE: {<br>
> +      const VFTableType *VFT;<br>
> +      error(consumeObject(LeafData, VFT));<br>
> +      printTypeIndex("CompleteClass", VFT->CompleteClass);<br>
> +      printTypeIndex("OverriddenVFTable", VFT->OverriddenVFTable);<br>
> +      W.printHex("VFPtrOffset", VFT->VFPtrOffset);<br>
> +      StringRef NamesData = LeafData.substr(0, VFT->NamesLen);<br>
> +      std::tie(Name, NamesData) = NamesData.split('\0');<br>
> +      W.printString("VFTableName", Name);<br>
> +      while (!NamesData.empty()) {<br>
> +        StringRef MethodName;<br>
> +        std::tie(MethodName, NamesData) = NamesData.split('\0');<br>
> +        W.printString("MethodName", MethodName);<br>
> +      }<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_MFUNC_ID: {<br>
> +      const MemberFuncId *Id;<br>
> +      error(consumeObject(LeafData, Id));<br>
> +      printTypeIndex("ClassType", Id->ClassType);<br>
> +      printTypeIndex("FunctionType", Id->FunctionType);<br>
> +      Name = LeafData.split('\0').first;<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_PROCEDURE: {<br>
> +      const ProcedureType *Proc;<br>
> +      error(consumeObject(LeafData, Proc));<br>
> +      printTypeIndex("ReturnType", Proc->ReturnType);<br>
> +      W.printEnum("CallingConvention", uint8_t(Proc->CallConv),<br>
> +                  makeArrayRef(CallingConventions));<br>
> +      W.printFlags("FunctionOptions", uint8_t(Proc->Options),<br>
> +                   makeArrayRef(FunctionOptionEnum));<br>
> +      W.printNumber("NumParameters", Proc->NumParameters);<br>
> +      printTypeIndex("ArgListType", Proc->ArgListType);<br>
> +<br>
> +      StringRef ReturnTypeName = getTypeName(Proc->ReturnType);<br>
> +      StringRef ArgListTypeName = getTypeName(Proc->ArgListType);<br>
> +      SmallString<256> TypeName(ReturnTypeName);<br>
> +      TypeName.push_back(' ');<br>
> +      TypeName.append(ArgListTypeName);<br>
> +      Name = TypeNames.insert(TypeName).first->getKey();<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_MFUNCTION: {<br>
> +      const MemberFunctionType *MemberFunc;<br>
> +      error(consumeObject(LeafData, MemberFunc));<br>
> +      printTypeIndex("ReturnType", MemberFunc->ReturnType);<br>
> +      printTypeIndex("ClassType", MemberFunc->ClassType);<br>
> +      printTypeIndex("ThisType", MemberFunc->ThisType);<br>
> +      W.printEnum("CallingConvention", uint8_t(MemberFunc->CallConv),<br>
> +                  makeArrayRef(CallingConventions));<br>
> +      W.printFlags("FunctionOptions", uint8_t(MemberFunc->Options),<br>
> +                   makeArrayRef(FunctionOptionEnum));<br>
> +      W.printNumber("NumParameters", MemberFunc->NumParameters);<br>
> +      printTypeIndex("ArgListType", MemberFunc->ArgListType);<br>
> +      W.printNumber("ThisAdjustment", MemberFunc->ThisAdjustment);<br>
> +<br>
> +      StringRef ReturnTypeName = getTypeName(MemberFunc->ReturnType);<br>
> +      StringRef ClassTypeName = getTypeName(MemberFunc->ClassType);<br>
> +      StringRef ArgListTypeName = getTypeName(MemberFunc->ArgListType);<br>
> +      SmallString<256> TypeName(ReturnTypeName);<br>
> +      TypeName.push_back(' ');<br>
> +      TypeName.append(ClassTypeName);<br>
> +      TypeName.append("::");<br>
> +      TypeName.append(ArgListTypeName);<br>
> +      Name = TypeNames.insert(TypeName).first->getKey();<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_METHODLIST: {<br>
> +      while (!LeafData.empty()) {<br>
> +        const MethodListEntry *Method;<br>
> +        error(consumeObject(LeafData, Method));<br>
> +        ListScope S(W, "Method");<br>
> +        printMemberAttributes(Method->Attrs);<br>
> +        printTypeIndex("Type", Method->Type);<br>
> +        if (Method->isIntroducedVirtual()) {<br>
> +          const little32_t *VFTOffsetPtr;<br>
> +          error(consumeObject(LeafData, VFTOffsetPtr));<br>
> +          W.printHex("VFTableOffset", *VFTOffsetPtr);<br>
> +        }<br>
> +      }<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_FUNC_ID: {<br>
> +      const FuncId *Func;<br>
> +      error(consumeObject(LeafData, Func));<br>
> +      printTypeIndex("ParentScope", Func->ParentScope);<br>
> +      printTypeIndex("FunctionType", Func->FunctionType);<br>
> +      StringRef Name, Null;<br>
> +      std::tie(Name, Null) = LeafData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_TYPESERVER2: {<br>
> +      const TypeServer2 *TypeServer;<br>
> +      error(consumeObject(LeafData, TypeServer));<br>
> +      W.printBinary("Signature", StringRef(TypeServer->Signature, 16));<br>
> +      W.printNumber("Age", TypeServer->Age);<br>
> +      Name = LeafData.split('\0').first;<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_POINTER: {<br>
> +      const PointerType *Ptr;<br>
> +      error(consumeObject(LeafData, Ptr));<br>
> +      printTypeIndex("PointeeType", Ptr->PointeeType);<br>
> +      W.printHex("PointerAttributes", Ptr->Attrs);<br>
> +      W.printEnum("PtrType", unsigned(Ptr->getPtrKind()),<br>
> +                  makeArrayRef(PtrKindNames));<br>
> +      W.printEnum("PtrMode", unsigned(Ptr->getPtrMode()),<br>
> +                  makeArrayRef(PtrModeNames));<br>
> +      W.printNumber("IsFlat", Ptr->isFlat());<br>
> +      W.printNumber("IsConst", Ptr->isConst());<br>
> +      W.printNumber("IsVolatile", Ptr->isVolatile());<br>
> +      W.printNumber("IsUnaligned", Ptr->isUnaligned());<br>
> +<br>
> +      if (Ptr->isPointerToMember()) {<br>
> +        const PointerToMemberTail *PMT;<br>
> +        error(consumeObject(LeafData, PMT));<br>
> +        printTypeIndex("ClassType", PMT->ClassType);<br>
> +        W.printEnum("Representation", PMT->Representation,<br>
> +                    makeArrayRef(PtrMemberRepNames));<br>
> +<br>
> +        StringRef PointeeName = getTypeName(Ptr->PointeeType);<br>
> +        StringRef ClassName = getTypeName(PMT->ClassType);<br>
> +        SmallString<256> TypeName(PointeeName);<br>
> +        TypeName.push_back(' ');<br>
> +        TypeName.append(ClassName);<br>
> +        TypeName.append("::*");<br>
> +        Name = TypeNames.insert(TypeName).first->getKey();<br>
> +      } else {<br>
> +        W.printBinaryBlock("TailData", LeafData);<br>
> +<br>
> +        SmallString<256> TypeName;<br>
> +        if (Ptr->isConst())<br>
> +          TypeName.append("const ");<br>
> +        if (Ptr->isVolatile())<br>
> +          TypeName.append("volatile ");<br>
> +        if (Ptr->isUnaligned())<br>
> +          TypeName.append("__unaligned ");<br>
> +<br>
> +        TypeName.append(getTypeName(Ptr->PointeeType));<br>
> +<br>
> +        if (Ptr->getPtrMode() == PointerMode::LValueReference)<br>
> +          TypeName.append("&");<br>
> +        else if (Ptr->getPtrMode() == PointerMode::RValueReference)<br>
> +          TypeName.append("&&");<br>
> +        else if (Ptr->getPtrMode() == PointerMode::Pointer)<br>
> +          TypeName.append("*");<br>
> +<br>
> +        Name = TypeNames.insert(TypeName).first->getKey();<br>
>        }<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_MODIFIER: {<br>
> +      const TypeModifier *Mod;<br>
> +      error(consumeObject(LeafData, Mod));<br>
> +      printTypeIndex("ModifiedType", Mod->ModifiedType);<br>
> +      W.printFlags("Modifiers", Mod->Modifiers,<br>
> +                   makeArrayRef(TypeModifierNames));<br>
> +<br>
> +      StringRef ModifiedName = getTypeName(Mod->ModifiedType);<br>
> +      SmallString<256> TypeName;<br>
> +      if (Mod->Modifiers & uint16_t(ModifierOptions::Const))<br>
> +        TypeName.append("const ");<br>
> +      if (Mod->Modifiers & uint16_t(ModifierOptions::Volatile))<br>
> +        TypeName.append("volatile ");<br>
> +      if (Mod->Modifiers & uint16_t(ModifierOptions::Unaligned))<br>
> +        TypeName.append("__unaligned ");<br>
> +      TypeName.append(ModifiedName);<br>
> +      Name = TypeNames.insert(TypeName).first->getKey();<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_VTSHAPE: {<br>
> +      const VTableShape *Shape;<br>
> +      error(consumeObject(LeafData, Shape));<br>
> +      unsigned VFEntryCount = Shape->VFEntryCount;<br>
> +      W.printNumber("VFEntryCount", VFEntryCount);<br>
> +      // We could print out whether the methods are near or far, but in practice<br>
> +      // today everything is CV_VTS_near32, so it's just noise.<br>
> +      break;<br>
> +    }<br>
><br>
> -      Offset += Size;<br>
> +    case LF_UDT_SRC_LINE: {<br>
> +      const UDTSrcLine *Line;<br>
> +      error(consumeObject(LeafData, Line));<br>
> +      printTypeIndex("UDT", Line->UDT);<br>
> +      printTypeIndex("SourceFile", Line->SourceFile);<br>
> +      W.printNumber("LineNumber", Line->LineNumber);<br>
>        break;<br>
>      }<br>
> +<br>
> +    case LF_BUILDINFO: {<br>
> +      const BuildInfo *Args;<br>
> +      error(consumeObject(LeafData, Args));<br>
> +      W.printNumber("NumArgs", Args->NumArgs);<br>
> +<br>
> +      ListScope Arguments(W, "Arguments");<br>
> +      for (uint32_t ArgI = 0; ArgI != Args->NumArgs; ++ArgI) {<br>
> +        const TypeIndex *Type;<br>
> +        error(consumeObject(LeafData, Type));<br>
> +        printTypeIndex("ArgType", *Type);<br>
> +      }<br>
> +      break;<br>
>      }<br>
> +    }<br>
> +<br>
> +    CVUDTNames.push_back(Name);<br>
> +<br>
> +    Data = RemainingData;<br>
> +    // FIXME: The stream contains LF_PAD bytes that we need to ignore, but those<br>
> +    // are typically included in LeafData. We may need to call skipPadding() if<br>
> +    // we ever find a record that doesn't count those bytes.<br>
>    }<br>
> +}<br>
> +<br>
> +static StringRef skipPadding(StringRef Data) {<br>
> +  if (Data.empty())<br>
> +    return Data;<br>
> +  uint8_t Leaf = Data.front();<br>
> +  if (Leaf < LF_PAD0)<br>
> +    return Data;<br>
> +  // Leaf is greater than 0xf0. We should advance by the number of bytes in the<br>
> +  // low 4 bits.<br>
> +  return Data.drop_front(Leaf & 0x0F);<br>
> +}<br>
> +<br>
> +void COFFDumper::printMemberAttributes(MemberAttributes Attrs) {<br>
> +  W.printEnum("AccessSpecifier", uint8_t(Attrs.getAccess()),<br>
> +              makeArrayRef(MemberAccessNames));<br>
> +  auto MK = Attrs.getMethodKind();<br>
> +  // Data members will be vanilla. Don't try to print a method kind for them.<br>
> +  if (MK != MethodKind::Vanilla)<br>
> +    W.printEnum("MethodKind", unsigned(MK), makeArrayRef(MemberKindNames));<br>
> +  if (Attrs.getFlags() != MethodOptions::None) {<br>
> +    W.printFlags("MethodOptions", unsigned(Attrs.getFlags()),<br>
> +                 makeArrayRef(MethodOptionNames));<br>
> +  }<br>
> +}<br>
> +<br>
> +void COFFDumper::printCodeViewFieldList(StringRef FieldData) {<br>
> +  while (!FieldData.empty()) {<br>
> +    const ulittle16_t *LeafPtr;<br>
> +    error(consumeObject(FieldData, LeafPtr));<br>
> +    uint16_t Leaf = *LeafPtr;<br>
> +    switch (Leaf) {<br>
> +    default:<br>
> +      W.printHex("UnknownMember", Leaf);<br>
> +      // We can't advance once we hit an unknown field. The size is not encoded.<br>
> +      return;<br>
> +<br>
> +    case LF_NESTTYPE: {<br>
> +      const NestedType *Nested;<br>
> +      error(consumeObject(FieldData, Nested));<br>
> +      DictScope S(W, "NestedType");<br>
> +      printTypeIndex("Type", Nested->Type);<br>
> +      StringRef Name;<br>
> +      std::tie(Name, FieldData) = FieldData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_ONEMETHOD: {<br>
> +      const OneMethod *Method;<br>
> +      error(consumeObject(FieldData, Method));<br>
> +      DictScope S(W, "OneMethod");<br>
> +      printMemberAttributes(Method->Attrs);<br>
> +      printTypeIndex("Type", Method->Type);<br>
> +      // If virtual, then read the vftable offset.<br>
> +      if (Method->isIntroducedVirtual()) {<br>
> +        const little32_t *VFTOffsetPtr;<br>
> +        error(consumeObject(FieldData, VFTOffsetPtr));<br>
> +        W.printHex("VFTableOffset", *VFTOffsetPtr);<br>
> +      }<br>
> +      StringRef Name;<br>
> +      std::tie(Name, FieldData) = FieldData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_METHOD: {<br>
> +      const OverloadedMethod *Method;<br>
> +      error(consumeObject(FieldData, Method));<br>
> +      DictScope S(W, "OverloadedMethod");<br>
> +      W.printHex("MethodCount", Method->MethodCount);<br>
> +      W.printHex("MethodListIndex", Method->MethList.getIndex());<br>
> +      StringRef Name;<br>
> +      std::tie(Name, FieldData) = FieldData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
><br>
> -  if (InFunctionScope)<br>
> -    error(object_error::parse_failed);<br>
> +    case LF_MEMBER: {<br>
> +      const DataMember *Field;<br>
> +      error(consumeObject(FieldData, Field));<br>
> +      DictScope S(W, "DataMember");<br>
> +      printMemberAttributes(Field->Attrs);<br>
> +      printTypeIndex("Type", Field->Type);<br>
> +      uint64_t FieldOffset;<br>
> +      error(decodeUIntLeaf(FieldData, FieldOffset));<br>
> +      W.printHex("FieldOffset", FieldOffset);<br>
> +      StringRef Name;<br>
> +      std::tie(Name, FieldData) = FieldData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_STMEMBER: {<br>
> +      const StaticDataMember *Field;<br>
> +      error(consumeObject(FieldData, Field));<br>
> +      DictScope S(W, "StaticDataMember");<br>
> +      printMemberAttributes(Field->Attrs);<br>
> +      printTypeIndex("Type", Field->Type);<br>
> +      StringRef Name;<br>
> +      std::tie(Name, FieldData) = FieldData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_VFUNCTAB: {<br>
> +      const VirtualFunctionPointer *VFTable;<br>
> +      error(consumeObject(FieldData, VFTable));<br>
> +      DictScope S(W, "VirtualFunctionPointer");<br>
> +      printTypeIndex("Type", VFTable->Type);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_ENUMERATE: {<br>
> +      const Enumerator *Enum;<br>
> +      error(consumeObject(FieldData, Enum));<br>
> +      DictScope S(W, "Enumerator");<br>
> +      printMemberAttributes(Enum->Attrs);<br>
> +      APSInt EnumValue;<br>
> +      error(decodeNumerictLeaf(FieldData, EnumValue));<br>
> +      W.printNumber("EnumValue", EnumValue);<br>
> +      StringRef Name;<br>
> +      std::tie(Name, FieldData) = FieldData.split('\0');<br>
> +      W.printString("Name", Name);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_BCLASS:<br>
> +    case LF_BINTERFACE: {<br>
> +      const BaseClass *Base;<br>
> +      error(consumeObject(FieldData, Base));<br>
> +      DictScope S(W, "BaseClass");<br>
> +      printMemberAttributes(Base->Attrs);<br>
> +      printTypeIndex("BaseType", Base->BaseType);<br>
> +      uint64_t BaseOffset;<br>
> +      error(decodeUIntLeaf(FieldData, BaseOffset));<br>
> +      W.printHex("BaseOffset", BaseOffset);<br>
> +      break;<br>
> +    }<br>
> +<br>
> +    case LF_VBCLASS:<br>
> +    case LF_IVBCLASS: {<br>
> +      const VirtualBaseClass *Base;<br>
> +      error(consumeObject(FieldData, Base));<br>
> +      DictScope S(W, "VirtualBaseClass");<br>
> +      printMemberAttributes(Base->Attrs);<br>
> +      printTypeIndex("BaseType",  Base->BaseType);<br>
> +      printTypeIndex("VBPtrType", Base->VBPtrType);<br>
> +      uint64_t VBPtrOffset, VBTableIndex;<br>
> +      error(decodeUIntLeaf(FieldData, VBPtrOffset));<br>
> +      error(decodeUIntLeaf(FieldData, VBTableIndex));<br>
> +      W.printHex("VBPtrOffset", VBPtrOffset);<br>
> +      W.printHex("VBTableIndex", VBTableIndex);<br>
> +      break;<br>
> +    }<br>
> +    }<br>
> +<br>
> +    // Handle padding.<br>
> +    FieldData = skipPadding(FieldData);<br>
> +  }<br>
>  }<br>
><br>
>  void COFFDumper::printSections() {<br>
><br>
> Added: llvm/trunk/tools/llvm-readobj/CVLeafTypes.def<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CVLeafTypes.def?rev=257658&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CVLeafTypes.def?rev=257658&view=auto</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-readobj/CVLeafTypes.def (added)<br>
> +++ llvm/trunk/tools/llvm-readobj/CVLeafTypes.def Wed Jan 13 13:32:35 2016<br>
> @@ -0,0 +1,211 @@<br>
> +//===-- CVLeafTypes.def - All CodeView leaf types ---------------*- C++ -*-===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open Source<br>
> +// License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +// See LEAF_ENUM_e in cvinfo.h. This should match the constants there.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +#ifndef LEAF_TYPE<br>
> +#define LEAF_TYPE(ename, value)<br>
> +#endif<br>
> +<br>
> +// 16 bit type records.<br>
> +LEAF_TYPE(LF_MODIFIER_16t, 0x0001)<br>
> +LEAF_TYPE(LF_POINTER_16t, 0x0002)<br>
> +LEAF_TYPE(LF_ARRAY_16t, 0x0003)<br>
> +LEAF_TYPE(LF_CLASS_16t, 0x0004)<br>
> +LEAF_TYPE(LF_STRUCTURE_16t, 0x0005)<br>
> +LEAF_TYPE(LF_UNION_16t, 0x0006)<br>
> +LEAF_TYPE(LF_ENUM_16t, 0x0007)<br>
> +LEAF_TYPE(LF_PROCEDURE_16t, 0x0008)<br>
> +LEAF_TYPE(LF_MFUNCTION_16t, 0x0009)<br>
> +LEAF_TYPE(LF_VTSHAPE, 0x000a)<br>
> +LEAF_TYPE(LF_COBOL0_16t, 0x000b)<br>
> +LEAF_TYPE(LF_COBOL1, 0x000c)<br>
> +LEAF_TYPE(LF_BARRAY_16t, 0x000d)<br>
> +LEAF_TYPE(LF_LABEL, 0x000e)<br>
> +LEAF_TYPE(LF_NULLLEAF, 0x000f) // LF_NULL<br>
> +LEAF_TYPE(LF_NOTTRAN, 0x0010)<br>
> +LEAF_TYPE(LF_DIMARRAY_16t, 0x0011)<br>
> +LEAF_TYPE(LF_VFTPATH_16t, 0x0012)<br>
> +LEAF_TYPE(LF_PRECOMP_16t, 0x0013)<br>
> +LEAF_TYPE(LF_ENDPRECOMP, 0x0014)<br>
> +LEAF_TYPE(LF_OEM_16t, 0x0015)<br>
> +LEAF_TYPE(LF_TYPESERVER_ST, 0x0016)<br>
> +<br>
> +LEAF_TYPE(LF_SKIP_16t, 0x0200)<br>
> +LEAF_TYPE(LF_ARGLIST_16t, 0x0201)<br>
> +LEAF_TYPE(LF_DEFARG_16t, 0x0202)<br>
> +LEAF_TYPE(LF_LIST, 0x0203)<br>
> +LEAF_TYPE(LF_FIELDLIST_16t, 0x0204)<br>
> +LEAF_TYPE(LF_DERIVED_16t, 0x0205)<br>
> +LEAF_TYPE(LF_BITFIELD_16t, 0x0206)<br>
> +LEAF_TYPE(LF_METHODLIST_16t, 0x0207)<br>
> +LEAF_TYPE(LF_DIMCONU_16t, 0x0208)<br>
> +LEAF_TYPE(LF_DIMCONLU_16t, 0x0209)<br>
> +LEAF_TYPE(LF_DIMVARU_16t, 0x020a)<br>
> +LEAF_TYPE(LF_DIMVARLU_16t, 0x020b)<br>
> +LEAF_TYPE(LF_REFSYM, 0x020c)<br>
> +<br>
> +// 16 bit member types. Generally not length prefixed.<br>
> +LEAF_TYPE(LF_BCLASS_16t, 0x0400)<br>
> +LEAF_TYPE(LF_VBCLASS_16t, 0x0401)<br>
> +LEAF_TYPE(LF_IVBCLASS_16t, 0x0402)<br>
> +LEAF_TYPE(LF_ENUMERATE_ST, 0x0403)<br>
> +LEAF_TYPE(LF_FRIENDFCN_16t, 0x0404)<br>
> +LEAF_TYPE(LF_INDEX_16t, 0x0405)<br>
> +LEAF_TYPE(LF_MEMBER_16t, 0x0406)<br>
> +LEAF_TYPE(LF_STMEMBER_16t, 0x0407)<br>
> +LEAF_TYPE(LF_METHOD_16t, 0x0408)<br>
> +LEAF_TYPE(LF_NESTTYPE_16t, 0x0409)<br>
> +LEAF_TYPE(LF_VFUNCTAB_16t, 0x040a)<br>
> +LEAF_TYPE(LF_FRIENDCLS_16t, 0x040b)<br>
> +LEAF_TYPE(LF_ONEMETHOD_16t, 0x040c)<br>
> +LEAF_TYPE(LF_VFUNCOFF_16t, 0x040d)<br>
> +<br>
> +LEAF_TYPE(LF_TI16_MAX, 0x1000)<br>
> +<br>
> +LEAF_TYPE(LF_MODIFIER, 0x1001)<br>
> +LEAF_TYPE(LF_POINTER, 0x1002)<br>
> +LEAF_TYPE(LF_ARRAY_ST, 0x1003)<br>
> +LEAF_TYPE(LF_CLASS_ST, 0x1004)<br>
> +LEAF_TYPE(LF_STRUCTURE_ST, 0x1005)<br>
> +LEAF_TYPE(LF_UNION_ST, 0x1006)<br>
> +LEAF_TYPE(LF_ENUM_ST, 0x1007)<br>
> +LEAF_TYPE(LF_PROCEDURE, 0x1008)<br>
> +LEAF_TYPE(LF_MFUNCTION, 0x1009)<br>
> +LEAF_TYPE(LF_COBOL0, 0x100a)<br>
> +LEAF_TYPE(LF_BARRAY, 0x100b)<br>
> +LEAF_TYPE(LF_DIMARRAY_ST, 0x100c)<br>
> +LEAF_TYPE(LF_VFTPATH, 0x100d)<br>
> +LEAF_TYPE(LF_PRECOMP_ST, 0x100e)<br>
> +LEAF_TYPE(LF_OEM, 0x100f)<br>
> +LEAF_TYPE(LF_ALIAS_ST, 0x1010)<br>
> +LEAF_TYPE(LF_OEM2, 0x1011)<br>
> +<br>
> +LEAF_TYPE(LF_SKIP, 0x1200)<br>
> +LEAF_TYPE(LF_ARGLIST, 0x1201)<br>
> +LEAF_TYPE(LF_DEFARG_ST, 0x1202)<br>
> +LEAF_TYPE(LF_FIELDLIST, 0x1203)<br>
> +LEAF_TYPE(LF_DERIVED, 0x1204)<br>
> +LEAF_TYPE(LF_BITFIELD, 0x1205)<br>
> +LEAF_TYPE(LF_METHODLIST, 0x1206)<br>
> +LEAF_TYPE(LF_DIMCONU, 0x1207)<br>
> +LEAF_TYPE(LF_DIMCONLU, 0x1208)<br>
> +LEAF_TYPE(LF_DIMVARU, 0x1209)<br>
> +LEAF_TYPE(LF_DIMVARLU, 0x120a)<br>
> +<br>
> +// Member type records. These are generally not length prefixed, and appear<br>
> +// inside of a field list record.<br>
> +LEAF_TYPE(LF_BCLASS, 0x1400)<br>
> +LEAF_TYPE(LF_VBCLASS, 0x1401)<br>
> +LEAF_TYPE(LF_IVBCLASS, 0x1402)<br>
> +LEAF_TYPE(LF_FRIENDFCN_ST, 0x1403)<br>
> +LEAF_TYPE(LF_INDEX, 0x1404)<br>
> +LEAF_TYPE(LF_MEMBER_ST, 0x1405)<br>
> +LEAF_TYPE(LF_STMEMBER_ST, 0x1406)<br>
> +LEAF_TYPE(LF_METHOD_ST, 0x1407)<br>
> +LEAF_TYPE(LF_NESTTYPE_ST, 0x1408)<br>
> +LEAF_TYPE(LF_VFUNCTAB, 0x1409)<br>
> +LEAF_TYPE(LF_FRIENDCLS, 0x140a)<br>
> +LEAF_TYPE(LF_ONEMETHOD_ST, 0x140b)<br>
> +LEAF_TYPE(LF_VFUNCOFF, 0x140c)<br>
> +LEAF_TYPE(LF_NESTTYPEEX_ST, 0x140d)<br>
> +LEAF_TYPE(LF_MEMBERMODIFY_ST, 0x140e)<br>
> +LEAF_TYPE(LF_MANAGED_ST, 0x140f)<br>
> +<br>
> +LEAF_TYPE(LF_ST_MAX, 0x1500)<br>
> +LEAF_TYPE(LF_TYPESERVER, 0x1501)<br>
> +LEAF_TYPE(LF_ENUMERATE, 0x1502)<br>
> +LEAF_TYPE(LF_ARRAY, 0x1503)<br>
> +LEAF_TYPE(LF_CLASS, 0x1504)<br>
> +LEAF_TYPE(LF_STRUCTURE, 0x1505)<br>
> +LEAF_TYPE(LF_UNION, 0x1506)<br>
> +LEAF_TYPE(LF_ENUM, 0x1507)<br>
> +LEAF_TYPE(LF_DIMARRAY, 0x1508)<br>
> +LEAF_TYPE(LF_PRECOMP, 0x1509)<br>
> +LEAF_TYPE(LF_ALIAS, 0x150a)<br>
> +LEAF_TYPE(LF_DEFARG, 0x150b)<br>
> +LEAF_TYPE(LF_FRIENDFCN, 0x150c)<br>
> +LEAF_TYPE(LF_MEMBER, 0x150d)<br>
> +LEAF_TYPE(LF_STMEMBER, 0x150e)<br>
> +LEAF_TYPE(LF_METHOD, 0x150f)<br>
> +LEAF_TYPE(LF_NESTTYPE, 0x1510)<br>
> +LEAF_TYPE(LF_ONEMETHOD, 0x1511)<br>
> +LEAF_TYPE(LF_NESTTYPEEX, 0x1512)<br>
> +LEAF_TYPE(LF_MEMBERMODIFY, 0x1513)<br>
> +LEAF_TYPE(LF_MANAGED, 0x1514)<br>
> +LEAF_TYPE(LF_TYPESERVER2, 0x1515)<br>
> +LEAF_TYPE(LF_STRIDED_ARRAY, 0x1516)<br>
> +LEAF_TYPE(LF_HLSL, 0x1517)<br>
> +LEAF_TYPE(LF_MODIFIER_EX, 0x1518)<br>
> +LEAF_TYPE(LF_INTERFACE, 0x1519)<br>
> +LEAF_TYPE(LF_BINTERFACE, 0x151a)<br>
> +LEAF_TYPE(LF_VECTOR, 0x151b)<br>
> +LEAF_TYPE(LF_MATRIX, 0x151c)<br>
> +LEAF_TYPE(LF_VFTABLE, 0x151d)<br>
> +<br>
> +// ID leaf records. Subsequent leaf types may be referenced from .debug$S.<br>
> +<br>
> +LEAF_TYPE(LF_FUNC_ID, 0x1601)<br>
> +LEAF_TYPE(LF_MFUNC_ID, 0x1602)<br>
> +LEAF_TYPE(LF_BUILDINFO, 0x1603)<br>
> +LEAF_TYPE(LF_SUBSTR_LIST, 0x1604)<br>
> +LEAF_TYPE(LF_STRING_ID, 0x1605)<br>
> +LEAF_TYPE(LF_UDT_SRC_LINE, 0x1606)<br>
> +LEAF_TYPE(LF_UDT_MOD_SRC_LINE, 0x1607)<br>
> +<br>
> +// Numeric leaf types. These are generally contained in other records, and not<br>
> +// encountered in the main type stream.<br>
> +<br>
> +LEAF_TYPE(LF_NUMERIC, 0x8000)<br>
> +LEAF_TYPE(LF_CHAR, 0x8000)<br>
> +LEAF_TYPE(LF_SHORT, 0x8001)<br>
> +LEAF_TYPE(LF_USHORT, 0x8002)<br>
> +LEAF_TYPE(LF_LONG, 0x8003)<br>
> +LEAF_TYPE(LF_ULONG, 0x8004)<br>
> +LEAF_TYPE(LF_REAL32, 0x8005)<br>
> +LEAF_TYPE(LF_REAL64, 0x8006)<br>
> +LEAF_TYPE(LF_REAL80, 0x8007)<br>
> +LEAF_TYPE(LF_REAL128, 0x8008)<br>
> +LEAF_TYPE(LF_QUADWORD, 0x8009)<br>
> +LEAF_TYPE(LF_UQUADWORD, 0x800a)<br>
> +LEAF_TYPE(LF_REAL48, 0x800b)<br>
> +LEAF_TYPE(LF_COMPLEX32, 0x800c)<br>
> +LEAF_TYPE(LF_COMPLEX64, 0x800d)<br>
> +LEAF_TYPE(LF_COMPLEX80, 0x800e)<br>
> +LEAF_TYPE(LF_COMPLEX128, 0x800f)<br>
> +LEAF_TYPE(LF_VARSTRING, 0x8010)<br>
> +LEAF_TYPE(LF_OCTWORD, 0x8017)<br>
> +LEAF_TYPE(LF_UOCTWORD, 0x8018)<br>
> +LEAF_TYPE(LF_DECIMAL, 0x8019)<br>
> +LEAF_TYPE(LF_DATE, 0x801a)<br>
> +LEAF_TYPE(LF_UTF8STRING, 0x801b)<br>
> +LEAF_TYPE(LF_REAL16, 0x801c)<br>
> +<br>
> +// Padding bytes. These are emitted into alignment bytes in the type stream.<br>
> +<br>
> +LEAF_TYPE(LF_PAD0, 0xf0)<br>
> +LEAF_TYPE(LF_PAD1, 0xf1)<br>
> +LEAF_TYPE(LF_PAD2, 0xf2)<br>
> +LEAF_TYPE(LF_PAD3, 0xf3)<br>
> +LEAF_TYPE(LF_PAD4, 0xf4)<br>
> +LEAF_TYPE(LF_PAD5, 0xf5)<br>
> +LEAF_TYPE(LF_PAD6, 0xf6)<br>
> +LEAF_TYPE(LF_PAD7, 0xf7)<br>
> +LEAF_TYPE(LF_PAD8, 0xf8)<br>
> +LEAF_TYPE(LF_PAD9, 0xf9)<br>
> +LEAF_TYPE(LF_PAD10, 0xfa)<br>
> +LEAF_TYPE(LF_PAD11, 0xfb)<br>
> +LEAF_TYPE(LF_PAD12, 0xfc)<br>
> +LEAF_TYPE(LF_PAD13, 0xfd)<br>
> +LEAF_TYPE(LF_PAD14, 0xfe)<br>
> +LEAF_TYPE(LF_PAD15, 0xff)<br>
> +<br>
> +#undef LEAF_TYPE<br>
><br>
> Added: llvm/trunk/tools/llvm-readobj/CVSymbolTypes.def<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CVSymbolTypes.def?rev=257658&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CVSymbolTypes.def?rev=257658&view=auto</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-readobj/CVSymbolTypes.def (added)<br>
> +++ llvm/trunk/tools/llvm-readobj/CVSymbolTypes.def Wed Jan 13 13:32:35 2016<br>
> @@ -0,0 +1,237 @@<br>
> +//===-- CVLeafTypes.def - All CodeView leaf types ---------------*- C++ -*-===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open Source<br>
> +// License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +//<br>
> +// See LEAF_ENUM_e in cvinfo.h. This should match the constants there.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +#ifndef SYMBOL_TYPE<br>
> +#define SYMBOL_TYPE(ename, value)<br>
> +#endif<br>
> +<br>
> +// 16 bit symbol types. Not very useful, provided only for reference.<br>
> +SYMBOL_TYPE(S_COMPILE       , 0x0001)<br>
> +SYMBOL_TYPE(S_REGISTER_16t  , 0x0002)<br>
> +SYMBOL_TYPE(S_CONSTANT_16t  , 0x0003)<br>
> +SYMBOL_TYPE(S_UDT_16t       , 0x0004)<br>
> +SYMBOL_TYPE(S_SSEARCH       , 0x0005)<br>
> +SYMBOL_TYPE(S_END           , 0x0006)<br>
> +SYMBOL_TYPE(S_SKIP          , 0x0007)<br>
> +SYMBOL_TYPE(S_CVRESERVE     , 0x0008)<br>
> +SYMBOL_TYPE(S_OBJNAME_ST    , 0x0009)<br>
> +SYMBOL_TYPE(S_ENDARG        , 0x000a)<br>
> +SYMBOL_TYPE(S_COBOLUDT_16t  , 0x000b)<br>
> +SYMBOL_TYPE(S_MANYREG_16t   , 0x000c)<br>
> +SYMBOL_TYPE(S_RETURN        , 0x000d)<br>
> +SYMBOL_TYPE(S_ENTRYTHIS     , 0x000e)<br>
> +SYMBOL_TYPE(S_BPREL16       , 0x0100)<br>
> +SYMBOL_TYPE(S_LDATA16       , 0x0101)<br>
> +SYMBOL_TYPE(S_GDATA16       , 0x0102)<br>
> +SYMBOL_TYPE(S_PUB16         , 0x0103)<br>
> +SYMBOL_TYPE(S_LPROC16       , 0x0104)<br>
> +SYMBOL_TYPE(S_GPROC16       , 0x0105)<br>
> +SYMBOL_TYPE(S_THUNK16       , 0x0106)<br>
> +SYMBOL_TYPE(S_BLOCK16       , 0x0107)<br>
> +SYMBOL_TYPE(S_WITH16        , 0x0108)<br>
> +SYMBOL_TYPE(S_LABEL16       , 0x0109)<br>
> +SYMBOL_TYPE(S_CEXMODEL16    , 0x010a)<br>
> +SYMBOL_TYPE(S_VFTABLE16     , 0x010b)<br>
> +SYMBOL_TYPE(S_REGREL16      , 0x010c)<br>
> +SYMBOL_TYPE(S_BPREL32_16t   , 0x0200)<br>
> +SYMBOL_TYPE(S_LDATA32_16t   , 0x0201)<br>
> +SYMBOL_TYPE(S_GDATA32_16t   , 0x0202)<br>
> +SYMBOL_TYPE(S_PUB32_16t     , 0x0203)<br>
> +SYMBOL_TYPE(S_LPROC32_16t   , 0x0204)<br>
> +SYMBOL_TYPE(S_GPROC32_16t   , 0x0205)<br>
> +SYMBOL_TYPE(S_THUNK32_ST    , 0x0206)<br>
> +SYMBOL_TYPE(S_BLOCK32_ST    , 0x0207)<br>
> +SYMBOL_TYPE(S_WITH32_ST     , 0x0208)<br>
> +SYMBOL_TYPE(S_LABEL32_ST    , 0x0209)<br>
> +SYMBOL_TYPE(S_CEXMODEL32    , 0x020a)<br>
> +SYMBOL_TYPE(S_VFTABLE32_16t , 0x020b)<br>
> +SYMBOL_TYPE(S_REGREL32_16t  , 0x020c)<br>
> +SYMBOL_TYPE(S_LTHREAD32_16t , 0x020d)<br>
> +SYMBOL_TYPE(S_GTHREAD32_16t , 0x020e)<br>
> +SYMBOL_TYPE(S_SLINK32       , 0x020f)<br>
> +SYMBOL_TYPE(S_LPROCMIPS_16t , 0x0300)<br>
> +SYMBOL_TYPE(S_GPROCMIPS_16t , 0x0301)<br>
> +SYMBOL_TYPE(S_PROCREF_ST    , 0x0400)<br>
> +SYMBOL_TYPE(S_DATAREF_ST    , 0x0401)<br>
> +SYMBOL_TYPE(S_ALIGN         , 0x0402)<br>
> +SYMBOL_TYPE(S_LPROCREF_ST   , 0x0403)<br>
> +SYMBOL_TYPE(S_OEM           , 0x0404)<br>
> +<br>
> +// All post 16 bit symbol types have the 0x1000 bit set.<br>
> +SYMBOL_TYPE(S_TI16_MAX      , 0x1000)<br>
> +<br>
> +// Mostly unused "start" symbol types.<br>
> +SYMBOL_TYPE(S_REGISTER_ST   , 0x1001)<br>
> +SYMBOL_TYPE(S_CONSTANT_ST   , 0x1002)<br>
> +SYMBOL_TYPE(S_UDT_ST        , 0x1003)<br>
> +SYMBOL_TYPE(S_COBOLUDT_ST   , 0x1004)<br>
> +SYMBOL_TYPE(S_MANYREG_ST    , 0x1005)<br>
> +SYMBOL_TYPE(S_BPREL32_ST    , 0x1006)<br>
> +SYMBOL_TYPE(S_LDATA32_ST    , 0x1007)<br>
> +SYMBOL_TYPE(S_GDATA32_ST    , 0x1008)<br>
> +SYMBOL_TYPE(S_PUB32_ST      , 0x1009)<br>
> +SYMBOL_TYPE(S_LPROC32_ST    , 0x100a)<br>
> +SYMBOL_TYPE(S_GPROC32_ST    , 0x100b)<br>
> +SYMBOL_TYPE(S_VFTABLE32     , 0x100c)<br>
> +SYMBOL_TYPE(S_REGREL32_ST   , 0x100d)<br>
> +SYMBOL_TYPE(S_LTHREAD32_ST  , 0x100e)<br>
> +SYMBOL_TYPE(S_GTHREAD32_ST  , 0x100f)<br>
> +SYMBOL_TYPE(S_LPROCMIPS_ST  , 0x1010)<br>
> +SYMBOL_TYPE(S_GPROCMIPS_ST  , 0x1011)<br>
> +<br>
> +// Information about the frame layout of a procedure.<br>
> +SYMBOL_TYPE(S_FRAMEPROC     , 0x1012)<br>
> +<br>
> +SYMBOL_TYPE(S_COMPILE2_ST   , 0x1013)<br>
> +SYMBOL_TYPE(S_MANYREG2_ST   , 0x1014)<br>
> +SYMBOL_TYPE(S_LPROCIA64_ST  , 0x1015)<br>
> +SYMBOL_TYPE(S_GPROCIA64_ST  , 0x1016)<br>
> +SYMBOL_TYPE(S_LOCALSLOT_ST  , 0x1017)<br>
> +SYMBOL_TYPE(S_PARAMSLOT_ST  , 0x1018)<br>
> +SYMBOL_TYPE(S_ANNOTATION    , 0x1019)<br>
> +SYMBOL_TYPE(S_GMANPROC_ST   , 0x101a)<br>
> +SYMBOL_TYPE(S_LMANPROC_ST   , 0x101b)<br>
> +SYMBOL_TYPE(S_RESERVED1     , 0x101c)<br>
> +SYMBOL_TYPE(S_RESERVED2     , 0x101d)<br>
> +SYMBOL_TYPE(S_RESERVED3     , 0x101e)<br>
> +SYMBOL_TYPE(S_RESERVED4     , 0x101f)<br>
> +SYMBOL_TYPE(S_LMANDATA_ST   , 0x1020)<br>
> +SYMBOL_TYPE(S_GMANDATA_ST   , 0x1021)<br>
> +SYMBOL_TYPE(S_MANFRAMEREL_ST, 0x1022)<br>
> +SYMBOL_TYPE(S_MANREGISTER_ST, 0x1023)<br>
> +SYMBOL_TYPE(S_MANSLOT_ST    , 0x1024)<br>
> +SYMBOL_TYPE(S_MANMANYREG_ST , 0x1025)<br>
> +SYMBOL_TYPE(S_MANREGREL_ST  , 0x1026)<br>
> +SYMBOL_TYPE(S_MANMANYREG2_ST, 0x1027)<br>
> +SYMBOL_TYPE(S_MANTYPREF     , 0x1028)<br>
> +SYMBOL_TYPE(S_UNAMESPACE_ST , 0x1029)<br>
> +<br>
> +// End of S_*_ST symbols, which do not appear to be generated by modern<br>
> +// compilers.<br>
> +SYMBOL_TYPE(S_ST_MAX        , 0x1100)<br>
> +<br>
> +SYMBOL_TYPE(S_OBJNAME       , 0x1101)<br>
> +SYMBOL_TYPE(S_THUNK32       , 0x1102)<br>
> +SYMBOL_TYPE(S_BLOCK32       , 0x1103)<br>
> +SYMBOL_TYPE(S_WITH32        , 0x1104)<br>
> +SYMBOL_TYPE(S_LABEL32       , 0x1105)<br>
> +SYMBOL_TYPE(S_REGISTER      , 0x1106)<br>
> +SYMBOL_TYPE(S_CONSTANT      , 0x1107)<br>
> +SYMBOL_TYPE(S_UDT           , 0x1108)<br>
> +SYMBOL_TYPE(S_COBOLUDT      , 0x1109)<br>
> +SYMBOL_TYPE(S_MANYREG       , 0x110a)<br>
> +SYMBOL_TYPE(S_BPREL32       , 0x110b)<br>
> +SYMBOL_TYPE(S_LDATA32       , 0x110c)<br>
> +SYMBOL_TYPE(S_GDATA32       , 0x110d)<br>
> +SYMBOL_TYPE(S_PUB32         , 0x110e)<br>
> +SYMBOL_TYPE(S_LPROC32       , 0x110f)<br>
> +SYMBOL_TYPE(S_GPROC32       , 0x1110)<br>
> +SYMBOL_TYPE(S_REGREL32      , 0x1111)<br>
> +SYMBOL_TYPE(S_LTHREAD32     , 0x1112)<br>
> +SYMBOL_TYPE(S_GTHREAD32     , 0x1113)<br>
> +SYMBOL_TYPE(S_LPROCMIPS     , 0x1114)<br>
> +SYMBOL_TYPE(S_GPROCMIPS     , 0x1115)<br>
> +SYMBOL_TYPE(S_COMPILE2      , 0x1116)<br>
> +SYMBOL_TYPE(S_MANYREG2      , 0x1117)<br>
> +SYMBOL_TYPE(S_LPROCIA64     , 0x1118)<br>
> +SYMBOL_TYPE(S_GPROCIA64     , 0x1119)<br>
> +SYMBOL_TYPE(S_LOCALSLOT     , 0x111a)<br>
> +SYMBOL_TYPE(S_PARAMSLOT     , 0x111b)<br>
> +<br>
> +// Managed code symbols.<br>
> +SYMBOL_TYPE(S_LMANDATA      , 0x111c)<br>
> +SYMBOL_TYPE(S_GMANDATA      , 0x111d)<br>
> +SYMBOL_TYPE(S_MANFRAMEREL   , 0x111e)<br>
> +SYMBOL_TYPE(S_MANREGISTER   , 0x111f)<br>
> +SYMBOL_TYPE(S_MANSLOT       , 0x1120)<br>
> +SYMBOL_TYPE(S_MANMANYREG    , 0x1121)<br>
> +SYMBOL_TYPE(S_MANREGREL     , 0x1122)<br>
> +SYMBOL_TYPE(S_MANMANYREG2   , 0x1123)<br>
> +SYMBOL_TYPE(S_UNAMESPACE    , 0x1124)<br>
> +SYMBOL_TYPE(S_PROCREF       , 0x1125)<br>
> +SYMBOL_TYPE(S_DATAREF       , 0x1126)<br>
> +SYMBOL_TYPE(S_LPROCREF      , 0x1127)<br>
> +SYMBOL_TYPE(S_ANNOTATIONREF , 0x1128)<br>
> +SYMBOL_TYPE(S_TOKENREF      , 0x1129)<br>
> +SYMBOL_TYPE(S_GMANPROC      , 0x112a)<br>
> +SYMBOL_TYPE(S_LMANPROC      , 0x112b)<br>
> +SYMBOL_TYPE(S_TRAMPOLINE    , 0x112c)<br>
> +SYMBOL_TYPE(S_MANCONSTANT   , 0x112d)<br>
> +SYMBOL_TYPE(S_ATTR_FRAMEREL , 0x112e)<br>
> +SYMBOL_TYPE(S_ATTR_REGISTER , 0x112f)<br>
> +SYMBOL_TYPE(S_ATTR_REGREL   , 0x1130)<br>
> +SYMBOL_TYPE(S_ATTR_MANYREG  , 0x1131)<br>
> +<br>
> +<br>
> +SYMBOL_TYPE(S_SEPCODE       , 0x1132)<br>
> +SYMBOL_TYPE(S_LOCAL_2005    , 0x1133)<br>
> +SYMBOL_TYPE(S_DEFRANGE_2005 , 0x1134)<br>
> +SYMBOL_TYPE(S_DEFRANGE2_2005, 0x1135)<br>
> +SYMBOL_TYPE(S_SECTION       , 0x1136)<br>
> +SYMBOL_TYPE(S_COFFGROUP     , 0x1137)<br>
> +SYMBOL_TYPE(S_EXPORT        , 0x1138)<br>
> +SYMBOL_TYPE(S_CALLSITEINFO  , 0x1139)<br>
> +SYMBOL_TYPE(S_FRAMECOOKIE   , 0x113a)<br>
> +SYMBOL_TYPE(S_DISCARDED     , 0x113b)<br>
> +SYMBOL_TYPE(S_COMPILE3      , 0x113c)<br>
> +SYMBOL_TYPE(S_ENVBLOCK      , 0x113d)<br>
> +SYMBOL_TYPE(S_LOCAL         , 0x113e)<br>
> +SYMBOL_TYPE(S_DEFRANGE      , 0x113f)<br>
> +SYMBOL_TYPE(S_DEFRANGE_SUBFIELD, 0x1140)<br>
> +SYMBOL_TYPE(S_DEFRANGE_REGISTER, 0x1141)<br>
> +SYMBOL_TYPE(S_DEFRANGE_FRAMEPOINTER_REL, 0x1142)<br>
> +SYMBOL_TYPE(S_DEFRANGE_SUBFIELD_REGISTER, 0x1143)<br>
> +SYMBOL_TYPE(S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE, 0x1144)<br>
> +SYMBOL_TYPE(S_DEFRANGE_REGISTER_REL, 0x1145)<br>
> +<br>
> +// Current symbol types for most procedures as of this writing.<br>
> +SYMBOL_TYPE(S_LPROC32_ID     , 0x1146)<br>
> +SYMBOL_TYPE(S_GPROC32_ID     , 0x1147)<br>
> +SYMBOL_TYPE(S_LPROCMIPS_ID   , 0x1148)<br>
> +SYMBOL_TYPE(S_GPROCMIPS_ID   , 0x1149)<br>
> +SYMBOL_TYPE(S_LPROCIA64_ID   , 0x114a)<br>
> +SYMBOL_TYPE(S_GPROCIA64_ID   , 0x114b)<br>
> +<br>
> +SYMBOL_TYPE(S_BUILDINFO      , 0x114c)<br>
> +<br>
> +// Inlined call site delimiters.<br>
> +SYMBOL_TYPE(S_INLINESITE     , 0x114d)<br>
> +SYMBOL_TYPE(S_INLINESITE_END , 0x114e)<br>
> +<br>
> +// Procedure info end delimiter.<br>
> +SYMBOL_TYPE(S_PROC_ID_END    , 0x114f)<br>
> +<br>
> +SYMBOL_TYPE(S_DEFRANGE_HLSL  , 0x1150)<br>
> +SYMBOL_TYPE(S_GDATA_HLSL     , 0x1151)<br>
> +SYMBOL_TYPE(S_LDATA_HLSL     , 0x1152)<br>
> +SYMBOL_TYPE(S_FILESTATIC     , 0x1153)<br>
> +SYMBOL_TYPE(S_LOCAL_DPC_GROUPSHARED, 0x1154)<br>
> +SYMBOL_TYPE(S_LPROC32_DPC    , 0x1155)<br>
> +SYMBOL_TYPE(S_LPROC32_DPC_ID , 0x1156)<br>
> +SYMBOL_TYPE(S_DEFRANGE_DPC_PTR_TAG, 0x1157)<br>
> +SYMBOL_TYPE(S_DPC_SYM_TAG_MAP, 0x1158)<br>
> +SYMBOL_TYPE(S_ARMSWITCHTABLE , 0x1159)<br>
> +SYMBOL_TYPE(S_CALLEES        , 0x115a)<br>
> +SYMBOL_TYPE(S_CALLERS        , 0x115b)<br>
> +SYMBOL_TYPE(S_POGODATA       , 0x115c)<br>
> +SYMBOL_TYPE(S_INLINESITE2    , 0x115d)<br>
> +SYMBOL_TYPE(S_HEAPALLOCSITE  , 0x115e)<br>
> +SYMBOL_TYPE(S_MOD_TYPEREF    , 0x115f)<br>
> +SYMBOL_TYPE(S_REF_MINIPDB    , 0x1160)<br>
> +SYMBOL_TYPE(S_PDBMAP         , 0x1161)<br>
> +SYMBOL_TYPE(S_GDATA_HLSL32   , 0x1162)<br>
> +SYMBOL_TYPE(S_LDATA_HLSL32   , 0x1163)<br>
> +SYMBOL_TYPE(S_GDATA_HLSL32_EX, 0x1164)<br>
> +SYMBOL_TYPE(S_LDATA_HLSL32_EX, 0x1165)<br>
> +<br>
> +#undef SYMBOL_TYPE<br>
><br>
> Added: llvm/trunk/tools/llvm-readobj/CodeView.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CodeView.h?rev=257658&view=auto" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/CodeView.h?rev=257658&view=auto</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-readobj/CodeView.h (added)<br>
> +++ llvm/trunk/tools/llvm-readobj/CodeView.h Wed Jan 13 13:32:35 2016<br>
> @@ -0,0 +1,571 @@<br>
> +//===-- CodeView.h - On-disk record types for CodeView ----------*- C++ -*-===//<br>
> +//<br>
> +//                     The LLVM Compiler Infrastructure<br>
> +//<br>
> +// This file is distributed under the University of Illinois Open Source<br>
> +// License. See LICENSE.TXT for details.<br>
> +//<br>
> +//===----------------------------------------------------------------------===//<br>
> +///<br>
> +/// \file<br>
> +/// \brief This file provides data structures useful for consuming on-disk<br>
> +/// CodeView. It is based on information published by Microsoft at<br>
> +/// <a href="https://github.com/Microsoft/microsoft-pdb/" target="_blank">https://github.com/Microsoft/microsoft-pdb/</a>.<br>
> +///<br>
> +//===----------------------------------------------------------------------===//<br>
> +<br>
> +// FIXME: Find a home for this in include/llvm/DebugInfo/CodeView/.<br>
> +<br>
> +#ifndef LLVM_READOBJ_CODEVIEW_H<br>
> +#define LLVM_READOBJ_CODEVIEW_H<br>
> +<br>
> +#include "llvm/DebugInfo/CodeView/CodeView.h"<br>
> +#include "llvm/DebugInfo/CodeView/TypeIndex.h"<br>
> +#include "llvm/Support/Endian.h"<br>
> +<br>
> +namespace llvm {<br>
> +namespace codeview {<br>
> +<br>
> +/// A Symbols subsection is a sequence of SymRecords. Advancing by 'len'<br>
> +/// bytes will find the next SymRecord. These are the possible types of a<br>
> +/// record. Equivalent to SYM_ENUM_e in cvinfo.h.<br>
> +enum SymType : uint16_t {<br>
> +#define SYMBOL_TYPE(ename, value) ename = value,<br>
> +#include "CVSymbolTypes.def"<br>
> +};<br>
> +<br>
> +/// Generic record compatible with all symbol records.<br>
> +struct SymRecord {<br>
> +  ulittle16_t RecordLength; // Record length, starting from the next field<br>
> +  ulittle16_t RecordType;   // Record type (SymType)<br>
> +  // Symbol data follows.<br>
> +};<br>
> +<br>
> +/// Corresponds to the CV_PROCFLAGS bitfield.<br>
> +enum ProcFlags : uint8_t {<br>
> +  HasFP = 1 << 0,<br>
> +  HasIRET = 1 << 1,<br>
> +  HasFRET = 1 << 2,<br>
> +  IsNoReturn = 1 << 3,<br>
> +  IsUnreachable = 1 << 4,<br>
> +  HasCustomCallingConv = 1 << 5,<br>
> +  IsNoInline = 1 << 6,<br>
> +  HasOptimizedDebugInfo = 1 << 7,<br>
> +};<br>
> +<br>
> +// S_GPROC32, S_LPROC32, S_GPROC32_ID, S_LPROC32_ID, S_LPROC32_DPC or<br>
> +// S_LPROC32_DPC_ID<br>
> +struct ProcSym {<br>
> +  ulittle32_t PtrParent;<br>
> +  ulittle32_t PtrEnd;<br>
> +  ulittle32_t PtrNext;<br>
> +  ulittle32_t CodeSize;<br>
> +  ulittle32_t DbgStart;<br>
> +  ulittle32_t DbgEnd;<br>
> +  TypeIndex FunctionType;<br>
> +  ulittle32_t CodeOffset;<br>
> +  ulittle16_t Segment;<br>
> +  uint8_t Flags; // CV_PROCFLAGS<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_INLINESITE<br>
> +struct InlineSiteSym {<br>
> +  ulittle32_t PtrParent;<br>
> +  ulittle32_t PtrEnd;<br>
> +  TypeIndex Inlinee;<br>
> +  // BinaryAnnotations<br>
> +};<br>
> +<br>
> +// S_LOCAL<br>
> +struct LocalSym {<br>
> +  TypeIndex Type;<br>
> +  ulittle16_t Flags;<br>
> +  enum : uint16_t {<br>
> +    IsParameter = 1 << 0,<br>
> +    IsAddressTaken = 1 << 1,<br>
> +    IsCompilerGenerated = 1 << 2,<br>
> +    IsAggregate = 1 << 3,<br>
> +    IsAggregated = 1 << 4,<br>
> +    IsAliased = 1 << 5,<br>
> +    IsAlias = 1 << 6,<br>
> +    IsReturnValue = 1 << 7,<br>
> +    IsOptimizedOut = 1 << 8,<br>
> +    IsEnregisteredGlobal = 1 << 9,<br>
> +    IsEnregisteredStatic = 1 << 10,<br>
> +  };<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_BLOCK32<br>
> +struct BlockSym {<br>
> +  ulittle32_t PtrParent;<br>
> +  ulittle32_t PtrEnd;<br>
> +  ulittle32_t CodeSize;<br>
> +  ulittle32_t CodeOffset;<br>
> +  ulittle16_t Segment;<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_LABEL32<br>
> +struct LabelSym {<br>
> +  ulittle32_t CodeOffset;<br>
> +  ulittle16_t Segment;<br>
> +  uint8_t Flags; // CV_PROCFLAGS<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_OBJNAME<br>
> +struct ObjNameSym {<br>
> +  ulittle32_t Signature;<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_COMPILE3<br>
> +struct CompileSym3 {<br>
> +  ulittle32_t flags;<br>
> +  uint8_t getLanguage() const { return flags & 0xff; }<br>
> +  enum Flags : uint32_t {<br>
> +    EC = 1 << 8,<br>
> +    NoDbgInfo = 1 << 9,<br>
> +    LTCG = 1 << 10,<br>
> +    NoDataAlign = 1 << 11,<br>
> +    ManagedPresent = 1 << 12,<br>
> +    SecurityChecks = 1 << 13,<br>
> +    HotPatch = 1 << 14,<br>
> +    CVTCIL = 1 << 15,<br>
> +    MSILModule = 1 << 16,<br>
> +    Sdl = 1 << 17,<br>
> +    PGO = 1 << 18,<br>
> +    Exp = 1 << 19,<br>
> +  };<br>
> +  ulittle16_t Machine; // CPUType<br>
> +  ulittle16_t VersionFrontendMajor;<br>
> +  ulittle16_t VersionFrontendMinor;<br>
> +  ulittle16_t VersionFrontendBuild;<br>
> +  ulittle16_t VersionFrontendQFE;<br>
> +  ulittle16_t VersionBackendMajor;<br>
> +  ulittle16_t VersionBackendMinor;<br>
> +  ulittle16_t VersionBackendBuild;<br>
> +  ulittle16_t VersionBackendQFE;<br>
> +  // VersionString: The null-terminated version string follows.<br>
> +};<br>
> +<br>
> +// S_FRAMEPROC<br>
> +struct FrameProcSym {<br>
> +  ulittle32_t TotalFrameBytes;<br>
> +  ulittle32_t PaddingFrameBytes;<br>
> +  ulittle32_t OffsetToPadding;<br>
> +  ulittle32_t BytesOfCalleeSavedRegisters;<br>
> +  ulittle32_t OffsetOfExceptionHandler;<br>
> +  ulittle16_t SectionIdOfExceptionHandler;<br>
> +  ulittle32_t Flags;<br>
> +};<br>
> +<br>
> +// S_CALLSITEINFO<br>
> +struct CallSiteInfoSym {<br>
> +  ulittle32_t CodeOffset;<br>
> +  ulittle16_t Segment;<br>
> +  ulittle16_t Reserved;<br>
> +  TypeIndex Type;<br>
> +};<br>
> +<br>
> +// S_HEAPALLOCSITE<br>
> +struct HeapAllocationSiteSym {<br>
> +  ulittle32_t CodeOffset;<br>
> +  ulittle16_t Segment;<br>
> +  ulittle16_t CallInstructionSize;<br>
> +  TypeIndex Type;<br>
> +};<br>
> +<br>
> +// S_FRAMECOOKIE<br>
> +struct FrameCookieSym {<br>
> +  ulittle32_t CodeOffset;<br>
> +  ulittle16_t Register;<br>
> +  ulittle16_t CookieKind;<br>
> +<br>
> +  enum : uint16_t {<br>
> +    Copy,<br>
> +    XorStackPointer,<br>
> +    XorFramePointer,<br>
> +    XorR13,<br>
> +  };<br>
> +};<br>
> +<br>
> +// S_UDT, S_COBOLUDT<br>
> +struct UDTSym {<br>
> +  TypeIndex Type; // Type of the UDT<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_BUILDINFO<br>
> +struct BuildInfoSym {<br>
> +  ulittle32_t BuildId;<br>
> +};<br>
> +<br>
> +// S_BPREL32<br>
> +struct BPRelativeSym {<br>
> +  ulittle32_t Offset; // Offset from the base pointer register<br>
> +  TypeIndex Type;     // Type of the variable<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_REGREL32<br>
> +struct RegRelativeSym {<br>
> +  ulittle32_t Offset;   // Offset from the register<br>
> +  TypeIndex Type;       // Type of the variable<br>
> +  ulittle16_t Register; // Register to which the variable is relative<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_CONSTANT, S_MANCONSTANT<br>
> +struct ConstantSym {<br>
> +  TypeIndex Type;<br>
> +  // Value: The value of the constant.<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA<br>
> +struct DataSym {<br>
> +  TypeIndex Type;<br>
> +  ulittle32_t DataOffset;<br>
> +  ulittle16_t Segment;<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// S_LTHREAD32, S_GTHREAD32<br>
> +struct ThreadLocalDataSym {<br>
> +  TypeIndex Type;<br>
> +  ulittle32_t DataOffset;<br>
> +  ulittle16_t Segment;<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +/// Data in the the SUBSEC_FRAMEDATA subection.<br>
> +struct FrameData {<br>
> +  ulittle32_t RvaStart;<br>
> +  ulittle32_t CodeSize;<br>
> +  ulittle32_t LocalSize;<br>
> +  ulittle32_t ParamsSize;<br>
> +  ulittle32_t MaxStackSize;<br>
> +  ulittle32_t FrameFunc;<br>
> +  ulittle16_t PrologSize;<br>
> +  ulittle16_t SavedRegsSize;<br>
> +  ulittle32_t Flags;<br>
> +  enum : uint32_t {<br>
> +    HasSEH = 1 << 0,<br>
> +    HasEH = 1 << 1,<br>
> +    IsFunctionStart = 1 << 2,<br>
> +  };<br>
> +};<br>
> +<br>
> +//===----------------------------------------------------------------------===//<br>
> +// On-disk representation of type information<br>
> +<br>
> +/// Indicates the kind of TypeRecord we're dealing with here. The documentation<br>
> +/// and headers talk about this as the "leaf" type.<br>
> +enum LeafType : uint16_t {<br>
> +#define LEAF_TYPE(name, val) name = val,<br>
> +#include "CVLeafTypes.def"<br>
> +};<br>
> +<br>
> +// A CodeView type stream is a sequence of TypeRecords. Records larger than<br>
> +// 65536 must chain on to a second record. Each TypeRecord is followed by one of<br>
> +// the leaf types described below.<br>
> +struct TypeRecord {<br>
> +  ulittle16_t Len;  // Type record length, starting from &Leaf.<br>
> +  ulittle16_t Leaf; // Type record kind (LeafType)<br>
> +};<br>
> +<br>
> +// LF_TYPESERVER2<br>
> +struct TypeServer2 {<br>
> +  char Signature[16];  // GUID<br>
> +  ulittle32_t Age;<br>
> +  // Name: Name of the PDB as a null-terminated string<br>
> +};<br>
> +<br>
> +// LF_STRING_ID<br>
> +struct StringId {<br>
> +  TypeIndex id;<br>
> +};<br>
> +<br>
> +// LF_FUNC_ID<br>
> +struct FuncId {<br>
> +  TypeIndex ParentScope;<br>
> +  TypeIndex FunctionType;<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// LF_CLASS, LF_STRUCT, LF_INTERFACE<br>
> +struct ClassType {<br>
> +  ulittle16_t MemberCount; // Number of members in FieldList.<br>
> +  ulittle16_t Properties;  // ClassOptions bitset<br>
> +  TypeIndex FieldList;     // LF_FIELDLIST: List of all kinds of members<br>
> +  TypeIndex DerivedFrom;   // LF_DERIVED: List of known derived classes<br>
> +  TypeIndex VShape;        // LF_VTSHAPE: Shape of the vftable<br>
> +  // SizeOf: The 'sizeof' the UDT in bytes is encoded as an LF_NUMERIC integer.<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// LF_UNION<br>
> +struct UnionType {<br>
> +  ulittle16_t MemberCount; // Number of members in FieldList.<br>
> +  ulittle16_t Properties;  // ClassOptions bitset<br>
> +  TypeIndex FieldList;     // LF_FIELDLIST: List of all kinds of members<br>
> +  // SizeOf: The 'sizeof' the UDT in bytes is encoded as an LF_NUMERIC integer.<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// LF_POINTER<br>
> +struct PointerType {<br>
> +  TypeIndex PointeeType;<br>
> +  ulittle32_t Attrs; // pointer attributes<br>
> +  // if pointer to member:<br>
> +  //   PointerToMemberTail<br>
> +<br>
> +  PointerKind getPtrKind() const { return PointerKind(Attrs & 0x1f); }<br>
> +  PointerMode getPtrMode() const { return PointerMode((Attrs >> 5) & 0x07); }<br>
> +  bool isFlat() const { return Attrs & (1 << 8); }<br>
> +  bool isVolatile() const { return Attrs & (1 << 9); }<br>
> +  bool isConst() const { return Attrs & (1 << 10); }<br>
> +  bool isUnaligned() const { return Attrs & (1 << 11); }<br>
> +<br>
> +  bool isPointerToDataMember() const {<br>
> +    return getPtrMode() == PointerMode::PointerToDataMember;<br>
> +  }<br>
> +  bool isPointerToMemberFunction() const {<br>
> +    return getPtrMode() == PointerMode::PointerToMemberFunction;<br>
> +  }<br>
> +  bool isPointerToMember() const {<br>
> +    return isPointerToMemberFunction() || isPointerToDataMember();<br>
> +  }<br>
> +};<br>
> +<br>
> +struct PointerToMemberTail {<br>
> +  TypeIndex ClassType;<br>
> +  ulittle16_t Representation; // PointerToMemberRepresentation<br>
> +};<br>
> +<br>
> +/// In Clang parlance, these are "qualifiers".  LF_MODIFIER<br>
> +struct TypeModifier {<br>
> +  TypeIndex ModifiedType;<br>
> +  ulittle16_t Modifiers; // ModifierOptions<br>
> +};<br>
> +<br>
> +// LF_VTSHAPE<br>
> +struct VTableShape {<br>
> +  // Number of vftable entries. Each method may have more than one entry due to<br>
> +  // things like covariant return types.<br>
> +  ulittle16_t VFEntryCount;<br>
> +  // Descriptors[]: 4-bit virtual method descriptors of type CV_VTS_desc_e.<br>
> +};<br>
> +<br>
> +// LF_UDT_SRC_LINE<br>
> +struct UDTSrcLine {<br>
> +  TypeIndex UDT;        // The user-defined type<br>
> +  TypeIndex SourceFile; // StringID containing the source filename<br>
> +  ulittle32_t LineNumber;<br>
> +};<br>
> +<br>
> +// LF_ARGLIST, LF_SUBSTR_LIST<br>
> +struct ArgList {<br>
> +  ulittle32_t NumArgs; // Number of arguments<br>
> +  // ArgTypes[]: Type indicies of arguments<br>
> +};<br>
> +<br>
> +// LF_BUILDINFO<br>
> +struct BuildInfo {<br>
> +  ulittle16_t NumArgs; // Number of arguments<br>
> +  // ArgTypes[]: Type indicies of arguments<br>
> +};<br>
> +<br>
> +// LF_ENUM<br>
> +struct EnumType {<br>
> +  ulittle16_t NumEnumerators; // Number of enumerators<br>
> +  ulittle16_t Properties;<br>
> +  TypeIndex UnderlyingType;<br>
> +  TypeIndex FieldListType;<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// LF_ARRAY<br>
> +struct ArrayType {<br>
> +  TypeIndex ElementType;<br>
> +  TypeIndex IndexType;<br>
> +  // SizeOf: LF_NUMERIC encoded size in bytes. Not element count!<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// LF_VFTABLE<br>
> +struct VFTableType {<br>
> +  TypeIndex CompleteClass;     // Class that owns this vftable.<br>
> +  TypeIndex OverriddenVFTable; // VFTable that this overrides.<br>
> +  ulittle32_t VFPtrOffset;     // VFPtr offset in CompleteClass<br>
> +  ulittle32_t NamesLen;        // Length of subsequent names array in bytes.<br>
> +  // Names: A sequence of null-terminated strings. First string is vftable<br>
> +  // names.<br>
> +};<br>
> +<br>
> +// LF_MFUNC_ID<br>
> +struct MemberFuncId {<br>
> +  TypeIndex ClassType;<br>
> +  TypeIndex FunctionType;<br>
> +  // Name: The null-terminated name follows.<br>
> +};<br>
> +<br>
> +// LF_PROCEDURE<br>
> +struct ProcedureType {<br>
> +  TypeIndex ReturnType;<br>
> +  CallingConvention CallConv;<br>
> +  FunctionOptions Options;<br>
> +  ulittle16_t NumParameters;<br>
> +  TypeIndex ArgListType;<br>
> +};<br>
> +<br>
> +// LF_MFUNCTION<br>
> +struct MemberFunctionType {<br>
> +  TypeIndex ReturnType;<br>
> +  TypeIndex ClassType;<br>
> +  TypeIndex ThisType;<br>
> +  CallingConvention CallConv;<br>
> +  FunctionOptions Options;<br>
> +  ulittle16_t NumParameters;<br>
> +  TypeIndex ArgListType;<br>
> +  little32_t ThisAdjustment;<br>
> +};<br>
> +<br>
> +//===----------------------------------------------------------------------===//<br>
> +// Field list records, which do not include leafs or sizes<br>
> +<br>
> +/// Equvalent to CV_fldattr_t in cvinfo.h.<br>
> +struct MemberAttributes {<br>
> +  ulittle16_t Attrs;<br>
> +<br>
> +  /// Get the access specifier. Valid for any kind of member.<br>
> +  MemberAccess getAccess() const {<br>
> +    return MemberAccess(unsigned(Attrs) & unsigned(MethodOptions::AccessMask));<br>
> +  }<br>
> +<br>
> +  /// Indicates if a method is defined with friend, virtual, static, etc.<br>
> +  MethodKind getMethodKind() const {<br>
> +    return MethodKind(<br>
> +        (unsigned(Attrs) & unsigned(MethodOptions::MethodKindMask)) >> 2);<br>
> +  }<br>
> +<br>
> +  /// Get the flags that are not included in access control or method<br>
> +  /// properties.<br>
> +  MethodOptions getFlags() const {<br>
> +    return MethodOptions(<br>
> +        unsigned(Attrs) &<br>
> +        ~unsigned(MethodOptions::AccessMask | MethodOptions::MethodKindMask));<br>
> +  }<br>
> +<br>
> +  /// Is this method virtual.<br>
> +  bool isVirtual() const {<br>
> +    auto MP = getMethodKind();<br>
> +    return MP != MethodKind::Vanilla && MP != MethodKind::Friend &&<br>
> +           MP != MethodKind::Static;<br>
> +  }<br>
> +<br>
> +  /// Does this member introduce a new virtual method.<br>
> +  bool isIntroducedVirtual() const {<br>
> +    auto MP = getMethodKind();<br>
> +    return MP == MethodKind::IntroducingVirtual ||<br>
> +           MP == MethodKind::PureIntroducingVirtual;<br>
> +  }<br>
> +};<br>
> +<br>
> +// LF_NESTTYPE<br>
> +struct NestedType {<br>
> +  ulittle16_t Pad0; // Should be zero<br>
> +  TypeIndex Type;   // Type index of nested type<br>
> +  // Name: Null-terminated string<br>
> +};<br>
> +<br>
> +// LF_ONEMETHOD<br>
> +struct OneMethod {<br>
> +  MemberAttributes Attrs;<br>
> +  TypeIndex Type;<br>
> +  // If is introduced virtual method:<br>
> +  //   VFTableOffset: int32_t offset in vftable<br>
> +  // Name: Null-terminated string<br>
> +<br>
> +  MethodKind getMethodKind() const {<br>
> +    return Attrs.getMethodKind();<br>
> +  }<br>
> +<br>
> +  bool isVirtual() const { return Attrs.isVirtual(); }<br>
> +  bool isIntroducedVirtual() const { return Attrs.isIntroducedVirtual(); }<br>
> +};<br>
> +<br>
> +struct MethodListEntry {<br>
> +  MemberAttributes Attrs;<br>
> +  ulittle16_t Padding;<br>
> +<br>
> +  TypeIndex Type;<br>
> +  // If is introduced virtual method:<br>
> +  //   VFTableOffset: int32_t offset in vftable<br>
> +<br>
> +  MethodKind getMethodKind() const {<br>
> +    return Attrs.getMethodKind();<br>
> +  }<br>
> +<br>
> +  bool isVirtual() const { return Attrs.isVirtual(); }<br>
> +  bool isIntroducedVirtual() const { return Attrs.isIntroducedVirtual(); }<br>
> +};<br>
> +<br>
> +/// For method overload sets.  LF_METHOD<br>
> +struct OverloadedMethod {<br>
> +  ulittle16_t MethodCount; // Size of overload set<br>
> +  TypeIndex MethList;      // Type index of methods in overload set<br>
> +  // Name: Null-terminated string<br>
> +};<br>
> +<br>
> +// LF_VFUNCTAB<br>
> +struct VirtualFunctionPointer {<br>
> +  ulittle16_t Pad0;<br>
> +  TypeIndex Type;   // Type of vfptr<br>
> +};<br>
> +<br>
> +// LF_MEMBER<br>
> +struct DataMember {<br>
> +  MemberAttributes Attrs; // Access control attributes, etc<br>
> +  TypeIndex Type;<br>
> +  // FieldOffset: LF_NUMERIC encoded byte offset<br>
> +  // Name: Null-terminated string<br>
> +};<br>
> +<br>
> +// LF_STMEMBER<br>
> +struct StaticDataMember {<br>
> +  MemberAttributes Attrs; // Access control attributes, etc<br>
> +  TypeIndex Type;<br>
> +  // Name: Null-terminated string<br>
> +};<br>
> +<br>
> +// LF_ENUMERATE<br>
> +struct Enumerator {<br>
> +  MemberAttributes Attrs; // Access control attributes, etc<br>
> +  // EnumValue: LF_NUMERIC encoded enumerator value<br>
> +  // Name: Null-terminated string<br>
> +};<br>
> +<br>
> +// LF_BCLASS, LF_BINTERFACE<br>
> +struct BaseClass {<br>
> +  MemberAttributes Attrs; // Access control attributes, etc<br>
> +  TypeIndex BaseType;     // Base class type<br>
> +  // BaseOffset: LF_NUMERIC encoded byte offset of base from derived.<br>
> +};<br>
> +<br>
> +// LF_VBCLASS | LV_IVBCLASS<br>
> +struct VirtualBaseClass {<br>
> +  MemberAttributes Attrs; // Access control attributes, etc.<br>
> +  TypeIndex BaseType;     // Base class type<br>
> +  TypeIndex VBPtrType;    // Virtual base pointer type<br>
> +  // VBPtrOffset: Offset of vbptr from vfptr encoded as LF_NUMERIC.<br>
> +  // VBTableIndex: Index of vbase within vbtable encoded as LF_NUMERIC.<br>
> +};<br>
> +<br>
> +} // namespace codeview<br>
> +} // namespace llvm<br>
> +<br>
> +#endif // LLVM_READOBJ_CODEVIEW_H<br>
><br>
> Modified: llvm/trunk/tools/llvm-readobj/StreamWriter.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/StreamWriter.h?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/StreamWriter.h?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-readobj/StreamWriter.h (original)<br>
> +++ llvm/trunk/tools/llvm-readobj/StreamWriter.h Wed Jan 13 13:32:35 2016<br>
> @@ -10,6 +10,7 @@<br>
>  #ifndef LLVM_TOOLS_LLVM_READOBJ_STREAMWRITER_H<br>
>  #define LLVM_TOOLS_LLVM_READOBJ_STREAMWRITER_H<br>
><br>
> +#include "llvm/ADT/APSInt.h"<br>
>  #include "llvm/ADT/ArrayRef.h"<br>
>  #include "llvm/ADT/SmallVector.h"<br>
>  #include "llvm/ADT/StringRef.h"<br>
> @@ -180,6 +181,10 @@ public:<br>
>      startLine() << Label << ": " << int(Value) << "\n";<br>
>    }<br>
><br>
> +  void printNumber(StringRef Label, APSInt Value) {<br>
> +    startLine() << Label << ": " << Value << "\n";<br>
> +  }<br>
> +<br>
>    void printBoolean(StringRef Label, bool Value) {<br>
>      startLine() << Label << ": " << (Value ? "Yes" : "No") << '\n';<br>
>    }<br>
> @@ -287,6 +292,12 @@ private:<br>
>    int IndentLevel;<br>
>  };<br>
><br>
> +template <><br>
> +inline void StreamWriter::printHex<ulittle16_t>(StringRef Label,<br>
> +                                                ulittle16_t Value) {<br>
> +  startLine() << Label << ": " << hex(Value) << "\n";<br>
> +}<br>
> +<br>
>  struct DictScope {<br>
>    DictScope(StreamWriter& W, StringRef N) : W(W) {<br>
>      W.startLine() << N << " {\n";<br>
><br>
> Modified: llvm/trunk/tools/llvm-readobj/llvm-readobj.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.h?rev=257658&r1=257657&r2=257658&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/llvm-readobj.h?rev=257658&r1=257657&r2=257658&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/tools/llvm-readobj/llvm-readobj.h (original)<br>
> +++ llvm/trunk/tools/llvm-readobj/llvm-readobj.h Wed Jan 13 13:32:35 2016<br>
> @@ -47,4 +47,7 @@ namespace opts {<br>
>  #define LLVM_READOBJ_ENUM_ENT(ns, enum) \<br>
>    { #enum, ns::enum }<br>
><br>
> +#define LLVM_READOBJ_ENUM_CLASS_ENT(enum_class, enum) \<br>
> +  { #enum, std::underlying_type<enum_class>::type(enum_class::enum) }<br>
> +<br>
>  #endif<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<span style="color:#888888"><br>
<br>
<br>
<span class="hoenzb">--</span><br>
<span class="hoenzb">Teresa Johnson | Software Engineer | <a href="mailto:tejohnson@google.com">
tejohnson@google.com</a> | 408-460-2413</span></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>