summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-generics-lowering-context.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-06-01 17:37:07 -0700
committerGitHub <noreply@github.com>2022-06-01 17:37:07 -0700
commit17e3b88b541ed7f45d575f0f9caaa808cd0a6619 (patch)
treeefacd5d4bf6381a5adf8055daa28f91ddc048a76 /source/slang/slang-ir-generics-lowering-context.cpp
parentfa10f7dc23f8b93c0f9ef3fb5477871a20aaa974 (diff)
New language feature: basic error handling. (#2253)
* New language feature: basic error handling. * Fix. * Fix `tryCall` encoding according to code review. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-generics-lowering-context.cpp')
-rw-r--r--source/slang/slang-ir-generics-lowering-context.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/slang/slang-ir-generics-lowering-context.cpp b/source/slang/slang-ir-generics-lowering-context.cpp
index 284e1fa11..bf3b8d855 100644
--- a/source/slang/slang-ir-generics-lowering-context.cpp
+++ b/source/slang/slang-ir-generics-lowering-context.cpp
@@ -36,6 +36,12 @@ namespace Slang
return false;
}
+ bool isComInterfaceType(IRType* type)
+ {
+ return type->findDecoration<IRComInterfaceDecoration>() != nullptr ||
+ type->getOp() == kIROp_ComPtrType;
+ }
+
bool isTypeValue(IRInst* typeInst)
{
if (typeInst)
@@ -175,7 +181,7 @@ namespace Slang
if (isBuiltin(interfaceType))
return (IRType*)paramType;
- if (interfaceType->findDecoration<IRComInterfaceDecoration>())
+ if (isComInterfaceType((IRType*)interfaceType))
return (IRType*)interfaceType;
auto anyValueSize = getInterfaceAnyValueSize(
@@ -192,7 +198,7 @@ namespace Slang
if (isBuiltin(paramType))
return (IRType*)paramType;
- if (paramType->findDecoration<IRComInterfaceDecoration>())
+ if (isComInterfaceType((IRType*)paramType))
return (IRType*)paramType;
// In the dynamic-dispatch case, a value of interface type