diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2019-01-10 20:09:52 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2019-01-10 20:09:52 +0000 |
commit | 4fa83fca7ead3d237c4af0bb0611a699d6b14988 (patch) | |
tree | 5c82fb64e1e03020a9fb1fffefd255321fe4a8dd /clang/lib | |
parent | 1d5f6a81f577d62688946e3ffbcf2643f03fa507 (diff) | |
download | bcm5719-llvm-4fa83fca7ead3d237c4af0bb0611a699d6b14988.tar.gz bcm5719-llvm-4fa83fca7ead3d237c4af0bb0611a699d6b14988.zip |
[HIP] Use nul instead of /dev/null when running on windows
When clang is running on windows, /dev/null is not available. Use nul as empty input file instead.
Differential Revision: https://reviews.llvm.org/D56225
llvm-svn: 350885
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/ToolChains/HIP.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/HIP.cpp b/clang/lib/Driver/ToolChains/HIP.cpp index b44aadda79c..868765cf88e 100644 --- a/clang/lib/Driver/ToolChains/HIP.cpp +++ b/clang/lib/Driver/ToolChains/HIP.cpp @@ -24,6 +24,12 @@ using namespace clang::driver::tools; using namespace clang; using namespace llvm::opt; +#if _WIN32 || _WIN64 +#define NULL_FILE "nul" +#else +#define NULL_FILE "/dev/null" +#endif + namespace { static void addBCLib(Compilation &C, const ArgList &Args, @@ -197,7 +203,7 @@ void AMDGCN::constructHIPFatbinCommand(Compilation &C, const JobAction &JA, // ToDo: Remove the dummy host binary entry which is required by // clang-offload-bundler. std::string BundlerTargetArg = "-targets=host-x86_64-unknown-linux"; - std::string BundlerInputArg = "-inputs=/dev/null"; + std::string BundlerInputArg = "-inputs=" NULL_FILE; for (const auto &II : Inputs) { const auto* A = II.getAction(); |