[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / lib / TextAPI / TextStubCommon.h
blob89ae5d56297c00a7a72e6447b168be9e28a6a6e4
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.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_TEXTAPI_TEXT_STUB_COMMON_H
14 #define LLVM_TEXTAPI_TEXT_STUB_COMMON_H
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/Support/YAMLTraits.h"
18 #include "llvm/TextAPI/Architecture.h"
19 #include "llvm/TextAPI/ArchitectureSet.h"
20 #include "llvm/TextAPI/InterfaceFile.h"
21 #include "llvm/TextAPI/PackedVersion.h"
23 using UUID = std::pair<llvm::MachO::Target, std::string>;
25 LLVM_YAML_STRONG_TYPEDEF(llvm::StringRef, FlowStringRef)
26 LLVM_YAML_STRONG_TYPEDEF(uint8_t, SwiftVersion)
27 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(UUID)
28 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FlowStringRef)
30 namespace llvm {
31 namespace yaml {
33 template <> struct ScalarTraits<FlowStringRef> {
34 static void output(const FlowStringRef &, void *, raw_ostream &);
35 static StringRef input(StringRef, void *, FlowStringRef &);
36 static QuotingType mustQuote(StringRef);
39 template <> struct ScalarEnumerationTraits<MachO::ObjCConstraintType> {
40 static void enumeration(IO &, MachO::ObjCConstraintType &);
43 template <> struct ScalarTraits<MachO::PlatformSet> {
44 static void output(const MachO::PlatformSet &, void *, raw_ostream &);
45 static StringRef input(StringRef, void *, MachO::PlatformSet &);
46 static QuotingType mustQuote(StringRef);
49 template <> struct ScalarBitSetTraits<MachO::ArchitectureSet> {
50 static void bitset(IO &, MachO::ArchitectureSet &);
53 template <> struct ScalarTraits<MachO::Architecture> {
54 static void output(const MachO::Architecture &, void *, raw_ostream &);
55 static StringRef input(StringRef, void *, MachO::Architecture &);
56 static QuotingType mustQuote(StringRef);
59 template <> struct ScalarTraits<MachO::PackedVersion> {
60 static void output(const MachO::PackedVersion &, void *, raw_ostream &);
61 static StringRef input(StringRef, void *, MachO::PackedVersion &);
62 static QuotingType mustQuote(StringRef);
65 template <> struct ScalarTraits<SwiftVersion> {
66 static void output(const SwiftVersion &, void *, raw_ostream &);
67 static StringRef input(StringRef, void *, SwiftVersion &);
68 static QuotingType mustQuote(StringRef);
71 template <> struct ScalarTraits<UUID> {
72 static void output(const UUID &, void *, raw_ostream &);
73 static StringRef input(StringRef, void *, UUID &);
74 static QuotingType mustQuote(StringRef);
77 } // end namespace yaml.
78 } // end namespace llvm.
80 #endif // LLVM_TEXTAPI_TEXT_STUB_COMMON_H