LLVM 17.0.0git
TextStubCommon.h
Go to the documentation of this file.
1//===- TextStubCommon.h ---------------------------------------------------===//
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// Defines common Text Stub YAML mappings.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TEXTAPI_TEXT_STUB_COMMON_H
14#define LLVM_TEXTAPI_TEXT_STUB_COMMON_H
15
16#include "llvm/ADT/StringRef.h"
21#include "llvm/TextAPI/Target.h"
22
23using UUID = std::pair<llvm::MachO::Target, std::string>;
24
25// clang-format off
26enum TBDFlags : unsigned {
27 None = 0U,
28 FlatNamespace = 1U << 0,
30 InstallAPI = 1U << 2,
32};
33// clang-format on
34
36LLVM_YAML_STRONG_TYPEDEF(uint8_t, SwiftVersion)
39
40namespace llvm {
41
42namespace MachO {
43class ArchitectureSet;
44class PackedVersion;
45
46Expected<std::unique_ptr<InterfaceFile>>
47getInterfaceFileFromJSON(StringRef JSON);
48
49Error serializeInterfaceFileToJSON(raw_ostream &OS, const InterfaceFile &File,
50 bool Compact);
51} // namespace MachO
52
53namespace yaml {
54
55template <> struct ScalarTraits<FlowStringRef> {
56 static void output(const FlowStringRef &, void *, raw_ostream &);
57 static StringRef input(StringRef, void *, FlowStringRef &);
58 static QuotingType mustQuote(StringRef);
59};
60
61template <> struct ScalarEnumerationTraits<MachO::ObjCConstraintType> {
63};
64
65template <> struct ScalarTraits<MachO::PlatformSet> {
66 static void output(const MachO::PlatformSet &, void *, raw_ostream &);
68 static QuotingType mustQuote(StringRef);
69};
70
71template <> struct ScalarBitSetTraits<MachO::ArchitectureSet> {
72 static void bitset(IO &, MachO::ArchitectureSet &);
73};
74
75template <> struct ScalarTraits<MachO::Architecture> {
76 static void output(const MachO::Architecture &, void *, raw_ostream &);
78 static QuotingType mustQuote(StringRef);
79};
80
81template <> struct ScalarTraits<MachO::PackedVersion> {
82 static void output(const MachO::PackedVersion &, void *, raw_ostream &);
84 static QuotingType mustQuote(StringRef);
85};
86
87template <> struct ScalarTraits<SwiftVersion> {
88 static void output(const SwiftVersion &, void *, raw_ostream &);
89 static StringRef input(StringRef, void *, SwiftVersion &);
90 static QuotingType mustQuote(StringRef);
91};
92
93template <> struct ScalarTraits<UUID> {
94 static void output(const UUID &, void *, raw_ostream &);
95 static StringRef input(StringRef, void *, UUID &);
96 static QuotingType mustQuote(StringRef);
97};
98
99} // end namespace yaml.
100} // end namespace llvm.
101
102#endif // LLVM_TEXTAPI_TEXT_STUB_COMMON_H
raw_pwrite_stream & OS
std::pair< llvm::MachO::Target, std::string > UUID
TBDFlags
@ LLVM_MARK_AS_BITMASK_ENUM
@ NotApplicationExtensionSafe
@ InstallAPI
@ FlatNamespace
@ None
#define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(type)
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition: SmallSet.h:135
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
ObjCConstraintType
Defines a list of Objective-C constraints.
Definition: InterfaceFile.h:33
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
Definition: Architecture.h:27
Error serializeInterfaceFileToJSON(raw_ostream &OS, const InterfaceFile &File, bool Compact)
Expected< std::unique_ptr< InterfaceFile > > getInterfaceFileFromJSON(StringRef JSON)
Definition: TextStubV5.cpp:702
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
static void bitset(IO &, MachO::ArchitectureSet &)
static void enumeration(IO &, MachO::ObjCConstraintType &)
static QuotingType mustQuote(StringRef)
static void output(const MachO::Architecture &, void *, raw_ostream &)
static StringRef input(StringRef, void *, MachO::Architecture &)
static void output(const MachO::PackedVersion &, void *, raw_ostream &)
static StringRef input(StringRef, void *, MachO::PackedVersion &)
static QuotingType mustQuote(StringRef)
static StringRef input(StringRef, void *, MachO::PlatformSet &)
static void output(const MachO::PlatformSet &, void *, raw_ostream &)