LLVM  10.0.0svn
XCOFFYAML.h
Go to the documentation of this file.
1 //===----- XCOFFYAML.h - XCOFF YAMLIO implementation ------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares classes for handling the YAML representation of XCOFF.
10 //
11 //===----------------------------------------------------------------------===//
12 #ifndef LLVM_OBJECTYAML_XCOFFYAML_H
13 #define LLVM_OBJECTYAML_XCOFFYAML_H
14 
16 #include "llvm/ObjectYAML/YAML.h"
17 #include <vector>
18 
19 namespace llvm {
20 namespace XCOFFYAML {
21 
22 struct FileHeader {
23  llvm::yaml::Hex16 Magic;
24  uint16_t NumberOfSections;
25  int32_t TimeStamp;
26  llvm::yaml::Hex32 SymbolTableOffset; // File offset to symbol table.
28  uint16_t AuxHeaderSize;
29  llvm::yaml::Hex16 Flags;
30 };
31 
32 struct Symbol {
34  llvm::yaml::Hex32 Value; // Symbol value; storage class-dependent.
36  llvm::yaml::Hex16 Type;
38  uint8_t NumberOfAuxEntries; // Number of auxiliary entries
39 };
40 
41 struct Object {
43  std::vector<Symbol> Symbols;
44  Object();
45 };
46 } // namespace XCOFFYAML
47 } // namespace llvm
48 LLVM_YAML_IS_SEQUENCE_VECTOR(XCOFFYAML::Symbol)
49 namespace llvm {
50 namespace yaml {
51 
52 template <> struct ScalarEnumerationTraits<XCOFF::StorageClass> {
53  static void enumeration(IO &IO, XCOFF::StorageClass &Value);
54 };
55 
56 template <> struct MappingTraits<XCOFFYAML::FileHeader> {
57  static void mapping(IO &IO, XCOFFYAML::FileHeader &H);
58 };
59 
60 template <> struct MappingTraits<XCOFFYAML::Object> {
61  static void mapping(IO &IO, XCOFFYAML::Object &Obj);
62 };
63 
64 template <> struct MappingTraits<XCOFFYAML::Symbol> {
65  static void mapping(IO &IO, XCOFFYAML::Symbol &S);
66 };
67 
68 } // namespace yaml
69 } // namespace llvm
70 
71 #endif // LLVM_OBJECTYAML_XCOFFYAML_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:356
StorageClass
Definition: XCOFF.h:75
std::vector< Symbol > Symbols
Definition: XCOFFYAML.h:43
llvm::yaml::Hex16 Type
Definition: XCOFFYAML.h:36
#define H(x, y, z)
Definition: MD5.cpp:57
uint8_t NumberOfAuxEntries
Definition: XCOFFYAML.h:38
XCOFF::StorageClass StorageClass
Definition: XCOFFYAML.h:37
LLVM Value Representation.
Definition: Value.h:73
llvm::yaml::Hex32 SymbolTableOffset
Definition: XCOFFYAML.h:26
llvm::yaml::Hex16 Flags
Definition: XCOFFYAML.h:29
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
llvm::yaml::Hex16 Magic
Definition: XCOFFYAML.h:23
llvm::yaml::Hex32 Value
Definition: XCOFFYAML.h:34