From 3a623999f3ff96843f97ee300e0c94b8cbc88a9f Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 6 Sep 2022 13:56:24 -0500 Subject: [PATCH] [OpenMP] Fix logic error when building offloading applications Summary: A previous patch removed support for the `-fopenmp-new-driver` and accidentally used the `isHostOffloading` flag instead of `isDeviceOffloading` which lead to some build errors when compiling for the offloading device. This patch addresses that. --- clang/lib/Driver/ToolChains/Clang.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index d39f871..d3b5f82c 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4760,7 +4760,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (IsUsingLTO) { // Only AMDGPU supports device-side LTO. - if (IsDeviceOffloadAction && !JA.isHostOffloading(Action::OFK_OpenMP) && + if (IsDeviceOffloadAction && !JA.isDeviceOffloading(Action::OFK_OpenMP) && !Args.hasFlag(options::OPT_offload_new_driver, options::OPT_no_offload_new_driver, false) && !Triple.isAMDGPU()) { -- 2.7.4