clang 22.0.0git
SYCL.h
Go to the documentation of this file.
1//===--- SYCL.h - SYCL ToolChain Implementations ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SYCL_H
10#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SYCL_H
11
13#include "clang/Driver/Tool.h"
15
16namespace clang {
17namespace driver {
18namespace toolchains {
19
20class LLVM_LIBRARY_VISIBILITY SYCLToolChain : public ToolChain {
21public:
22 SYCLToolChain(const Driver &D, const llvm::Triple &Triple,
23 const ToolChain &HostTC, const llvm::opt::ArgList &Args);
24
25 const llvm::Triple *getAuxTriple() const override {
26 return &HostTC.getTriple();
27 }
28
29 llvm::opt::DerivedArgList *
30 TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
31 Action::OffloadKind DeviceOffloadKind) const override;
32 void
33 addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
34 llvm::opt::ArgStringList &CC1Args,
35 Action::OffloadKind DeviceOffloadKind) const override;
36
37 bool useIntegratedAs() const override { return true; }
38 bool isPICDefault() const override { return false; }
39 llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override {
40 return this->HostTC.getDefaultDebugFormat();
41 }
42 bool isPIEDefault(const llvm::opt::ArgList &Args) const override {
43 return false;
44 }
45 bool isPICDefaultForced() const override { return false; }
46
47 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const override;
48 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
49 void addSYCLIncludeArgs(const llvm::opt::ArgList &DriverArgs,
50 llvm::opt::ArgStringList &CC1Args) const override;
51 void
52 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
53 llvm::opt::ArgStringList &CC1Args) const override;
54 void AddClangCXXStdlibIncludeArgs(
55 const llvm::opt::ArgList &Args,
56 llvm::opt::ArgStringList &CC1Args) const override;
57
58private:
59 const ToolChain &HostTC;
60 SYCLInstallationDetector SYCLInstallation;
61};
62
63} // end namespace toolchains
64
65} // end namespace driver
66} // end namespace clang
67
68#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SYCL_H
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition Driver.h:99
ToolChain - Access to tools for a single platform.
Definition ToolChain.h:92
virtual llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const
Get the default debug info format. Typically, this is DWARF.
Definition ToolChain.h:592
ToolChain(const Driver &D, const llvm::Triple &T, const llvm::opt::ArgList &Args)
Definition ToolChain.cpp:89
llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override
Get the default debug info format. Typically, this is DWARF.
Definition SYCL.h:39
const llvm::Triple * getAuxTriple() const override
Get the toolchain's aux triple, if it has one.
Definition SYCL.h:25
SYCLToolChain(const Driver &D, const llvm::Triple &Triple, const ToolChain &HostTC, const llvm::opt::ArgList &Args)
Definition SYCL.cpp:58
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition SYCL.h:45
bool useIntegratedAs() const override
Check if the toolchain should use the integrated assembler.
Definition SYCL.h:37
bool isPIEDefault(const llvm::opt::ArgList &Args) const override
Test whether this toolchain defaults to PIE.
Definition SYCL.h:42
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition SYCL.h:38
The JSON file list parser is used to communicate input to InstallAPI.