diff options
| author | Yong He <yonghe@outlook.com> | 2022-12-07 12:02:30 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 12:02:30 -0800 |
| commit | 3a3a8b5f7701109fc413f42692c4de5769870489 (patch) | |
| tree | 909df4a30e69f33a76e0158d92b1823629dc2184 /source/slang/slang-ir-util.cpp | |
| parent | f116f43bd12358e87f351f0d3615628ac4e00921 (diff) | |
Lower-to-ir no longer produce `Construct` inst. (#2553)
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.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 214f10ef9..5c4590abe 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -100,4 +100,33 @@ IROp getTypeStyle(IROp op) } } +IROp getTypeStyle(BaseType op) +{ + switch (op) + { + case BaseType::Void: + return kIROp_VoidType; + case BaseType::Bool: + return kIROp_BoolType; + case BaseType::Char: + case BaseType::Int8: + case BaseType::Int16: + case BaseType::Int: + case BaseType::Int64: + case BaseType::IntPtr: + case BaseType::UInt8: + case BaseType::UInt16: + case BaseType::UInt: + case BaseType::UInt64: + case BaseType::UIntPtr: + return kIROp_IntType; + case BaseType::Half: + case BaseType::Float: + case BaseType::Double: + return kIROp_FloatType; + default: + return kIROp_Invalid; + } +} + } |
