diff options
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 10 | 
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp index 90799ed99f3..ba23c493d87 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp @@ -5050,9 +5050,12 @@ void CGOpenMPRuntimeNVPTX::clear() {        QualType Arr2Ty = C.getConstantArrayType(Arr1Ty, Size2, ArrayType::Normal,                                                 /*IndexTypeQuals=*/0);        llvm::Type *LLVMArr2Ty = CGM.getTypes().ConvertTypeForMem(Arr2Ty); +      // FIXME: nvlink does not handle weak linkage correctly (object with the +      // different size are reported as erroneous). +      // Restore CommonLinkage as soon as nvlink is fixed.        auto *GV = new llvm::GlobalVariable(            CGM.getModule(), LLVMArr2Ty, -          /*isConstant=*/false, llvm::GlobalValue::CommonLinkage, +          /*isConstant=*/false, llvm::GlobalValue::InternalLinkage,            llvm::Constant::getNullValue(LLVMArr2Ty),            "_openmp_static_glob_rd_$_");        auto *Replacement = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( @@ -5082,9 +5085,12 @@ void CGOpenMPRuntimeNVPTX::clear() {      QualType StaticTy = C.getRecordType(StaticRD);      llvm::Type *LLVMReductionsBufferTy =          CGM.getTypes().ConvertTypeForMem(StaticTy); +    // FIXME: nvlink does not handle weak linkage correctly (object with the +    // different size are reported as erroneous). +    // Restore CommonLinkage as soon as nvlink is fixed.      auto *GV = new llvm::GlobalVariable(          CGM.getModule(), LLVMReductionsBufferTy, -        /*isConstant=*/false, llvm::GlobalValue::CommonLinkage, +        /*isConstant=*/false, llvm::GlobalValue::InternalLinkage,          llvm::Constant::getNullValue(LLVMReductionsBufferTy),          "_openmp_teams_reductions_buffer_$_");      KernelTeamsReductionPtr->setInitializer(  | 

