1 //==- CodeViewYAMLTypes.h - CodeView YAMLIO Type implementation --*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines classes for handling the YAML representation of CodeView
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
16 #define LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
20 #include "llvm/Support/Allocator.h"
21 #include "llvm/Support/Error.h"
22 #include "llvm/Support/YAMLTraits.h"
30 class AppendingTypeTableBuilder;
33 namespace CodeViewYAML {
37 struct LeafRecordBase;
38 struct MemberRecordBase;
40 } // end namespace detail
43 std::shared_ptr<detail::MemberRecordBase> Member;
47 std::shared_ptr<detail::LeafRecordBase> Leaf;
50 toCodeViewRecord(codeview::AppendingTypeTableBuilder &Serializer) const;
51 static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
54 std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugTorP,
55 StringRef SectionName);
56 ArrayRef<uint8_t> toDebugT(ArrayRef<LeafRecord>, BumpPtrAllocator &Alloc,
57 StringRef SectionName);
59 } // end namespace CodeViewYAML
61 } // end namespace llvm
63 LLVM_YAML_DECLARE_SCALAR_TRAITS(codeview::GUID, QuotingType::Single)
65 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::LeafRecord)
66 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::MemberRecord)
68 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::LeafRecord)
69 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::MemberRecord)
71 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H