From 9ac5c51ae1f0664a9dcb31392894e4f76bdbcf98 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 31 Jul 2020 18:30:10 -0700 Subject: Add [anyValueSize] attribute to interfaces and propagate that in the IR. (#1469) Co-authored-by: Tim Foley --- source/slang/slang-ir.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 32034fec8..fcb039d25 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -2221,14 +2221,16 @@ namespace Slang return (IRStringType*)getType(kIROp_StringType); } - IRAssociatedType* IRBuilder::getAssociatedType() + IRAssociatedType* IRBuilder::getAssociatedType(ArrayView constraintTypes) { - return (IRAssociatedType*)getType(kIROp_AssociatedType); + return (IRAssociatedType*)getType(kIROp_AssociatedType, + constraintTypes.getCount(), + (IRInst**)constraintTypes.getBuffer()); } - IRThisType* IRBuilder::getThisType() + IRThisType* IRBuilder::getThisType(IRInterfaceType* interfaceType) { - return (IRThisType*)getType(kIROp_ThisType); + return (IRThisType*)getType(kIROp_ThisType, interfaceType); } IRRawPointerType* IRBuilder::getRawPointerType() @@ -2246,6 +2248,17 @@ namespace Slang return (IRRTTIType*)getType(kIROp_RTTIType); } + IRAnyValueType* IRBuilder::getAnyValueType(IRIntegerValue size) + { + return (IRAnyValueType*)getType(kIROp_AnyValueType, + getIntValue(getIntType(), size)); + } + + IRAnyValueType* IRBuilder::getAnyValueType(IRInst* size) + { + return (IRAnyValueType*)getType(kIROp_AnyValueType, size); + } + IRBasicBlockType* IRBuilder::getBasicBlockType() { return (IRBasicBlockType*)getType(kIROp_BasicBlockType); -- cgit v1.2.3