clang 20.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
12#include "clang/Driver/Tool.h"
14
15namespace clang {
16namespace driver {
17
19public:
20 SYCLInstallationDetector(const Driver &D, const llvm::Triple &HostTriple,
21 const llvm::opt::ArgList &Args);
22
23 void addSYCLIncludeArgs(const llvm::opt::ArgList &DriverArgs,
24 llvm::opt::ArgStringList &CC1Args) const;
25};
26
27namespace toolchains {
28
29class LLVM_LIBRARY_VISIBILITY SYCLToolChain : public ToolChain {
30public:
31 SYCLToolChain(const Driver &D, const llvm::Triple &Triple,
32 const ToolChain &HostTC, const llvm::opt::ArgList &Args);
33
34 const llvm::Triple *getAuxTriple() const override {
35 return &HostTC.getTriple();
36 }
37
38 llvm::opt::DerivedArgList *
39 TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch,
40 Action::OffloadKind DeviceOffloadKind) const override;
41 void
42 addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
43 llvm::opt::ArgStringList &CC1Args,
44 Action::OffloadKind DeviceOffloadKind) const override;
45
46 bool useIntegratedAs() const override { return true; }
47 bool isPICDefault() const override { return false; }
48 llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override {
49 return this->HostTC.getDefaultDebugFormat();
50 }
51 bool isPIEDefault(const llvm::opt::ArgList &Args) const override {
52 return false;
53 }
54 bool isPICDefaultForced() const override { return false; }
55
56 void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const override;
57 CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const override;
58 void addSYCLIncludeArgs(const llvm::opt::ArgList &DriverArgs,
59 llvm::opt::ArgStringList &CC1Args) const override;
60 void
61 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
62 llvm::opt::ArgStringList &CC1Args) const override;
63 void AddClangCXXStdlibIncludeArgs(
64 const llvm::opt::ArgList &Args,
65 llvm::opt::ArgStringList &CC1Args) const override;
66
67private:
68 const ToolChain &HostTC;
69 SYCLInstallationDetector SYCLInstallation;
70};
71
72} // end namespace toolchains
73
74} // end namespace driver
75} // end namespace clang
76
77#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_SYCL_H
const Decl * D
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:77
void addSYCLIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const
Definition: SYCL.cpp:22
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:573
const llvm::Triple & getTriple() const
Definition: ToolChain.h:254
llvm::codegenoptions::DebugInfoFormat getDefaultDebugFormat() const override
Get the default debug info format. Typically, this is DWARF.
Definition: SYCL.h:48
const llvm::Triple * getAuxTriple() const override
Get the toolchain's aux triple, if it has one.
Definition: SYCL.h:34
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition: SYCL.h:54
bool useIntegratedAs() const override
Check if the toolchain should use the integrated assembler.
Definition: SYCL.h:46
bool isPIEDefault(const llvm::opt::ArgList &Args) const override
Test whether this toolchain defaults to PIE.
Definition: SYCL.h:51
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition: SYCL.h:47
The JSON file list parser is used to communicate input to InstallAPI.