[clang] [llvm] Reland - [Driver][SYCL] Add initial SYCL offload compilation support … (PR #117268)
Michael Toguchi via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 10:12:51 PST 2024
================
@@ -0,0 +1,179 @@
+//===--- SYCL.cpp - SYCL Tool and ToolChain Implementations -----*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#include "SYCL.h"
+#include "CommonArgs.h"
+#include "llvm/Support/Path.h"
+
+using namespace clang::driver;
+using namespace clang::driver::toolchains;
+using namespace clang::driver::tools;
+using namespace clang;
+using namespace llvm::opt;
+
+SYCLInstallationDetector::SYCLInstallationDetector(
+ const Driver &D, const llvm::Triple &HostTriple,
+ const llvm::opt::ArgList &Args)
+ : D(D) {}
+
+void SYCLInstallationDetector::AddSYCLIncludeArgs(
+ const ArgList &DriverArgs, ArgStringList &CC1Args) const {
+ if (DriverArgs.hasArg(clang::driver::options::OPT_nobuiltininc))
+ return;
+
+ // Add the SYCL header search locations in the specified order.
+ // ../include/sycl/stl_wrappers
+ // ../include
+ SmallString<128> IncludePath(D.Dir);
+ llvm::sys::path::append(IncludePath, "..");
+ llvm::sys::path::append(IncludePath, "include");
----------------
mdtoguchi wrote:
I would guess this depends on how ultimately the `include/sycl` headers are installed and how we should point to them. As the headers are not currently part of the build, this is basically just a location in which to try and find the SYCL specific headers (this is what we are doing in intel/llvm).
https://github.com/llvm/llvm-project/pull/117268
More information about the llvm-commits
mailing list