1 //===--- ZOS.h - z/OS 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_ZOS_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ZOS_H
12 #include "clang/Driver/Tool.h"
13 #include "clang/Driver/ToolChain.h"
19 /// Directly call system default assembler and linker.
22 class LLVM_LIBRARY_VISIBILITY Assembler final
: public Tool
{
24 Assembler(const ToolChain
&TC
) : Tool("zos::Assembler", "assembler", TC
) {}
26 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 final
: public Tool
{
36 Linker(const ToolChain
&TC
) : Tool("zos::Linker", "linker", TC
) {}
38 bool hasIntegratedCPP() const override
{ return false; }
39 bool isLinkJob() const override
{ return true; }
41 void ConstructJob(Compilation
&C
, const JobAction
&JA
,
42 const InputInfo
&Output
, const InputInfoList
&Inputs
,
43 const llvm::opt::ArgList
&TCArgs
,
44 const char *LinkingOutput
) const override
;
47 } // end namespace zos
48 } // end namespace tools
50 namespace toolchains
{
52 class LLVM_LIBRARY_VISIBILITY ZOS
: public ToolChain
{
54 ZOS(const Driver
&D
, const llvm::Triple
&Triple
,
55 const llvm::opt::ArgList
&Args
);
58 bool isPICDefault() const override
{ return false; }
59 bool isPIEDefault(const llvm::opt::ArgList
&Args
) const override
{
62 bool isPICDefaultForced() const override
{ return false; }
64 void TryAddIncludeFromPath(llvm::SmallString
<128> Path
,
65 const llvm::opt::ArgList
&DriverArgs
,
66 llvm::opt::ArgStringList
&CC1Args
) const;
68 AddClangSystemIncludeArgs(const llvm::opt::ArgList
&DriverArgs
,
69 llvm::opt::ArgStringList
&CC1Args
) const override
;
71 void AddClangCXXStdlibIncludeArgs(
72 const llvm::opt::ArgList
&DriverArgs
,
73 llvm::opt::ArgStringList
&CC1Args
) const override
;
75 unsigned GetDefaultDwarfVersion() const override
{ return 4; }
76 CXXStdlibType
GetDefaultCXXStdlibType() const override
;
78 void AddCXXStdlibLibArgs(const llvm::opt::ArgList
&Args
,
79 llvm::opt::ArgStringList
&CmdArgs
) const override
;
81 RuntimeLibType
GetDefaultRuntimeLibType() const override
;
83 void addClangTargetOptions(
84 const llvm::opt::ArgList
&DriverArgs
, llvm::opt::ArgStringList
&CC1Args
,
85 Action::OffloadKind DeviceOffloadingKind
) const override
;
87 const char *getDefaultLinker() const override
{ return "/bin/ld"; }
90 Tool
*buildAssembler() const override
;
91 Tool
*buildLinker() const override
;
94 } // end namespace toolchains
95 } // end namespace driver
96 } // end namespace clang
98 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ZOS_H