Home | History | Annotate | Download | only in ObjectYAML
      1 //===- CodeViewYAMLTypes.h - CodeView YAMLIO Type Record implementation ---===//
      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/DebugInfo/CodeView/CodeView.h"
     19 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
     20 #include "llvm/ObjectYAML/YAML.h"
     21 #include "llvm/Support/Allocator.h"
     22 
     23 namespace llvm {
     24 namespace codeview {
     25 class TypeTableBuilder;
     26 }
     27 namespace CodeViewYAML {
     28 namespace detail {
     29 struct LeafRecordBase;
     30 struct MemberRecordBase;
     31 }
     32 
     33 struct MemberRecord {
     34   std::shared_ptr<detail::MemberRecordBase> Member;
     35 };
     36 
     37 struct LeafRecord {
     38   std::shared_ptr<detail::LeafRecordBase> Leaf;
     39 
     40   codeview::CVType toCodeViewRecord(BumpPtrAllocator &Allocator) const;
     41   codeview::CVType toCodeViewRecord(codeview::TypeTableBuilder &TS) const;
     42   static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
     43 };
     44 
     45 std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugT);
     46 ArrayRef<uint8_t> toDebugT(ArrayRef<LeafRecord>, BumpPtrAllocator &Alloc);
     47 } // namespace CodeViewYAML
     48 } // namespace llvm
     49 
     50 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::LeafRecord)
     51 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::MemberRecord)
     52 
     53 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::LeafRecord)
     54 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::MemberRecord)
     55 
     56 #endif
     57