Home | History | Annotate | Download | only in ObjectYAML
      1 //===- CodeViewYAMLSymbols.h - CodeView YAMLIO Symbol 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_CODEVIEWYAMLSYMBOLS_H
     16 #define LLVM_OBJECTYAML_CODEVIEWYAMLSYMBOLS_H
     17 
     18 #include "llvm/DebugInfo/CodeView/CodeView.h"
     19 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
     20 #include "llvm/Support/Error.h"
     21 #include "llvm/Support/YAMLTraits.h"
     22 #include <memory>
     23 
     24 namespace llvm {
     25 namespace CodeViewYAML {
     26 
     27 namespace detail {
     28 
     29 struct SymbolRecordBase;
     30 
     31 } // end namespace detail
     32 
     33 struct SymbolRecord {
     34   std::shared_ptr<detail::SymbolRecordBase> Symbol;
     35 
     36   codeview::CVSymbol
     37   toCodeViewSymbol(BumpPtrAllocator &Allocator,
     38                    codeview::CodeViewContainer Container) const;
     39 
     40   static Expected<SymbolRecord> fromCodeViewSymbol(codeview::CVSymbol Symbol);
     41 };
     42 
     43 } // end namespace CodeViewYAML
     44 } // end namespace llvm
     45 
     46 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::SymbolRecord)
     47 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::SymbolRecord)
     48 
     49 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLSYMBOLS_H
     50