1 //===- llvm/TextAPI/TextStubCommon.h - Text Stub Common ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 /// \brief Defines common Text Stub YAML mappings.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_TEXTAPI_TEXT_STUB_COMMON_H
16 #define LLVM_TEXTAPI_TEXT_STUB_COMMON_H
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/ADT/StringSwitch.h"
20 #include "llvm/Support/YAMLTraits.h"
21 #include "llvm/TextAPI/MachO/Architecture.h"
22 #include "llvm/TextAPI/MachO/ArchitectureSet.h"
23 #include "llvm/TextAPI/MachO/InterfaceFile.h"
24 #include "llvm/TextAPI/MachO/PackedVersion.h"
26 using UUID = std::pair<llvm::MachO::Architecture, std::string>;
28 LLVM_YAML_STRONG_TYPEDEF(llvm::StringRef, FlowStringRef)
29 LLVM_YAML_STRONG_TYPEDEF(uint8_t, SwiftVersion)
30 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(UUID)
31 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(FlowStringRef)
36 template <> struct ScalarTraits<FlowStringRef> {
37 static void output(const FlowStringRef &, void *, raw_ostream &);
38 static StringRef input(StringRef, void *, FlowStringRef &);
39 static QuotingType mustQuote(StringRef);
42 template <> struct ScalarEnumerationTraits<MachO::ObjCConstraintType> {
43 static void enumeration(IO &, MachO::ObjCConstraintType &);
46 template <> struct ScalarTraits<MachO::PlatformKind> {
47 static void output(const MachO::PlatformKind &, void *, raw_ostream &);
48 static StringRef input(StringRef, void *, MachO::PlatformKind &);
49 static QuotingType mustQuote(StringRef);
52 template <> struct ScalarBitSetTraits<MachO::ArchitectureSet> {
53 static void bitset(IO &, MachO::ArchitectureSet &);
56 template <> struct ScalarTraits<MachO::Architecture> {
57 static void output(const MachO::Architecture &, void *, raw_ostream &);
58 static StringRef input(StringRef, void *, MachO::Architecture &);
59 static QuotingType mustQuote(StringRef);
62 template <> struct ScalarTraits<MachO::PackedVersion> {
63 static void output(const MachO::PackedVersion &, void *, raw_ostream &);
64 static StringRef input(StringRef, void *, MachO::PackedVersion &);
65 static QuotingType mustQuote(StringRef);
68 template <> struct ScalarTraits<SwiftVersion> {
69 static void output(const SwiftVersion &, void *, raw_ostream &);
70 static StringRef input(StringRef, void *, SwiftVersion &);
71 static QuotingType mustQuote(StringRef);
74 template <> struct ScalarTraits<UUID> {
75 static void output(const UUID &, void *, raw_ostream &);
76 static StringRef input(StringRef, void *, UUID &);
77 static QuotingType mustQuote(StringRef);
80 } // end namespace yaml.
81 } // end namespace llvm.
83 #endif // LLVM_TEXTAPI_TEXT_STUB_COMMON_H