]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lld/ReaderWriter/YamlContext.h
Vendor import of lld trunk r233088:
[FreeBSD/FreeBSD.git] / include / lld / ReaderWriter / YamlContext.h
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/Core/LLVM.h"
14 #include <functional>
15 #include <memory>
16 #include <vector>
17
18 namespace lld {
19 class File;
20 class LinkingContext;
21 namespace mach_o {
22 namespace normalized {
23 struct NormalizedFile;
24 }
25 }
26
27 using 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.
32 struct YamlContext {
33   YamlContext()
34       : _linkingContext(nullptr), _registry(nullptr), _file(nullptr),
35         _normalizeMachOFile(nullptr) {}
36
37   const LinkingContext *_linkingContext;
38   const Registry *_registry;
39   File *_file;
40   NormalizedFile *_normalizeMachOFile;
41   StringRef _path;
42 };
43
44 } // end namespace lld
45
46 #endif // LLD_READER_WRITER_YAML_CONTEXT_H