summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-util.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-11-02 12:12:18 -0700
committerGitHub <noreply@github.com>2022-11-02 12:12:18 -0700
commit2e1c15f36b42374455228e37885bdb221f302050 (patch)
tree57ab722b87e1ef327860e4293bad9edc53bba965 /source/slang/slang-ir-util.cpp
parentfb29bd32cc3404455ff92916a91c517823f486dd (diff)
Rework differential conformance dictionary checking. (#2483)
* Rework differential conformance dictionary checking. * Revert space changes. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp
index 1f13eb754..214f10ef9 100644
--- a/source/slang/slang-ir-util.cpp
+++ b/source/slang/slang-ir-util.cpp
@@ -66,5 +66,38 @@ bool isComInterfaceType(IRType* type)
return false;
}
+IROp getTypeStyle(IROp op)
+{
+ switch (op)
+ {
+ case kIROp_VoidType:
+ case kIROp_BoolType:
+ {
+ return op;
+ }
+ case kIROp_Int8Type:
+ case kIROp_Int16Type:
+ case kIROp_IntType:
+ case kIROp_UInt8Type:
+ case kIROp_UInt16Type:
+ case kIROp_UIntType:
+ case kIROp_Int64Type:
+ case kIROp_UInt64Type:
+ case kIROp_IntPtrType:
+ case kIROp_UIntPtrType:
+ {
+ // All int like
+ return kIROp_IntType;
+ }
+ case kIROp_HalfType:
+ case kIROp_FloatType:
+ case kIROp_DoubleType:
+ {
+ // All float like
+ return kIROp_FloatType;
+ }
+ default: return kIROp_Invalid;
+ }
+}
}