diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-08-07 16:06:58 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-08-15 12:21:08 -0700 |
| commit | 831896f844453ba09c9e6cbfe7d29f6d44282632 (patch) | |
| tree | b3f2bd89ffb324bbdc84e542ef42f8e9b3731c31 /source/slang/visitor.h | |
| parent | e6abc6821a1bf13a9826e7db74362ce34ccaca2a (diff) | |
Starting to add intermediate representation (IR)
Right now none of this is hooked up, but I want to get things checked in incrementally rather than have along long-lived branches.
- Added placeholder declarations for IR representation of instructions, basic blocks, etc.
- Start adding a `lower-to-ir` pass to translate from AST representation to IR
Again: none of this is functional, so it shouldn't mess with existing users of the compiler.
Diffstat (limited to 'source/slang/visitor.h')
| -rw-r--r-- | source/slang/visitor.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/visitor.h b/source/slang/visitor.h index 59c5772f2..8a0301782 100644 --- a/source/slang/visitor.h +++ b/source/slang/visitor.h @@ -34,6 +34,13 @@ struct TypeVisitor : Base return result; } + Result dispatchType(Type* type) + { + Result result; + type->accept(this, &result); + return result; + } + #define ABSTRACT_SYNTAX_CLASS(NAME,BASE) /* empty */ #define SYNTAX_CLASS(NAME, BASE) \ virtual void dispatch_##NAME(NAME* obj, void* extra) override \ @@ -61,6 +68,11 @@ struct TypeVisitor<Derived,void,Base> : Base type->accept(this, 0); } + void dispatchType(Type* type) + { + type->accept(this, 0); + } + #define ABSTRACT_SYNTAX_CLASS(NAME,BASE) /* empty */ #define SYNTAX_CLASS(NAME, BASE) \ virtual void dispatch_##NAME(NAME* obj, void*) override \ |
