]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lld/include/lld/ReaderWriter/YamlContext.h
Bring lld (release_39 branch, r279477) to contrib
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lld / 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   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