diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2021-02-16 20:39:22 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2021-02-16 20:39:22 +0000 |
| commit | 9f93bc8bfd2690abd12a830e42a1c26038173ae5 (patch) | |
| tree | 397432940f35d42b709d99d1d23523e7a24296c4 /clang/lib/CodeGen/CGCUDANV.cpp | |
| parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) | |
Vendor import of llvm-project branch release/12.xvendor/llvm-project/llvmorg-12.0.0-rc1-109-gd5d089bf08c9
llvmorg-12.0.0-rc1-109-gd5d089bf08c9.
Diffstat (limited to 'clang/lib/CodeGen/CGCUDANV.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGCUDANV.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCUDANV.cpp b/clang/lib/CodeGen/CGCUDANV.cpp index 33a2d6f4483e..e03631a7243a 100644 --- a/clang/lib/CodeGen/CGCUDANV.cpp +++ b/clang/lib/CodeGen/CGCUDANV.cpp @@ -184,6 +184,14 @@ CGNVCUDARuntime::CGNVCUDARuntime(CodeGenModule &CGM) CharPtrTy = llvm::PointerType::getUnqual(Types.ConvertType(Ctx.CharTy)); VoidPtrTy = cast<llvm::PointerType>(Types.ConvertType(Ctx.VoidPtrTy)); VoidPtrPtrTy = VoidPtrTy->getPointerTo(); + if (CGM.getContext().getAuxTargetInfo()) { + // If the host and device have different C++ ABIs, mark it as the device + // mangle context so that the mangling needs to retrieve the additonal + // device lambda mangling number instead of the regular host one. + DeviceMC->setDeviceMangleContext( + CGM.getContext().getTargetInfo().getCXXABI().isMicrosoft() && + CGM.getContext().getAuxTargetInfo()->getCXXABI().isItaniumFamily()); + } } llvm::FunctionCallee CGNVCUDARuntime::getSetupArgumentFn() const { |
