From 622eaa4a4cea17c2cec6942d9702b010deae392b Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 15 Oct 2020 08:38:46 -0400 Subject: [HIP] Support __managed__ attribute This patch implements codegen for __managed__ variable attribute for HIP. Diagnostics will be added later. Differential Revision: https://reviews.llvm.org/D94814 --- clang/lib/CodeGen/CodeGenModule.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index bee51715bdc6..18d633911f55 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -4152,13 +4152,14 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, // Shadows of initialized device-side global variables are also left // undefined. bool IsCUDAShadowVar = - !getLangOpts().CUDAIsDevice && + !getLangOpts().CUDAIsDevice && !D->hasAttr() && (D->hasAttr() || D->hasAttr() || D->hasAttr()); bool IsCUDADeviceShadowVar = getLangOpts().CUDAIsDevice && (D->getType()->isCUDADeviceBuiltinSurfaceType() || - D->getType()->isCUDADeviceBuiltinTextureType()); + D->getType()->isCUDADeviceBuiltinTextureType() || + D->hasAttr()); // HIP pinned shadow of initialized host-side global variables are also // left undefined. if (getLangOpts().CUDA && -- cgit v1.2.3