// The fKind field of IRNode could contain any of these values. enumclass ProgramElementKind {
kExtension = 0,
kFunction,
kFunctionPrototype,
kGlobalVar,
kInterfaceBlock,
kModifiers,
kStructDefinition,
/** * Represents a node in the intermediate representation (IR) tree. The IR is a fully-resolved * version of the program (all types determined, everything validated), ready for code generation.
*/ class IRNode : public Poolable { public: virtual ~IRNode() {}
virtual std::string description() const = 0;
// No copy construction or assignment
IRNode(const IRNode&) = delete;
IRNode& operator=(const IRNode&) = delete;
// Position of this element within the program being compiled, for error reporting purposes.
Position fPosition;
Position position() const { return fPosition;
}
void setPosition(Position p) {
fPosition = p;
}
/** * Use is<T> to check the type of an IRNode. * e.g. replace `s.kind() == Statement::Kind::kReturn` with `s.is<ReturnStatement>()`.
*/ template <typename T> bool is() const { return this->fKind == (int)T::kIRNodeKind;
}
/** * Use as<T> to downcast IRNodes. * e.g. replace `(ReturnStatement&) s` with `s.as<ReturnStatement>()`.
*/ template <typename T> const T& as() const {
SkASSERT(this->is<T>()); returnstatic_cast<const T&>(*this);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.