diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-08-15 12:51:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-15 12:51:14 -0700 |
| commit | 6de0a485e09c32cbd0bfead0fbdc5bb6f9aa7040 (patch) | |
| tree | b3f2bd89ffb324bbdc84e542ef42f8e9b3731c31 /source/slang/visitor.h | |
| parent | e6abc6821a1bf13a9826e7db74362ce34ccaca2a (diff) | |
| parent | 831896f844453ba09c9e6cbfe7d29f6d44282632 (diff) | |
Merge pull request #165 from tfoleyNV/ir
Starting to add intermediate representation (IR)
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 \ |
