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
26LLVM_YAML_STRONG_TYPEDEF(uint8_t, SwiftVersion)
29
30namespace llvm {
31
32namespace MachO {
33 class ArchitectureSet;
34 class PackedVersion;
35}
36namespace yaml {
37
38template <> struct ScalarTraits<FlowStringRef> {
39 static void output(const FlowStringRef &, void *, raw_ostream &);
40 static StringRef input(StringRef, void *, FlowStringRef &);
41 static QuotingType mustQuote(StringRef);
42};
43
44template <> struct ScalarEnumerationTraits<MachO::ObjCConstraintType> {
46};
47
48template <> struct ScalarTraits<MachO::PlatformSet> {
49 static void output(const MachO::PlatformSet &, void *, raw_ostream &);
51 static QuotingType mustQuote(StringRef);
52};
53
54template <> struct ScalarBitSetTraits<MachO::ArchitectureSet> {
55 static void bitset(IO &, MachO::ArchitectureSet &);
56};
57
58template <> struct ScalarTraits<MachO::Architecture> {
59 static void output(const MachO::Architecture &, void *, raw_ostream &);
61 static QuotingType mustQuote(StringRef);
62};
63
64template <> struct ScalarTraits<MachO::PackedVersion> {
65 static void output(const MachO::PackedVersion &, void *, raw_ostream &);
67 static QuotingType mustQuote(StringRef);
68};
69
70template <> struct ScalarTraits<SwiftVersion> {
71 static void output(const SwiftVersion &, void *, raw_ostream &);
72 static StringRef input(StringRef, void *, SwiftVersion &);
73 static QuotingType mustQuote(StringRef);
74};
75
76template <> struct ScalarTraits<UUID> {
77 static void output(const UUID &, void *, raw_ostream &);
78 static StringRef input(StringRef, void *, UUID &);
79 static QuotingType mustQuote(StringRef);
80};
81
82} // end namespace yaml.
83} // end namespace llvm.
84
85#endif // LLVM_TEXTAPI_TEXT_STUB_COMMON_H
std::pair< llvm::MachO::Target, std::string > UUID
#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
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 &)