From 5b2eb06816521cc0fcfe03258452560bd200002d Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 21 Sep 2023 14:00:48 -0700 Subject: Various slangpy fixes. (#3227) * Make dynamic cast transparent through `IRAttributedType`. * Add [CUDAXxx] variant of attributes. * Support marshaling of vector types. * Wrap cuda kernels in `extern "C"` block. --------- Co-authored-by: Yong He --- source/slang/slang-ir.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 95d6c9e1f..ff6c8c39e 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -304,12 +304,12 @@ namespace Slang IRParam* IRParam::getNextParam() { - return as(getNextInst()); + return as(getNextInst()); } IRParam* IRParam::getPrevParam() { - return as(getPrevInst()); + return as(getPrevInst()); } // IRArrayTypeBase @@ -472,7 +472,7 @@ namespace Slang // If the last instruction is a parameter, then // there are no ordinary instructions, so the last // one is a null pointer. - if (as(inst)) + if (as(inst)) return nullptr; // Otherwise the last instruction is the last "ordinary" @@ -1643,8 +1643,8 @@ namespace Slang // instructions, so they need to come after // any parameters of the parent. // - while(auto param = as(insertBeforeInst)) - insertBeforeInst = param->getNextInst(); + while (insertBeforeInst && insertBeforeInst->getOp() == kIROp_Param) + insertBeforeInst = insertBeforeInst->getNextInst(); // For instructions that will be placed at module scope, // we don't care about relative ordering, but for everything @@ -6425,14 +6425,14 @@ namespace Slang // First walk through any `param` instructions, // so that we can format them nicely - if (auto firstParam = as(inst)) + if (auto firstParam = as(inst)) { dump(context, "(\n"); context->indent += 2; for(;;) { - auto param = as(inst); + auto param = as(inst); if (!param) break; -- cgit v1.2.3