1//===- lld/ReaderWriter/YamlContext.h - object used in YAML I/O context ---===//
2//
3//                             The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLD_READER_WRITER_YAML_CONTEXT_H
11#define LLD_READER_WRITER_YAML_CONTEXT_H
12
13#include "lld/Common/LLVM.h"
14#include <functional>
15#include <memory>
16#include <vector>
17
18namespace lld {
19class File;
20class LinkingContext;
21namespace mach_o {
22namespace normalized {
23struct NormalizedFile;
24}
25}
26
27using lld::mach_o::normalized::NormalizedFile;
28
29/// When YAML I/O is used in lld, the yaml context always holds a YamlContext
30/// object.  We need to support hetergenous yaml documents which each require
31/// different context info.  This struct supports all clients.
32struct YamlContext {
33  const LinkingContext *_ctx = nullptr;
34  const Registry *_registry = nullptr;
35  File *_file = nullptr;
36  NormalizedFile *_normalizeMachOFile = nullptr;
37  StringRef _path;
38};
39
40} // end namespace lld
41
42#endif // LLD_READER_WRITER_YAML_CONTEXT_H
43