diff options
| author | Yong He <yonghe@outlook.com> | 2018-01-13 13:17:02 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-13 13:17:02 -0800 |
| commit | d4dab2cd3a409411c2d7caed01fc02a0fd3e8450 (patch) | |
| tree | 10c92df406a82e7a5eb24b56c17d9256a7183c44 /source/slang/ir.h | |
| parent | df6eeb93c1718334779ae328db277cdf7a9d7b04 (diff) | |
| parent | 4d2086f47e25aa4545df95ddfd260c8bc5aafdb2 (diff) | |
Merge pull request #364 from csyonghe/assoctype
Support nested generics
Diffstat (limited to 'source/slang/ir.h')
| -rw-r--r-- | source/slang/ir.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/ir.h b/source/slang/ir.h index c56f8fb62..fe6fab5f6 100644 --- a/source/slang/ir.h +++ b/source/slang/ir.h @@ -438,7 +438,15 @@ struct IRFunc : IRGlobalValueWithCode // If this function is generic, then we store a reference // to the AST-level generic that defines its parameters // and their constraints. - RefPtr<GenericDecl> genericDecl; + List<RefPtr<GenericDecl>> genericDecls; + int specializedGenericLevel = -1; + + GenericDecl* getGenericDecl() + { + if (specializedGenericLevel != -1) + return genericDecls[specializedGenericLevel].Ptr(); + return nullptr; + } // Convenience accessors for working with the // function's type. |
