diff --git a/source/slang/slang-ir.h b/source/slang/slang-ir.h index 01a3333aa1..0ce249919a 100644 --- a/source/slang/slang-ir.h +++ b/source/slang/slang-ir.h @@ -597,7 +597,8 @@ struct IRInst template T* getNextChildOfType(IRInst* child = nullptr) { - for (IRInst* cc = child ? child->getNextInst() : getFirstDecorationOrChild(); cc != nullptr; cc = cc->getNextInst()) + for (IRInst* cc = child ? child->getNextInst() : getFirstDecorationOrChild(); cc != nullptr; + cc = cc->getNextInst()) { if (T* cct = as(cc)) return cct; @@ -792,10 +793,11 @@ struct IRInst void removeOperand(Index index); /// Transfer any decorations of this instruction to the `target` instruction. - // TODO: rewrite as transferDecorationsTo(target) -> transferChildrenOfTypeTo(target) + // TODO: rewrite as transferDecorationsTo(target) -> + // transferChildrenOfTypeTo(target) void transferDecorationsTo(IRInst* target); - template + template void transferChildrenOfTypeTo(IRInst* target) { for (T* cc = getNextChildOfType(); cc != nullptr; cc = getNextChildOfType(cc)) diff --git a/source/slang/slang-legalize-types.cpp b/source/slang/slang-legalize-types.cpp index a65e2645d0..55eaa0e252 100644 --- a/source/slang/slang-legalize-types.cpp +++ b/source/slang/slang-legalize-types.cpp @@ -488,9 +488,11 @@ struct TupleTypeBuilder // TODO: shallow clone of modifiers, etc. IRStructField* originalField = findStructField(originalStructType, ee.fieldKey); - IRStructField* newField = builder->createStructField(ordinaryStructType, ee.fieldKey, fieldType); + IRStructField* newField = + builder->createStructField(ordinaryStructType, ee.fieldKey, fieldType); // In case the original struct had offsets calculated, transfer those as well. - // The original offsets should still be valid, since we only skip fields of types that aren't representable in memory. + // The original offsets should still be valid, since we only skip fields of types + // that aren't representable in memory. originalField->transferChildrenOfTypeTo(newField); }