10 #ifndef LLVM_SUPPORT_YAMLTRAITS_H
11 #define LLVM_SUPPORT_YAMLTRAITS_H
32 #include <system_error>
33 #include <type_traits>
166 template <
typename T>
215 template <
typename T>
222 template <
typename T>
231 template <
typename U>
234 template <
typename U>
235 static double test(...);
239 (
sizeof(test<ScalarEnumerationTraits<T>>(
nullptr)) == 1);
248 template <
typename U>
251 template <
typename U>
252 static double test(...);
255 static bool const value = (
sizeof(test<ScalarBitSetTraits<T>>(
nullptr)) == 1);
266 template <
typename U>
271 template <
typename U>
272 static double test(...);
276 (
sizeof(test<ScalarTraits<T>>(
nullptr,
nullptr,
nullptr)) == 1);
286 template <
typename U>
290 template <
typename U>
291 static double test(...);
295 (
sizeof(test<BlockScalarTraits<T>>(
nullptr,
nullptr)) == 1);
302 template <
typename U>
305 template <
typename U>
306 static double test(...);
310 (
sizeof(test<MappingContextTraits<T, Context>>(
nullptr)) == 1);
317 template <
typename U>
320 template <
typename U>
static double test(...);
323 static bool const value = (
sizeof(test<MappingTraits<T>>(
nullptr)) == 1);
330 template <
typename U>
333 template <
typename U>
334 static double test(...);
338 (
sizeof(test<MappingContextTraits<T, Context>>(
nullptr)) == 1);
345 template <
typename U>
348 template <
typename U>
static double test(...);
351 static bool const value = (
sizeof(test<MappingTraits<T>>(
nullptr)) == 1);
360 template <
typename U>
363 template <
typename U>
364 static double test(...);
367 static bool const value = (
sizeof(test<SequenceTraits<T>>(
nullptr)) == 1);
376 template <
typename U>
379 template <
typename U>
380 static double test(...);
384 (
sizeof(test<CustomMappingTraits<T>>(
nullptr)) == 1);
390 template <typename T, bool Enabled = std::is_class<T>::value>
403 struct Fallback {
bool flow; };
404 struct Derived :
T, Fallback { };
410 static char (&f(...))[2];
413 static bool const value =
sizeof(f<Derived>(
nullptr)) == 2;
419 has_SequenceMethodTraits<T>::value > { };
427 template <
typename U>
430 template <
typename U>
431 static double test(...);
434 static bool const value = (
sizeof(test<DocumentListTraits<T>>(
nullptr))==1);
438 static const char OctalChars[] =
"01234567";
447 static const char HexChars[] =
"0123456789abcdefABCDEF";
452 static const char DecChars[] =
"0123456789";
459 Regex FloatMatcher(
"^(\\.[0-9]+|[0-9]+(\\.[0-9]*)?)([eE][-+]?[0-9]+)?$");
460 if (FloatMatcher.
match(S))
492 if (isspace(S.
front()) || isspace(S.
back()))
494 if (S.
front() ==
',')
497 static const char ScalarSafeChars[] =
498 "abcdefghijklmnopqrstuvwxyz"
499 "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-/^., \t";
513 template <
typename T,
typename Context>
515 :
public std::integral_constant<bool,
516 !has_ScalarEnumerationTraits<T>::value &&
517 !has_ScalarBitSetTraits<T>::value &&
518 !has_ScalarTraits<T>::value &&
519 !has_BlockScalarTraits<T>::value &&
520 !has_MappingTraits<T, Context>::value &&
521 !has_SequenceTraits<T>::value &&
522 !has_CustomMappingTraits<T>::value &&
523 !has_DocumentListTraits<T>::value> {};
525 template <
typename T,
typename Context>
527 :
public std::integral_constant<
528 bool, has_MappingTraits<T, Context>::value &&
529 has_MappingValidateTraits<T, Context>::value> {};
531 template <
typename T,
typename Context>
533 :
public std::integral_constant<
534 bool, has_MappingTraits<T, Context>::value &&
535 !has_MappingValidateTraits<T, Context>::value> {};
540 IO(
void *Ctxt=
nullptr);
559 virtual bool preflightKey(
const char*,
bool,
bool,
bool &,
void *&) = 0;
561 virtual std::vector<StringRef>
keys() = 0;
580 template <
typename T>
588 template <
typename T>
595 template <
typename FBT,
typename T>
600 FBT Res =
static_cast<typename FBT::BaseType
>(Val);
601 yamlize(*
this, Res,
true, Context);
602 Val =
static_cast<T>(
static_cast<typename FBT::BaseType
>(Res));
606 template <
typename T>
609 Val = Val | ConstVal;
614 template <
typename T>
617 Val = Val | ConstVal;
621 template <
typename T>
624 Val = Val | ConstVal;
627 template <
typename T>
631 Val = Val | ConstVal;
639 this->processKey(Key, Val,
true, Ctx);
641 template <
typename T,
typename Context>
643 this->processKey(Key, Val,
true, Ctx);
651 template <
typename T>
657 template <
typename T,
typename Context>
658 typename std::enable_if<has_SequenceTraits<T>::value,
void>::type
663 this->processKey(Key, Val,
false, Ctx);
666 template <
typename T,
typename Context>
668 this->processKeyWithDefault(Key, Val,
Optional<T>(),
false,
672 template <
typename T,
typename Context>
673 typename std::enable_if<!has_SequenceTraits<T>::value,
void>::type
675 this->processKey(Key, Val,
false, Ctx);
678 template <
typename T,
typename Context>
681 this->processKeyWithDefault(Key, Val, Default,
false, Ctx);
685 template <
typename T,
typename Context>
686 void processKeyWithDefault(
const char *Key,
Optional<T> &Val,
690 "Optional<T> shouldn't have a value!");
696 if (this->
preflightKey(Key, Required, sameAsDefault, UseDefault,
706 template <
typename T,
typename Context>
707 void processKeyWithDefault(
const char *Key,
T &Val,
const T &DefaultValue,
711 const bool sameAsDefault =
outputting() && Val == DefaultValue;
712 if ( this->
preflightKey(Key, Required, sameAsDefault, UseDefault,
714 yamlize(*
this, Val, Required, Ctx);
723 template <
typename T,
typename Context>
724 void processKey(
const char *Key,
T &Val,
bool Required,
Context &Ctx) {
727 if ( this->
preflightKey(Key, Required,
false, UseDefault, SaveInfo) ) {
728 yamlize(*
this, Val, Required, Ctx);
739 template <
typename T,
typename Context>
750 template <
typename T>
751 typename std::enable_if<has_ScalarEnumerationTraits<T>::value,
void>::type
758 template <
typename T>
759 typename std::enable_if<has_ScalarBitSetTraits<T>::value,
void>::type
764 Val =
static_cast<T>(0);
770 template <
typename T>
771 typename std::enable_if<has_ScalarTraits<T>::value,
void>::type
784 if ( !Result.
empty() ) {
790 template <
typename T>
791 typename std::enable_if<has_BlockScalarTraits<T>::value,
void>::type
809 template <
typename T,
typename Context>
810 typename std::enable_if<validatedMappingTraits<T, Context>::value,
void>::type
820 assert(Err.
empty() &&
"invalid struct trying to be written as yaml");
835 template <
typename T,
typename Context>
836 typename std::enable_if<unvalidatedMappingTraits<T, Context>::value,
void>::type
849 template <
typename T>
850 typename std::enable_if<has_CustomMappingTraits<T>::value,
void>::type
864 template <
typename T>
865 typename std::enable_if<missingTraits<T, EmptyContext>::value,
void>::type
870 template <
typename T,
typename Context>
871 typename std::enable_if<has_SequenceTraits<T>::value,
void>::type
993 template <
typename value_type, support::endianness endian,
size_t alignment>
995 value_type, endian, alignment>> {
1019 template <
typename TNorm,
typename TFinal>
1022 : io(i_o), BufPtr(nullptr), Result(Obj) {
1024 BufPtr =
new (&Buffer) TNorm(io, Obj);
1027 BufPtr =
new (&Buffer) TNorm(io);
1033 Result = BufPtr->denormalize(io);
1051 template <
typename TNorm,
typename TFinal>
1055 : io(i_o), BufPtr(nullptr), Result(Obj) {
1057 BufPtr =
new (&Buffer) TNorm(io, Obj);
1059 else if (allocator) {
1060 BufPtr = allocator->
Allocate<TNorm>();
1061 new (BufPtr) TNorm(io);
1063 BufPtr =
new TNorm(io);
1072 Result = BufPtr->denormalize(io);
1105 void *Ctxt =
nullptr,
1107 void *DiagHandlerCtxt =
nullptr);
1111 std::error_code
error();
1114 bool outputting()
override;
1116 void beginMapping()
override;
1117 void endMapping()
override;
1118 bool preflightKey(
const char *,
bool,
bool,
bool &,
void *&)
override;
1119 void postflightKey(
void *)
override;
1120 std::vector<StringRef> keys()
override;
1121 void beginFlowMapping()
override;
1122 void endFlowMapping()
override;
1123 unsigned beginSequence()
override;
1124 void endSequence()
override;
1125 bool preflightElement(
unsigned index,
void *&)
override;
1126 void postflightElement(
void *)
override;
1127 unsigned beginFlowSequence()
override;
1128 bool preflightFlowElement(
unsigned ,
void *&)
override;
1129 void postflightFlowElement(
void *)
override;
1130 void endFlowSequence()
override;
1131 void beginEnumScalar()
override;
1132 bool matchEnumScalar(
const char*,
bool)
override;
1133 bool matchEnumFallback()
override;
1134 void endEnumScalar()
override;
1135 bool beginBitSetScalar(
bool &)
override;
1136 bool bitSetMatch(
const char *,
bool )
override;
1137 void endBitSetScalar()
override;
1138 void scalarString(
StringRef &,
bool)
override;
1139 void blockScalarString(
StringRef &)
override;
1140 void setError(
const Twine &message)
override;
1141 bool canElideEmptySequence()
override;
1144 virtual void anchor();
1147 HNode(
Node *n) : _node(n) { }
1148 virtual ~HNode() =
default;
1150 static inline bool classof(
const HNode *) {
return true; }
1155 class EmptyHNode :
public HNode {
1156 void anchor()
override;
1159 EmptyHNode(
Node *n) : HNode(n) { }
1161 static inline bool classof(
const HNode *n) {
1165 static inline bool classof(
const EmptyHNode *) {
return true; }
1168 class ScalarHNode :
public HNode {
1169 void anchor()
override;
1174 StringRef value()
const {
return _value; }
1176 static inline bool classof(
const HNode *n) {
1181 static inline bool classof(
const ScalarHNode *) {
return true; }
1187 class MapHNode :
public HNode {
1188 void anchor()
override;
1191 MapHNode(
Node *n) : HNode(n) { }
1193 static inline bool classof(
const HNode *n) {
1197 static inline bool classof(
const MapHNode *) {
return true; }
1205 class SequenceHNode :
public HNode {
1206 void anchor()
override;
1209 SequenceHNode(
Node *n) : HNode(n) { }
1211 static inline bool classof(
const HNode *n) {
1215 static inline bool classof(
const SequenceHNode *) {
return true; }
1217 std::vector<std::unique_ptr<HNode>> Entries;
1220 std::unique_ptr<Input::HNode> createHNodes(
Node *node);
1221 void setError(HNode *hnode,
const Twine &message);
1222 void setError(
Node *node,
const Twine &message);
1235 std::unique_ptr<llvm::yaml::Stream> Strm;
1236 std::unique_ptr<HNode> TopNode;
1240 std::vector<bool> BitValuesUsed;
1242 bool ScalarMatchFound;
1258 bool preflightKey(
const char *key,
bool,
bool,
bool &,
void *&)
override;
1260 std::vector<StringRef>
keys()
override;
1293 void newLineCheck();
1294 void outputNewLine();
1311 int ColumnAtFlowStart;
1312 int ColumnAtMapFlowStart;
1313 bool NeedBitValueComma;
1314 bool NeedFlowSequenceComma;
1315 bool EnumerationMatchFound;
1327 #define LLVM_YAML_STRONG_TYPEDEF(_base, _type) \
1329 _type() = default; \
1330 _type(const _base v) : value(v) {} \
1331 _type(const _type &v) = default; \
1332 _type &operator=(const _type &rhs) = default; \
1333 _type &operator=(const _base &rhs) { value = rhs; return *this; } \
1334 operator const _base & () const { return value; } \
1335 bool operator==(const _type &rhs) const { return value == rhs.value; } \
1336 bool operator==(const _base &rhs) const { return value == rhs; } \
1337 bool operator<(const _type &rhs) const { return value < rhs.value; } \
1339 typedef _base BaseType; \
1380 template <
typename T>
1382 typename std::enable_if<has_DocumentListTraits<T>::value, Input &>::type
1397 template <
typename T>
1398 inline typename std::enable_if<has_MappingTraits<T, EmptyContext>::value,
1403 yamlize(yin, docMap,
true, Ctx);
1409 template <
typename T>
1411 typename std::enable_if<has_SequenceTraits<T>::value, Input &>::type
1415 yamlize(yin, docSeq,
true, Ctx);
1420 template <
typename T>
1422 typename std::enable_if<has_BlockScalarTraits<T>::value, Input &>::type
1431 template <
typename T>
1433 typename std::enable_if<has_CustomMappingTraits<T>::value, Input &>::type
1442 template <
typename T>
1443 inline typename std::enable_if<missingTraits<T, EmptyContext>::value,
1451 template <
typename T>
1453 typename std::enable_if<has_DocumentListTraits<T>::value, Output &>::type
1470 template <
typename T>
1471 inline typename std::enable_if<has_MappingTraits<T, EmptyContext>::value,
1477 yamlize(yout, map,
true, Ctx);
1485 template <
typename T>
1487 typename std::enable_if<has_SequenceTraits<T>::value, Output &>::type
1492 yamlize(yout, seq,
true, Ctx);
1500 template <
typename T>
1502 typename std::enable_if<has_BlockScalarTraits<T>::value, Output &>::type
1515 template <
typename T>
1517 typename std::enable_if<has_CustomMappingTraits<T>::value, Output &>::type
1530 template <
typename T>
1531 inline typename std::enable_if<missingTraits<T, EmptyContext>::value,
1542 if (index >= seq.size())
1543 seq.resize(index + 1);
1565 #define LLVM_YAML_IS_SEQUENCE_VECTOR(_type) \
1569 struct SequenceTraits<std::vector<_type>> \
1570 : public SequenceTraitsImpl<std::vector<_type>> {}; \
1571 template <unsigned N> \
1572 struct SequenceTraits<SmallVector<_type, N>> \
1573 : public SequenceTraitsImpl<SmallVector<_type, N>> {}; \
1584 #define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(_type) \
1587 template <unsigned N> \
1588 struct SequenceTraits<SmallVector<_type, N>> \
1589 : public SequenceTraitsImpl<SmallVector<_type, N>> { \
1590 static const bool flow = true; \
1592 template <typename Allocator> \
1593 struct SequenceTraits<std::vector<_type, Allocator>> \
1594 : public SequenceTraitsImpl<std::vector<_type, Allocator>> { \
1595 static const bool flow = true; \
1602 #define LLVM_YAML_IS_DOCUMENT_LIST_VECTOR(_type) \
1605 template <unsigned N> \
1606 struct DocumentListTraits<SmallVector<_type, N>> \
1607 : public SequenceTraitsImpl<SmallVector<_type, N>> {}; \
1609 struct DocumentListTraits<std::vector<_type>> \
1610 : public SequenceTraitsImpl<std::vector<_type>> {}; \
1616 #define LLVM_YAML_IS_STRING_MAP(_type) \
1620 struct CustomMappingTraits<std::map<std::string, _type>> \
1621 : public StdMapStringCustomMappingTraitsImpl<_type> {}; \
1625 #endif // LLVM_SUPPORT_YAMLTRAITS_H
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
static bool classof(const Node *N)
void setError(const Twine &message) override
static char test(SameType< Signature_input,&U::input > *, SameType< Signature_output,&U::output > *)
static bool mustQuote(StringRef)
static bool mustQuote(StringRef Str)
static void output(IO &io, map_type &v)
static char test(SameType< Signature_enumeration,&U::enumeration > *)
void bitSetCase(T &Val, const char *Str, const T ConstVal)
bool preflightElement(unsigned, void *&) override
bool preflightDocument(unsigned)
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static bool mustQuote(StringRef S)
void mapOptional(const char *Key, T &Val)
static bool mustQuote(StringRef)
virtual bool beginBitSetScalar(bool &)=0
void maskedBitSetCase(T &Val, const char *Str, T ConstVal, T Mask)
static char test(SameType< Signature_input,&U::input > *, SameType< Signature_output,&U::output > *, SameType< Signature_mustQuote,&U::mustQuote > *)
static _type & element(IO &io, T &seq, size_t index)
virtual bool preflightFlowElement(unsigned, void *&)=0
void(* Signature_input)(IO &io, StringRef key, T &v)
static bool mustQuote(StringRef)
static size_t size(IO &io, T &seq)
void beginMapping() override
virtual void endFlowMapping()=0
void(* Signature_enumeration)(class IO &, T &)
virtual void scalarString(StringRef &, bool)=0
void endFlowMapping() override
void endSequence() override
void enumCase(T &Val, const char *Str, const uint32_t ConstVal)
virtual void endEnumScalar()=0
static char test(SameType< Signature_size,&U::size > *)
bool needsQuotes(StringRef S)
static bool mustQuote(StringRef)
static bool classof(const Node *N)
LLVM_NODISCARD char back() const
back - Get the last character in the string.
static char test(SameType< Signature_validate,&U::validate > *)
virtual void setError(const Twine &)=0
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
virtual bool matchEnumFallback()=0
virtual void postflightElement(void *)=0
virtual unsigned beginSequence()=0
StringRef(* Signature_validate)(class IO &, T &, Context &)
This class should be specialized by any type that needs to be converted to/from a YAML sequence...
void beginFlowMapping() override
static bool mustQuote(StringRef)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void postflightElement(void *) override
void maskedBitSetCase(T &Val, const char *Str, uint32_t ConstVal, uint32_t Mask)
static bool classof(const Node *N)
bool matchEnumScalar(const char *, bool) override
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
Output(llvm::raw_ostream &, void *Ctxt=nullptr, int WrapColumn=70)
std::enable_if< has_SequenceTraits< T >::value, void >::type mapOptionalWithContext(const char *Key, T &Val, Context &Ctx)
virtual bool preflightElement(unsigned, void *&)=0
void scalarString(StringRef &, bool) override
bool matchEnumFallback() override
void(* Signature_mapping)(class IO &, T &, Context &)
void enumFallback(T &Val)
bool beginBitSetScalar(bool &) override
static StringRef input(StringRef Str, void *Ctx, endian_type &E)
This class should be specialized by any type that needs to be converted to/from a YAML mapping...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
const T & getValue() const LLVM_LVALUE_FUNCTION
bool outputting() override
StringRef(* Signature_input)(StringRef, void *, T &)
void bitSetCase(T &Val, const char *Str, const uint32_t ConstVal)
auto count(R &&Range, const E &Element) -> typename std::iterator_traits< decltype(std::begin(Range))>::difference_type
Wrapper function around std::count to count the number of times an element Element occurs in the give...
bool(* Signature_mustQuote)(StringRef)
static void output(const endian_type &E, void *Ctx, llvm::raw_ostream &Stream)
LLVM_NODISCARD char front() const
front - Get the first character in the string.
std::vector< StringRef > keys() override
static bool mustQuote(StringRef)
std::enable_if< has_DocumentListTraits< T >::value, Output & >::type operator<<(Output &yout, T &docList)
virtual bool mapTag(StringRef Tag, bool Default=false)=0
bool mapTag(StringRef, bool) override
static bool classof(const Node *N)
void(* Signature_output)(const T &, void *, llvm::raw_ostream &)
static bool mustQuote(StringRef)
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
std::enable_if< has_DocumentListTraits< T >::value, Input & >::type operator>>(Input &yin, T &docList)
void endMapping() override
void enumCase(T &Val, const char *Str, const T ConstVal)
virtual void endFlowSequence()=0
void postflightDocument()
size_t(* Signature_size)(class IO &, T &)
Allocate memory in an ever growing pool, as if by bump-pointer.
virtual void beginEnumScalar()=0
void postflightFlowElement(void *) override
This class should be specialized by any type that needs to be converted to/from a list of YAML docume...
static char test(SameType< Signature_input,&U::inputOne > *)
static bool mustQuote(StringRef)
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, size_t Alignment)
Allocate space at the specified alignment.
void(* DiagHandlerTy)(const SMDiagnostic &, void *Context)
Clients that want to handle their own diagnostics in a custom way can register a function pointer+con...
This class is similar to MappingTraits<T> but allows you to pass in additional context for each map o...
This class should be specialized by any type that needs to be converted to/from a YAML mapping in the...
static bool mustQuote(StringRef)
virtual bool preflightKey(const char *, bool, bool, bool &, void *&)=0
virtual bool canElideEmptySequence()=0
static char test(SameType< Signature_mapping,&U::mapping > *)
void doMapping(IO &io, T &Val, Context &Ctx)
virtual void blockScalarString(StringRef &)=0
virtual void endBitSetScalar()=0
support::detail::packed_endian_specific_integral< value_type, endian, alignment > endian_type
void endFlowSequence() override
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
bool preflightKey(const char *key, bool, bool, bool &, void *&) override
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
The Output class is used to generate a yaml document from in-memory structs and vectors.
LLVM_NODISCARD size_t find_first_not_of(char C, size_t From=0) const
Find the first character in the string that is not C or npos if not found.
std::string & str()
Flushes the stream contents to the target string and returns the string's reference.
void mapOptionalWithContext(const char *Key, T &Val, const T &Default, Context &Ctx)
virtual void beginMapping()=0
MappingNormalizationHeap(IO &i_o, TFinal &Obj, llvm::BumpPtrAllocator *allocator)
MappingNormalization(IO &i_o, TFinal &Obj)
static bool mustQuote(StringRef)
std::map< std::string, T > map_type
This class should be specialized by any integral type that converts to/from a YAML scalar where there...
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
YAML I/O does conversion based on types.
bool preflightFlowElement(unsigned, void *&) override
virtual std::vector< StringRef > keys()=0
static void inputOne(IO &io, StringRef key, map_type &v)
This class represents a YAML stream potentially containing multiple documents.
virtual bool bitSetMatch(const char *, bool)=0
This class should be specialized by type that requires custom conversion to/from a yaml scalar...
void endBitSetScalar() override
bool bitSetMatch(const char *, bool) override
static bool mustQuote(StringRef)
iterator_range< detail::value_sequence_iterator< ValueT > > seq(ValueT Begin, ValueT End)
virtual void postflightKey(void *)=0
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
virtual void beginFlowMapping()=0
static bool mustQuote(StringRef S)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
virtual unsigned beginFlowSequence()=0
unsigned beginFlowSequence() override
static char test(SameType< Signature_bitset,&U::bitset > *)
bool isNumber(StringRef S)
void(* Signature_bitset)(class IO &, T &)
static bool classof(const Node *N)
This class should be specialized by type that requires custom conversion to/from a YAML literal block...
size_t(* Signature_size)(class IO &, T &)
virtual void endMapping()=0
virtual void postflightFlowElement(void *)=0
std::enable_if< has_ScalarEnumerationTraits< T >::value, void >::type yamlize(IO &io, T &Val, bool, EmptyContext &Ctx)
virtual bool matchEnumScalar(const char *, bool)=0
void mapOptionalWithContext(const char *Key, Optional< T > &Val, Context &Ctx)
virtual bool outputting()=0
~MappingNormalizationHeap()
This class should be specialized by any integer type that is a union of bit values and the YAML repre...
Iterator abstraction for Documents over a Stream.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool mustQuote(StringRef)
static bool mustQuote(StringRef)
static bool mustQuote(StringRef)
void mapOptional(const char *Key, T &Val, const T &Default)
A raw_ostream that writes to an std::string.
virtual void endSequence()=0
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
void beginEnumScalar() override
unsigned beginSequence() override
This class implements an extremely fast bulk output stream that can only output to a stream...
Implementation of CustomMappingTraits for std::map<std::string, T>.
bool match(StringRef String, SmallVectorImpl< StringRef > *Matches=nullptr)
matches - Match the regex against a given String.
void mapRequired(const char *Key, T &Val, Context &Ctx)
StringRef - Represent a constant reference to a string, i.e.
void mapRequired(const char *Key, T &Val)
std::enable_if<!has_SequenceTraits< T >::value, void >::type mapOptionalWithContext(const char *Key, T &Val, Context &Ctx)
void endEnumScalar() override
void(* Signature_output)(const T &, void *, llvm::raw_ostream &)
static bool mustQuote(StringRef)
void postflightKey(void *) override
void blockScalarString(StringRef &) override
static char test(SameType< Signature_size,&U::size > *)
StringRef(* Signature_input)(StringRef, void *, T &)
bool canElideEmptySequence() override
bool isNumeric(StringRef S)
Abstract base class for all Nodes.