[Debuginfo][COFF] Minimal serialization support for precompiled types records
This change adds support for the LF_PRECOMP and LF_ENDPRECOMP records required
to read/write Microsoft precompiled types .objs.
See https://en.wikipedia.org/wiki/Precompiled_header#Microsoft_Visual_C_and_C++
This also adds handling for the .debug$P section, which is actually a .debug$T
section in disguise, found only in precompiled .objs.
Differential Revision: https://reviews.llvm.org/D45283
llvm-svn: 329613
diff --git a/llvm/lib/ObjectYAML/COFFYAML.cpp b/llvm/lib/ObjectYAML/COFFYAML.cpp
index 937b8dc..9351ef9 100644
--- a/llvm/lib/ObjectYAML/COFFYAML.cpp
+++ b/llvm/lib/ObjectYAML/COFFYAML.cpp
@@ -562,14 +562,16 @@
IO.mapOptional("VirtualSize", Sec.Header.VirtualSize, 0U);
IO.mapOptional("Alignment", Sec.Alignment, 0U);
- // If this is a .debug$S .debug$T, or .debug$H section parse the semantic
- // representation of the symbols/types. If it is any other kind of section,
- // just deal in raw bytes.
+ // If this is a .debug$S .debug$T .debug$P, or .debug$H section parse the
+ // semantic representation of the symbols/types. If it is any other kind
+ // of section, just deal in raw bytes.
IO.mapOptional("SectionData", Sec.SectionData);
if (Sec.Name == ".debug$S")
IO.mapOptional("Subsections", Sec.DebugS);
else if (Sec.Name == ".debug$T")
IO.mapOptional("Types", Sec.DebugT);
+ else if (Sec.Name == ".debug$P")
+ IO.mapOptional("PrecompTypes", Sec.DebugP);
else if (Sec.Name == ".debug$H")
IO.mapOptional("GlobalHashes", Sec.DebugH);