diff options
| author | Yong He <yonghe@outlook.com> | 2020-07-10 09:13:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-10 09:13:50 -0700 |
| commit | 2503280122c7ac54cc3e42e2e54efff1d002d126 (patch) | |
| tree | f16d703731801fae2169aa500b6d4cfad2d6fae8 /source/slang/slang-lower-to-ir.cpp | |
| parent | a5a67aae981cb54d535089b167d3edcc3a3a2e29 (diff) | |
Dynamic code gen for generic local variables. (#1434)
* Dynamic code gen for generic local variables.
* Fixes to function calls with generic typed `in` argument.
* Fixes per code review comments
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index adebefc8b..cfed09dd0 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -2198,7 +2198,13 @@ Type* getThisParamTypeForContainer( IRGenContext* context, DeclRef<Decl> parentDeclRef) { - if( auto aggTypeDeclRef = parentDeclRef.as<AggTypeDecl>() ) + if (auto interfaceDeclRef = parentDeclRef.as<InterfaceDecl>()) + { + auto thisType = context->astBuilder->create<ThisType>(); + thisType->interfaceDeclRef = interfaceDeclRef; + return thisType; + } + else if( auto aggTypeDeclRef = parentDeclRef.as<AggTypeDecl>() ) { return DeclRefType::create(context->astBuilder, aggTypeDeclRef); } |
