[HIP] Do not unbundle object files for -fno-gpu-rdc
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 5 Mar 2019 16:07:56 +0000 (16:07 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 5 Mar 2019 16:07:56 +0000 (16:07 +0000)
commitab851939fc6baf883a1760f18f48adc93ba2b01d
treec98f37b4e684f283a24c1e3d8e5e991bd4ec3108
parent130322e7cc58b7236fd2181126adedc4d90d2322
[HIP] Do not unbundle object files for -fno-gpu-rdc

When -fno-gpu-rdc is set, device code is compiled, linked, and assembled into fat binary
and embedded as string in object files. The object files are normal object files which
can be linked by host linker. In the linking stage, the object files should not be unbundled
when -fno-gpu-rdc is set since they are normal object files, not bundles. The object files
only need to be unbundled when -fgpu-rdc is set.

Currently clang always unbundles object files, disregarding -fgpu-rdc option.

This patch fixes that.

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

llvm-svn: 355410
clang/lib/Driver/Driver.cpp
clang/test/Driver/hip-binding.hip
clang/test/Driver/hip-link-shared-library.hip