diff options
| author | Yong He <yonghe@outlook.com> | 2022-06-01 22:29:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-01 22:29:10 -0700 |
| commit | bc6bc56db51d06b92dc63ef9c9e0def6c9760c9e (patch) | |
| tree | 55aae1b64e3c0befe4b424764f6f0064701a9ffe /source/slang/slang-lower-to-ir.cpp | |
| parent | 4f14efc9752d9ebc8538a2e29ed154a00dc99682 (diff) | |
Clean up void returns. (#2260)
* Clean up `IRReturnVoid`.
* Update gitignore.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index 1448139fb..fc8180e12 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -1622,7 +1622,7 @@ struct ValLoweringVisitor : ValVisitor<ValLoweringVisitor, LoweredValInfo, Lower { paramTypes.add(lowerType(context, type->getParamType(pp))); } - if (type->errorType->equals(context->astBuilder->getVoidType())) + if (type->getErrorType()->equals(context->astBuilder->getBottomType())) { return getBuilder()->getFuncType( paramCount, @@ -2838,9 +2838,9 @@ void _lowerFuncDeclBaseTypeInfo( irResultType = builder->getPtrType(irResultType); } - auto errorType = lowerType(context, getErrorCodeType(context->astBuilder, declRef)); - if (errorType->getOp() != kIROp_VoidType) + if (!getErrorCodeType(context->astBuilder, declRef)->equals(context->astBuilder->getBottomType())) { + auto errorType = lowerType(context, getErrorCodeType(context->astBuilder, declRef)); IRAttr* throwTypeAttr = nullptr; throwTypeAttr = builder->getAttr(kIROp_FuncThrowTypeAttr, 1, (IRInst**)&errorType); outInfo.type = builder->getFuncType( |
