1 //===--- XCore.h - XCore ToolChain Implementations --------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H
12 #include "clang/Driver/Tool.h"
13 #include "clang/Driver/ToolChain.h"
20 // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and
22 // We simply use "clang -cc1" for those actions.
23 class LLVM_LIBRARY_VISIBILITY Assembler
: public Tool
{
25 Assembler(const ToolChain
&TC
) : Tool("XCore::Assembler", "XCore-as", TC
) {}
27 bool hasIntegratedCPP() const override
{ return false; }
28 void ConstructJob(Compilation
&C
, const JobAction
&JA
,
29 const InputInfo
&Output
, const InputInfoList
&Inputs
,
30 const llvm::opt::ArgList
&TCArgs
,
31 const char *LinkingOutput
) const override
;
34 class LLVM_LIBRARY_VISIBILITY Linker
: public Tool
{
36 Linker(const ToolChain
&TC
) : Tool("XCore::Linker", "XCore-ld", TC
) {}
38 bool hasIntegratedCPP() const override
{ return false; }
39 bool isLinkJob() const override
{ return true; }
40 void ConstructJob(Compilation
&C
, const JobAction
&JA
,
41 const InputInfo
&Output
, const InputInfoList
&Inputs
,
42 const llvm::opt::ArgList
&TCArgs
,
43 const char *LinkingOutput
) const override
;
45 } // end namespace XCore.
46 } // end namespace tools
48 namespace toolchains
{
50 class LLVM_LIBRARY_VISIBILITY XCoreToolChain
: public ToolChain
{
52 XCoreToolChain(const Driver
&D
, const llvm::Triple
&Triple
,
53 const llvm::opt::ArgList
&Args
);
56 Tool
*buildAssembler() const override
;
57 Tool
*buildLinker() const override
;
60 bool isPICDefault() const override
;
61 bool isPIEDefault(const llvm::opt::ArgList
&Args
) const override
;
62 bool isPICDefaultForced() const override
;
63 bool SupportsProfiling() const override
;
64 bool hasBlocksRuntime() const override
;
66 AddClangSystemIncludeArgs(const llvm::opt::ArgList
&DriverArgs
,
67 llvm::opt::ArgStringList
&CC1Args
) const override
;
68 void addClangTargetOptions(const llvm::opt::ArgList
&DriverArgs
,
69 llvm::opt::ArgStringList
&CC1Args
,
70 Action::OffloadKind DeviceOffloadKind
) const override
;
71 void AddClangCXXStdlibIncludeArgs(
72 const llvm::opt::ArgList
&DriverArgs
,
73 llvm::opt::ArgStringList
&CC1Args
) const override
;
74 void AddCXXStdlibLibArgs(const llvm::opt::ArgList
&Args
,
75 llvm::opt::ArgStringList
&CmdArgs
) const override
;
78 } // end namespace toolchains
79 } // end namespace driver
80 } // end namespace clang
82 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H