LLVM  8.0.1
CodeViewYAMLTypes.h
Go to the documentation of this file.
1 //==- CodeViewYAMLTypes.h - CodeView YAMLIO Type implementation --*- C++ -*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines classes for handling the YAML representation of CodeView
11 // Debug Info.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
16 #define LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
17 
18 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/Support/Allocator.h"
21 #include "llvm/Support/Error.h"
23 #include <cstdint>
24 #include <memory>
25 #include <vector>
26 
27 namespace llvm {
28 
29 namespace codeview {
30 class AppendingTypeTableBuilder;
31 }
32 
33 namespace CodeViewYAML {
34 
35 namespace detail {
36 
37 struct LeafRecordBase;
38 struct MemberRecordBase;
39 
40 } // end namespace detail
41 
42 struct MemberRecord {
43  std::shared_ptr<detail::MemberRecordBase> Member;
44 };
45 
46 struct LeafRecord {
47  std::shared_ptr<detail::LeafRecordBase> Leaf;
48 
50  toCodeViewRecord(codeview::AppendingTypeTableBuilder &Serializer) const;
51  static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
52 };
53 
54 std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugTorP,
58 
59 } // end namespace CodeViewYAML
60 
61 } // end namespace llvm
62 
63 LLVM_YAML_DECLARE_SCALAR_TRAITS(codeview::GUID, QuotingType::Single)
64 
65 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::LeafRecord)
66 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::MemberRecord)
67 
68 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::LeafRecord)
69 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::MemberRecord)
70 
71 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
This represents the &#39;GUID&#39; type from windows.h.
Definition: GUID.h:22
Tagged union holding either a T or a Error.
Definition: CachePruning.h:23
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:141
std::vector< LeafRecord > fromDebugT(ArrayRef< uint8_t > DebugTorP, StringRef SectionName)
std::shared_ptr< detail::MemberRecordBase > Member
ArrayRef< uint8_t > toDebugT(ArrayRef< LeafRecord >, BumpPtrAllocator &Alloc, StringRef SectionName)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
std::shared_ptr< detail::LeafRecordBase > Leaf