diff options
| author | Yong He <yonghe@outlook.com> | 2020-07-31 18:30:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-31 18:30:10 -0700 |
| commit | 9ac5c51ae1f0664a9dcb31392894e4f76bdbcf98 (patch) | |
| tree | 17fb1e6989a19f93cd84f9ef45cc1744bf19450a /source/slang/slang-ir.cpp | |
| parent | bb42514acc03a476a93ae82fa0cc9d02dce86239 (diff) | |
Add [anyValueSize] attribute to interfaces and propagate that in the IR. (#1469)
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
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<IRInterfaceType*> 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); |
