struct PolymorphicTraits
Declaration
template <typename T>
struct PolymorphicTraits { /* full declaration omitted */ };
Description
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()); } // ... };
Declared at: llvm/include/llvm/Support/YAMLTraits.h:297
Templates
- T