[PATCH] D99402: [AMDGPU][OpenMP] Add <install-prefix>/include to the search path
Pushpinder Singh via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 26 01:49:02 PDT 2021
pdhaliwal created this revision.
pdhaliwal added reviewers: ronlieb, JonChesterfield, jdoerfert.
Herald added subscribers: kerbowa, guansong, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl.
pdhaliwal requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1, wdng.
Herald added a project: clang.
Fixes the include error for omp.h as compiler was not looking in the
correct directory.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D99402
Files:
clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
clang/test/Driver/amdgpu-openmp-toolchain.c
Index: clang/test/Driver/amdgpu-openmp-toolchain.c
===================================================================
--- clang/test/Driver/amdgpu-openmp-toolchain.c
+++ clang/test/Driver/amdgpu-openmp-toolchain.c
@@ -4,7 +4,7 @@
// RUN: | FileCheck %s
// verify the tools invocations
-// CHECK: clang{{.*}}"-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-x" "c"{{.*}}
+// CHECK: clang{{.*}}"-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-internal-isystem" "{{.*}}/bin/../include"{{.*}}"-x" "c"{{.*}}
// CHECK: clang{{.*}}"-cc1" "-triple" "x86_64-unknown-linux-gnu"{{.*}}"-x" "ir"{{.*}}
// CHECK: clang{{.*}}"-cc1"{{.*}}"-triple" "amdgcn-amd-amdhsa"{{.*}}"-target-cpu" "gfx906" "-fcuda-is-device" "-mlink-builtin-bitcode"{{.*}}libomptarget-amdgcn-gfx906.bc"{{.*}}
// CHECK: llvm-link{{.*}}"-o" "{{.*}}amdgpu-openmp-toolchain-{{.*}}-gfx906-linked-{{.*}}.bc"
Index: clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
===================================================================
--- clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
+++ clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
@@ -244,6 +244,11 @@
void AMDGPUOpenMPToolChain::AddClangSystemIncludeArgs(
const ArgList &DriverArgs, ArgStringList &CC1Args) const {
+ const Driver &D = HostTC.getDriver();
+ CC1Args.push_back("-internal-isystem");
+ SmallString<128> P(D.Dir);
+ llvm::sys::path::append(P, "..", "include");
+ CC1Args.push_back(DriverArgs.MakeArgString(P));
HostTC.AddClangSystemIncludeArgs(DriverArgs, CC1Args);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99402.333509.patch
Type: text/x-patch
Size: 1509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210326/db05c83a/attachment.bin>
More information about the cfe-commits
mailing list