Skip to content

Commit 3b50946

Browse files
committed
Revert unnecessary changes.
1 parent 20b6d34 commit 3b50946

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4245,19 +4245,9 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) {
42454245
return LangAS::sycl_local;
42464246
}
42474247

4248-
if (LangOpts.SYCLIsDevice) {
4249-
AddrSpace = !D || (D->getType().getAddressSpace() == LangAS::Default)
4250-
? LangAS::sycl_global
4251-
: D->getType().getAddressSpace();
4252-
assert(AddrSpace == LangAS::sycl_global ||
4253-
AddrSpace == LangAS::sycl_global_device ||
4254-
AddrSpace == LangAS::sycl_global_host ||
4255-
AddrSpace == LangAS::opencl_constant ||
4256-
AddrSpace == LangAS::sycl_local ||
4257-
AddrSpace == LangAS::sycl_private ||
4258-
AddrSpace >= LangAS::FirstTargetAddressSpace);
4259-
return AddrSpace;
4260-
}
4248+
if (LangOpts.SYCLIsDevice &&
4249+
(!D || D->getType().getAddressSpace() == LangAS::Default))
4250+
return LangAS::sycl_global;
42614251

42624252
if (LangOpts.CUDA && LangOpts.CUDAIsDevice) {
42634253
if (D && D->hasAttr<CUDAConstantAttr>())

clang/lib/CodeGen/TargetInfo.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ LangAS TargetCodeGenInfo::getGlobalVarAddressSpace(CodeGenModule &CGM,
460460
const VarDecl *D) const {
461461
assert(!CGM.getLangOpts().OpenCL &&
462462
!(CGM.getLangOpts().CUDA && CGM.getLangOpts().CUDAIsDevice) &&
463-
!(CGM.getLangOpts().SYCLIsDevice) &&
464463
"Address space agnostic languages only");
465464
return D ? D->getType().getAddressSpace() : LangAS::Default;
466465
}
@@ -9168,7 +9167,6 @@ AMDGPUTargetCodeGenInfo::getGlobalVarAddressSpace(CodeGenModule &CGM,
91689167
const VarDecl *D) const {
91699168
assert(!CGM.getLangOpts().OpenCL &&
91709169
!(CGM.getLangOpts().CUDA && CGM.getLangOpts().CUDAIsDevice) &&
9171-
!(CGM.getLangOpts().SYCLIsDevice) &&
91729170
"Address space agnostic languages only");
91739171
LangAS DefaultGlobalAS = getLangASFromTargetAS(
91749172
CGM.getContext().getTargetAddressSpace(LangAS::opencl_global));

0 commit comments

Comments
 (0)