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 18 namespace lld { 19 class File; 20 class LinkingContext; 21 class Registry; 22 namespace mach_o { 23 namespace normalized { 24 struct NormalizedFile; 25 } 26 } 27 28 using lld::mach_o::normalized::NormalizedFile; 29 30 /// When YAML I/O is used in lld, the yaml context always holds a YamlContext 31 /// object. We need to support hetergenous yaml documents which each require 32 /// different context info. This struct supports all clients. 33 struct YamlContext { 34 const LinkingContext *_ctx = nullptr; 35 const Registry *_registry = nullptr; 36 File *_file = nullptr; 37 NormalizedFile *_normalizeMachOFile = nullptr; 38 StringRef _path; 39 }; 40 41 } // end namespace lld 42 43 #endif // LLD_READER_WRITER_YAML_CONTEXT_H 44