Skip to content

Commit 1211583

Browse files
committed
[clang][OpenMP] Generate pointer instead of zero element array
Signed-off-by: Nick Sarnie <[email protected]>
1 parent 8706d82 commit 1211583

File tree

6 files changed

+108
-105
lines changed

6 files changed

+108
-105
lines changed

clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,9 +1258,12 @@ void CGOpenMPRuntimeGPU::emitParallelCall(
12581258
// TODO: Is that needed?
12591259
CodeGenFunction::OMPPrivateScope PrivateArgScope(CGF);
12601260

1261+
llvm::Type *CapturedVarsAddrType =
1262+
CapturedVars.size() ? cast<llvm::Type>(llvm::ArrayType::get(
1263+
CGM.VoidPtrTy, CapturedVars.size()))
1264+
: CGM.VoidPtrTy;
12611265
Address CapturedVarsAddrs = CGF.CreateDefaultAlignTempAlloca(
1262-
llvm::ArrayType::get(CGM.VoidPtrTy, CapturedVars.size()),
1263-
"captured_vars_addrs");
1266+
CapturedVarsAddrType, "captured_vars_addrs");
12641267
// There's something to share.
12651268
if (!CapturedVars.empty()) {
12661269
// Prepare for parallel region. Indicate the outlined function.

0 commit comments

Comments
 (0)