1//===- lld/ReaderWriter/YamlContext.h - object used in YAML I/O context ---===// 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#ifndef LLD_READER_WRITER_YAML_CONTEXT_H 10#define LLD_READER_WRITER_YAML_CONTEXT_H 11 12#include "lld/Common/LLVM.h" 13#include <functional> 14#include <memory> 15#include <vector> 16 17namespace lld { 18class File; 19class LinkingContext; 20class Registry; 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