]> granicus.if.org Git - clang/commit
[CUDA][HIP] Emit dependent libs for host only
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 28 May 2019 21:18:59 +0000 (21:18 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 28 May 2019 21:18:59 +0000 (21:18 +0000)
commitb02a79e8d08f9feeba075e41162adf1566f0cbbc
treee353a31fcda6aa21d690a91e30b49de4801f703d
parent1580041963802152a3548dc06305921082bdd9d7
[CUDA][HIP] Emit dependent libs for host only

Recently D60274 was introduced to allow lld to handle dependent libs. However current
usage of dependent libs (e.g. pragma comment(lib, *) in windows header files) are intended
for host only. Emitting the metadata in device IR causes link error in device path.

Until there is a way to different it dependent libs for device or host, metadata for dependent
libs should be emitted for host only. This patch enforces that.

Differential Revision: https://reviews.llvm.org/D62483

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361880 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenModule.cpp
test/CodeGenCUDA/dependent-libs.cu [new file with mode: 0644]