[HIP] unbundle bundled preprocessor output
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Fri, 4 Dec 2020 22:38:57 +0000 (17:38 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 16 Dec 2020 03:14:18 +0000 (22:14 -0500)
commit4f14b80803a458209b6b11daa3ec05076b8c4973
treef1f8d15021f5b3b74b07d37fd77f92c5f21e8f94
parent1f6e15566f147f5814b0fe04df71a8d6acc4e689
[HIP] unbundle bundled preprocessor output

There is a use case that users want to emit preprocessor
output as file and compile the preprocessor output later
with -x hip-cpp-output.

Clang emits bundled preprocessor output when users
compile with -E for combined host/device compilations.
Clang should be able to compile the bundled preprocessor
output with -x hip-cpp-output. Basically clang should
unbundle the bundled preprocessor output and launch
device and host compilation actions.

Currently there is a bug in clang driver causing bundled
preprocessor output not unbundled.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D92720
clang/lib/Driver/Driver.cpp
clang/test/Driver/hip-unbundle-preproc.hip [new file with mode: 0644]