summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-31 01:08:36 +0000
committerZachary Turner <zturner@google.com>2017-05-31 01:08:36 +0000
commit083342bd345733b9379dd40ea16f50a05d0ee57a (patch)
tree4657ea8dfb1ad39d16f81455903671926f494ec3
parent032b5bdf2b7913506c5785f841f5fc7e08716a80 (diff)
downloadbcm5719-llvm-083342bd345733b9379dd40ea16f50a05d0ee57a.tar.gz
bcm5719-llvm-083342bd345733b9379dd40ea16f50a05d0ee57a.zip
[ObjectYAML] Clean up the CodeView headers a bit.
CodeViewYAML.h attempts to hide the details of many of the CodeView yaml structures and types, but at the same time it exposes the mapping traits for them to external users of the header. This patch just hides these in the implementation files so that the interface is kept as simple as possible. llvm-svn: 304263
-rw-r--r--llvm/include/llvm/ObjectYAML/CodeViewYAML.h46
-rw-r--r--llvm/lib/ObjectYAML/CodeViewYAML.cpp34
-rw-r--r--llvm/tools/llvm-pdbdump/PdbYaml.cpp1
3 files changed, 45 insertions, 36 deletions
diff --git a/llvm/include/llvm/ObjectYAML/CodeViewYAML.h b/llvm/include/llvm/ObjectYAML/CodeViewYAML.h
index 86b572ab86d..16a58ba1060 100644
--- a/llvm/include/llvm/ObjectYAML/CodeViewYAML.h
+++ b/llvm/include/llvm/ObjectYAML/CodeViewYAML.h
@@ -16,6 +16,7 @@
#define LLVM_OBJECTYAML_CODEVIEWYAML_H
#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/CodeView/DebugSubsection.h"
#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"
#include "llvm/DebugInfo/CodeView/SymbolSerializer.h"
@@ -27,6 +28,12 @@
namespace llvm {
namespace CodeViewYAML {
+namespace detail {
+struct C13FragmentBase;
+struct LeafRecordBase;
+struct MemberRecordBase;
+struct SymbolRecordBase;
+}
namespace detail {
struct MemberRecordBase;
@@ -106,46 +113,17 @@ struct SymbolRecord {
codeview::CVSymbol toCodeViewSymbol(BumpPtrAllocator &Allocator) const;
static Expected<SymbolRecord> fromCodeViewSymbol(codeview::CVSymbol Symbol);
};
+
+struct C13DebugSection {
+ std::vector<detail::C13FragmentBase> Fragments;
+};
} // namespace CodeViewYAML
} // namespace llvm
-LLVM_YAML_DECLARE_SCALAR_TRAITS(codeview::TypeIndex, false)
-LLVM_YAML_DECLARE_SCALAR_TRAITS(CodeViewYAML::HexFormattedString, false)
-LLVM_YAML_DECLARE_SCALAR_TRAITS(APSInt, false)
-
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineEntry)
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceColumnEntry)
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceFileChecksumEntry)
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineInfo)
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineBlock)
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceFileInfo)
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::InlineeInfo)
-LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::InlineeSite)
-
LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::LeafRecord)
LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::MemberRecord)
LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SymbolRecord)
-
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::TypeLeafKind)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::SymbolKind)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::PointerToMemberRepresentation)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::VFTableSlotKind)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::CallingConvention)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::PointerKind)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::PointerMode)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::HfaKind)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::MemberAccess)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::MethodKind)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::WindowsRTClassKind)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::LabelType)
-LLVM_YAML_DECLARE_ENUM_TRAITS(codeview::FileChecksumKind)
-
-LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::PointerOptions)
-LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::LineFlags)
-LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::ModifierOptions)
-LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::FunctionOptions)
-LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::ClassOptions)
-LLVM_YAML_DECLARE_BITSET_TRAITS(codeview::MethodOptions)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceFileInfo)
LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::LeafRecord)
LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::MemberRecord)
diff --git a/llvm/lib/ObjectYAML/CodeViewYAML.cpp b/llvm/lib/ObjectYAML/CodeViewYAML.cpp
index a12c7146cc1..227377785d7 100644
--- a/llvm/lib/ObjectYAML/CodeViewYAML.cpp
+++ b/llvm/lib/ObjectYAML/CodeViewYAML.cpp
@@ -34,10 +34,42 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(InlineeSite)
LLVM_YAML_IS_SEQUENCE_VECTOR(InlineeInfo)
LLVM_YAML_IS_SEQUENCE_VECTOR(OneMethodRecord)
LLVM_YAML_IS_SEQUENCE_VECTOR(StringRef)
-LLVM_YAML_IS_SEQUENCE_VECTOR(uint32_t)
LLVM_YAML_IS_SEQUENCE_VECTOR(VFTableSlotKind)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(TypeIndex)
+LLVM_YAML_DECLARE_SCALAR_TRAITS(TypeIndex, false)
+LLVM_YAML_DECLARE_SCALAR_TRAITS(CodeViewYAML::HexFormattedString, false)
+LLVM_YAML_DECLARE_SCALAR_TRAITS(APSInt, false)
+
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineEntry)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceColumnEntry)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceFileChecksumEntry)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineInfo)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SourceLineBlock)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::InlineeInfo)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::InlineeSite)
+
+LLVM_YAML_DECLARE_ENUM_TRAITS(TypeLeafKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(SymbolKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(PointerToMemberRepresentation)
+LLVM_YAML_DECLARE_ENUM_TRAITS(VFTableSlotKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(CallingConvention)
+LLVM_YAML_DECLARE_ENUM_TRAITS(PointerKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(PointerMode)
+LLVM_YAML_DECLARE_ENUM_TRAITS(HfaKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(MemberAccess)
+LLVM_YAML_DECLARE_ENUM_TRAITS(MethodKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(WindowsRTClassKind)
+LLVM_YAML_DECLARE_ENUM_TRAITS(LabelType)
+LLVM_YAML_DECLARE_ENUM_TRAITS(FileChecksumKind)
+
+LLVM_YAML_DECLARE_BITSET_TRAITS(PointerOptions)
+LLVM_YAML_DECLARE_BITSET_TRAITS(LineFlags)
+LLVM_YAML_DECLARE_BITSET_TRAITS(ModifierOptions)
+LLVM_YAML_DECLARE_BITSET_TRAITS(FunctionOptions)
+LLVM_YAML_DECLARE_BITSET_TRAITS(ClassOptions)
+LLVM_YAML_DECLARE_BITSET_TRAITS(MethodOptions)
+
LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::codeview::OneMethodRecord)
LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::codeview::MemberPointerInfo)
diff --git a/llvm/tools/llvm-pdbdump/PdbYaml.cpp b/llvm/tools/llvm-pdbdump/PdbYaml.cpp
index d3a71c036f3..2cea0f5803d 100644
--- a/llvm/tools/llvm-pdbdump/PdbYaml.cpp
+++ b/llvm/tools/llvm-pdbdump/PdbYaml.cpp
@@ -13,7 +13,6 @@
#include "llvm/DebugInfo/CodeView/CVSymbolVisitor.h"
#include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
#include "llvm/DebugInfo/CodeView/SymbolDeserializer.h"
-#include "llvm/DebugInfo/CodeView/SymbolSerializer.h"
#include "llvm/DebugInfo/CodeView/SymbolVisitorCallbackPipeline.h"
#include "llvm/DebugInfo/CodeView/TypeSerializer.h"
#include "llvm/DebugInfo/CodeView/TypeVisitorCallbackPipeline.h"
OpenPOWER on IntegriCloud