From f77a5ac9d1547a4394bba4ab8e94d905972c79b7 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 20 Aug 2024 06:06:34 +0800 Subject: 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 --- source/slang/slang-ir-explicit-global-context.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-ir-explicit-global-context.cpp') 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()) { builder.addNameHintDecoration(var, nameDecor->getName()); -- cgit v1.2.3