From 1b8731c809761c4e2dbec81dcee207f8a4621903 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 3 Jun 2020 17:22:48 -0400 Subject: Devirtualize AST types (#1368) * Make getSup work with more general non-virtual 'virtual' mechanism. * WIP: Non virtual AST types. * Project change. * Type doesn't implement equalsImpl * Fix macro invocation Make Overridden functions public to make simply accessible by base types. * Use SLANG_UNEXPECTED. * GetScalarType -> getScalarType Use SLANG_UNEXPECTED instead on ASSERT in NamedExpressionType and TypeType --- source/slang/slang-ast-decl.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 source/slang/slang-ast-decl.cpp (limited to 'source/slang/slang-ast-decl.cpp') diff --git a/source/slang/slang-ast-decl.cpp b/source/slang/slang-ast-decl.cpp new file mode 100644 index 000000000..a10411ebb --- /dev/null +++ b/source/slang/slang-ast-decl.cpp @@ -0,0 +1,21 @@ +// slang-ast-decl.cpp +#include "slang-ast-builder.h" +#include + +#include "slang-ast-generated-macro.h" + +namespace Slang { + +const TypeExp& TypeConstraintDecl::getSup() const +{ + SLANG_AST_NODE_CONST_VIRTUAL_CALL(TypeConstraintDecl, getSup, ()) +} + +const TypeExp& TypeConstraintDecl::_getSupOverride() const +{ + SLANG_UNEXPECTED("TypeConstraintDecl::_getSupOverride not overridden"); + //return TypeExp::empty; +} + + +} // namespace Slang -- cgit v1.2.3