LLVM  10.0.0svn
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"
17 #include "llvm/ADT/StringSwitch.h"
23 
24 using UUID = std::pair<llvm::MachO::Target, std::string>;
25 
26 LLVM_YAML_STRONG_TYPEDEF(llvm::StringRef, FlowStringRef)
27 LLVM_YAML_STRONG_TYPEDEF(uint8_t, SwiftVersion)
28 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(UUID)
29 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FlowStringRef)
30 
31 namespace llvm {
32 namespace yaml {
33 
34 template <> struct ScalarTraits<FlowStringRef> {
35  static void output(const FlowStringRef &, void *, raw_ostream &);
36  static StringRef input(StringRef, void *, FlowStringRef &);
37  static QuotingType mustQuote(StringRef);
38 };
39 
40 template <> struct ScalarEnumerationTraits<MachO::ObjCConstraintType> {
41  static void enumeration(IO &, MachO::ObjCConstraintType &);
42 };
43 
44 template <> struct ScalarTraits<MachO::PlatformSet> {
45  static void output(const MachO::PlatformSet &, void *, raw_ostream &);
46  static StringRef input(StringRef, void *, MachO::PlatformSet &);
47  static QuotingType mustQuote(StringRef);
48 };
49 
50 template <> struct ScalarBitSetTraits<MachO::ArchitectureSet> {
51  static void bitset(IO &, MachO::ArchitectureSet &);
52 };
53 
54 template <> struct ScalarTraits<MachO::Architecture> {
55  static void output(const MachO::Architecture &, void *, raw_ostream &);
56  static StringRef input(StringRef, void *, MachO::Architecture &);
57  static QuotingType mustQuote(StringRef);
58 };
59 
60 template <> struct ScalarTraits<MachO::PackedVersion> {
61  static void output(const MachO::PackedVersion &, void *, raw_ostream &);
62  static StringRef input(StringRef, void *, MachO::PackedVersion &);
63  static QuotingType mustQuote(StringRef);
64 };
65 
66 template <> struct ScalarTraits<SwiftVersion> {
67  static void output(const SwiftVersion &, void *, raw_ostream &);
68  static StringRef input(StringRef, void *, SwiftVersion &);
69  static QuotingType mustQuote(StringRef);
70 };
71 
72 template <> struct ScalarTraits<UUID> {
73  static void output(const UUID &, void *, raw_ostream &);
74  static StringRef input(StringRef, void *, UUID &);
75  static QuotingType mustQuote(StringRef);
76 };
77 
78 } // end namespace yaml.
79 } // end namespace llvm.
80 
81 #endif // LLVM_TEXTAPI_TEXT_STUB_COMMON_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
SmallSet< PlatformKind, 3 > PlatformSet
Definition: Platform.h:31
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition: SmallSet.h:134
ObjCConstraintType
Defines a list of Objective-C constraints.
Definition: InterfaceFile.h:37
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
Definition: Architecture.h:24
std::pair< llvm::MachO::Target, std::string > UUID
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48