LLVM  16.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"
20 #include "llvm/TextAPI/Platform.h"
21 #include "llvm/TextAPI/Target.h"
22 
23 using UUID = std::pair<llvm::MachO::Target, std::string>;
24 
26 LLVM_YAML_STRONG_TYPEDEF(uint8_t, SwiftVersion)
29 
30 namespace llvm {
31 
32 namespace MachO {
33  class ArchitectureSet;
34  class PackedVersion;
35 }
36 namespace yaml {
37 
38 template <> 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 
44 template <> struct ScalarEnumerationTraits<MachO::ObjCConstraintType> {
45  static void enumeration(IO &, MachO::ObjCConstraintType &);
46 };
47 
48 template <> struct ScalarTraits<MachO::PlatformSet> {
49  static void output(const MachO::PlatformSet &, void *, raw_ostream &);
50  static StringRef input(StringRef, void *, MachO::PlatformSet &);
51  static QuotingType mustQuote(StringRef);
52 };
53 
54 template <> struct ScalarBitSetTraits<MachO::ArchitectureSet> {
55  static void bitset(IO &, MachO::ArchitectureSet &);
56 };
57 
58 template <> struct ScalarTraits<MachO::Architecture> {
59  static void output(const MachO::Architecture &, void *, raw_ostream &);
60  static StringRef input(StringRef, void *, MachO::Architecture &);
61  static QuotingType mustQuote(StringRef);
62 };
63 
64 template <> struct ScalarTraits<MachO::PackedVersion> {
65  static void output(const MachO::PackedVersion &, void *, raw_ostream &);
66  static StringRef input(StringRef, void *, MachO::PackedVersion &);
67  static QuotingType mustQuote(StringRef);
68 };
69 
70 template <> 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 
76 template <> 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
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
StringRef.h
output
Current output
Definition: README.txt:1350
Architecture.h
llvm::SmallSet
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
Definition: SmallSet.h:136
Target.h
Platform.h
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
input
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 input
Definition: README.txt:10
llvm::MachO::ObjCConstraintType
ObjCConstraintType
Defines a list of Objective-C constraints.
Definition: InterfaceFile.h:33
llvm::MachO::ArchitectureSet
Definition: ArchitectureSet.h:29
llvm::MachO::Architecture
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
Definition: Architecture.h:27
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR
#define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(type)
LLVM_YAML_STRONG_TYPEDEF
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
UUID
std::pair< llvm::MachO::Target, std::string > UUID
Definition: TextStubCommon.h:23
YAMLTraits.h
llvm::MachO::PackedVersion
Definition: PackedVersion.h:25
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
llvm::MachO::PlatformSet
SmallSet< PlatformType, 3 > PlatformSet
Definition: Platform.h:21
InterfaceFile.h