diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2022-03-09 09:10:17 -0500 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2022-03-09 20:57:27 -0500 |
commit | 6730b44480fcce18bfbbae0c46719250e9eae425 (patch) | |
tree | 1dc39238f2070fbfd6b52774e3303515f2739a71 /llvm/lib/Target/TargetLoweringObjectFile.cpp | |
parent | 9066a88f040e1ee238df5a98315dccfb0b8996a5 (diff) | |
download | llvm-6730b44480fcce18bfbbae0c46719250e9eae425.zip llvm-6730b44480fcce18bfbbae0c46719250e9eae425.tar.gz llvm-6730b44480fcce18bfbbae0c46719250e9eae425.tar.bz2 |
[HIP] Fix HIP include path
The clang compiler prepends the HIP header include paths to the search
list using -internal-isystem when building for the HIP language. This
prevents warnings related to things like reserved identifiers when
including the HIP headers even when ROCm is installed in a non-system
directory, such as /opt/rocm.
However, when HIP is installed in /usr, then the prepended include
path would be /usr/include. That is a problem, because the C standard
library headers are stored in /usr/include and the C++ standard
library headers must come before the C library headers in the search
path list (because the C++ standard library headers use #include_next
to include the C standard library headers).
While the HIP wrapper headers _do_ need to be earlier in the search
than the C++ headers, those headers get their own subdirectory and
their own explicit -internal-isystem argument. This include path is for
<hip/hip_runtime_api.h> and <hip/hip_runtime.h>, which do not require a
particular search ordering with respect to the C or C++ headers. Thus,
HIP include path is added after other system include paths.
With contribution from Cordell Bloor.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D120132
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions