summaryrefslogtreecommitdiff
path: root/source/slang/ir.h
diff options
context:
space:
mode:
authorYong He <yongh@outlook.com>2018-01-09 13:26:42 -0800
committerYong He <yonghe@outlook.com>2018-01-12 23:55:38 -0500
commit4b284daeb0cc3f6df0835befad4326c81abeb374 (patch)
treead8d29e14cc483f2eb66bcae7b0f7ffdfd574b86 /source/slang/ir.h
parentdf6eeb93c1718334779ae328db277cdf7a9d7b04 (diff)
Support nested generics
fixes #362
Diffstat (limited to 'source/slang/ir.h')
-rw-r--r--source/slang/ir.h10
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.