diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-09-11 09:33:46 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-09-11 14:06:02 -0700 |
| commit | 2055d540c5dd420448a6924d784d5aed0efcd93d (patch) | |
| tree | 29167b8abb5001cd3c2803807ec5c8eb3bc2329f /source/slang/expr-defs.h | |
| parent | 80fb7b05b851e645d821331fdbbcea1add686c9a (diff) | |
Support IR-based codegen for a few more examples.
The main interesting change here is around support for lowering of calls to "subscript" operations (what a C++ programmer would think of as `operator[]`).
An important infrastructure change here was to add an explicit AST-node representation for a "static member expression" which we use whenever a member is looked up in a type as opposed to a value. The implementation of this probably isn't robust yet, but it turns out to be important to be able to tell such cases apart.
Diffstat (limited to 'source/slang/expr-defs.h')
| -rw-r--r-- | source/slang/expr-defs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/expr-defs.h b/source/slang/expr-defs.h index 5821bddc3..81e8d9275 100644 --- a/source/slang/expr-defs.h +++ b/source/slang/expr-defs.h @@ -90,6 +90,11 @@ SYNTAX_CLASS(MemberExpr, DeclRefExpr) SYNTAX_FIELD(RefPtr<Expr>, BaseExpression) END_SYNTAX_CLASS() +// Member looked up on a type, rather than a value +SYNTAX_CLASS(StaticMemberExpr, DeclRefExpr) + SYNTAX_FIELD(RefPtr<Expr>, BaseExpression) +END_SYNTAX_CLASS() + SYNTAX_CLASS(SwizzleExpr, Expr) SYNTAX_FIELD(RefPtr<Expr>, base) FIELD(int, elementCount) |
