aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/ToolChain.cpp
diff options
context:
space:
mode:
authorYaxun (Sam) Liu <yaxun.liu@amd.com>2020-06-03 10:05:52 -0400
committerYaxun (Sam) Liu <yaxun.liu@amd.com>2020-06-05 12:44:57 -0400
commit11d06b9511bd25aabbfad10dff548b0ce29135a5 (patch)
tree49d514f344a4e9618813e156e8e6024a221c78cb /clang/lib/Driver/ToolChain.cpp
parenta3597ecae95938351339b2011baedb3f23ea72de (diff)
downloadllvm-11d06b9511bd25aabbfad10dff548b0ce29135a5.zip
llvm-11d06b9511bd25aabbfad10dff548b0ce29135a5.tar.gz
llvm-11d06b9511bd25aabbfad10dff548b0ce29135a5.tar.bz2
[HIP] Add default header and include path
To support std::complex and some other standard C/C++ functions in HIP device code, they need to be forced to be __host__ __device__ functions by pragmas. This is done by some clang standard C++ wrapper headers which are shared between cuda-clang and hip-Clang. For these standard C++ wapper headers to work properly, specific include path order has to be enforced: clang C++ wrapper include path standard C++ include path clang include path Also, these C++ wrapper headers require device version of some standard C/C++ functions must be declared before including them. This needs to be done by including a default header which declares or defines these device functions. The default header is always included before any other headers are included by users. This patch adds the the default header and include path for HIP. Differential Revision: https://reviews.llvm.org/D81176
Diffstat (limited to 'clang/lib/Driver/ToolChain.cpp')
-rw-r--r--clang/lib/Driver/ToolChain.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index cf04fd07..2bda7de 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -991,6 +991,9 @@ SanitizerMask ToolChain::getSupportedSanitizers() const {
void ToolChain::AddCudaIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {}
+void ToolChain::AddHIPIncludeArgs(const ArgList &DriverArgs,
+ ArgStringList &CC1Args) const {}
+
void ToolChain::AddIAMCUIncludeArgs(const ArgList &DriverArgs,
ArgStringList &CC1Args) const {}