summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-explicit-global-context.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-08-20 06:06:34 +0800
committerGitHub <noreply@github.com>2024-08-19 15:06:34 -0700
commitf77a5ac9d1547a4394bba4ab8e94d905972c79b7 (patch)
tree0d66b3c8386d8cb1e75970c93914fe2a60f03c61 /source/slang/slang-ir-explicit-global-context.cpp
parent453683bf44f2112719802eaac2b332d49eebd640 (diff)
Remove using SpvStorageClass values casted into AddressSpace values (#4861)
* Remove using SpvStorageClass values casted into AddressSpace values Also removes support for specific storage classes in __target_intrinsic snippets * remove SLANG_RETURN_NEVER macro * squash warnings * Make nonexhaustive switch statement error on gcc * Add SLANG_EXHAUSTIVE_SWITCH_BEGIN/END macros --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-ir-explicit-global-context.cpp')
-rw-r--r--source/slang/slang-ir-explicit-global-context.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/slang-ir-explicit-global-context.cpp b/source/slang/slang-ir-explicit-global-context.cpp
index 3dc3d3ad4..f68877d7d 100644
--- a/source/slang/slang-ir-explicit-global-context.cpp
+++ b/source/slang/slang-ir-explicit-global-context.cpp
@@ -47,7 +47,7 @@ struct IntroduceExplicitGlobalContextPass
case CodeGenTarget::SPIRVAssembly:
hoistableGlobalObjectKind = GlobalObjectKind::GlobalVar;
requiresFuncTypeCorrectionPass = true;
- addressSpaceOfLocals = (AddressSpace)SpvStorageClassFunction;
+ addressSpaceOfLocals = AddressSpace::Function;
hoistGlobalVarOptions = HoistGlobalVarOptions::PlainGlobal;
break;
case CodeGenTarget::CUDASource:
@@ -284,7 +284,7 @@ struct IntroduceExplicitGlobalContextPass
// The context will usually be passed around by pointer,
// so we get and cache that pointer type up front.
//
- m_contextStructPtrType = builder.getPtrType(kIROp_PtrType, m_contextStructType, (IRIntegerValue)getAddressSpaceOfLocal());
+ m_contextStructPtrType = builder.getPtrType(kIROp_PtrType, m_contextStructType, getAddressSpaceOfLocal());
// The first step will be to create fields in the `KernelContext`
@@ -505,7 +505,7 @@ struct IntroduceExplicitGlobalContextPass
auto fieldInfo = m_mapInstToContextFieldInfo[globalVar];
if (fieldInfo.needDereference)
{
- auto var = builder.emitVar(globalVar->getDataType()->getValueType(), (IRIntegerValue)AddressSpace::GroupShared);
+ auto var = builder.emitVar(globalVar->getDataType()->getValueType(), AddressSpace::GroupShared);
if (auto nameDecor = globalVar->findDecoration<IRNameHintDecoration>())
{
builder.addNameHintDecoration(var, nameDecor->getName());