LLVM 22.0.0git
|
This class should be specialized by any type that can be represented as a scalar, map, or sequence, decided dynamically. More...
#include "llvm/Support/YAMLTraits.h"
This class should be specialized by any type that can be represented as a scalar, map, or sequence, decided dynamically.
For example:
typedef std::unique_ptr<MyBase> MyPoly;
template<> struct PolymorphicTraits<MyPoly> { static NodeKind getKind(const MyPoly &poly) { return poly->getKind(); } static MyScalar& getAsScalar(MyPoly &poly) { if (!poly || !isa<MyScalar>(poly)) poly.reset(new MyScalar()); return *cast<MyScalar>(poly.get()); } // ... };
Definition at line 295 of file YAMLTraits.h.