================
@@ -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");
----------------
tahonermann wrote:

I remain concerned about the potential for this include path to be added 
multiple times since it isn't SYCL specific. Is this known to be required? That 
directory will have "c++", "clang", "clang-c", "llvm", and "llvm-c" 
directories. Does, e.g., `#include <clang/AST/AST.h>` work without the user 
having to manually add an additional include path? I'm sympathetic to wanting 
`#include <sycl/sycl.hpp>` to just work when `-fsycl` is passed. Is there 
another way we can accomplish that? An ugly way that we definitely shouldn't do 
(and wouldn't work everywhere anyway) would be to add a path to 
`../include/sycl` and then add a `sycl -> .` symlink in that directory. I 
likewise don't like the idea of creating an `include/sycl/sycl` directory 
structure, but that would work too. Other ideas?

https://github.com/llvm/llvm-project/pull/117268
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to