xref: /freebsd/contrib/llvm-project/clang/lib/Driver/ToolChains/ZOS.cpp (revision 77013d11e6483b970af25e13c9b892075742f7e5)
1 //===--- ZOS.cpp - z/OS 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 #include "ZOS.h"
10 #include "CommonArgs.h"
11 #include "clang/Driver/Compilation.h"
12 #include "clang/Driver/Options.h"
13 #include "llvm/Option/ArgList.h"
14 
15 using namespace clang::driver;
16 using namespace clang::driver::toolchains;
17 using namespace llvm::opt;
18 using namespace clang;
19 
20 ZOS::ZOS(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
21     : ToolChain(D, Triple, Args) {}
22 
23 ZOS::~ZOS() {}
24 
25 void ZOS::addClangTargetOptions(const ArgList &DriverArgs,
26                                 ArgStringList &CC1Args,
27                                 Action::OffloadKind DeviceOffloadKind) const {
28   // Pass "-faligned-alloc-unavailable" only when the user hasn't manually
29   // enabled or disabled aligned allocations.
30   if (!DriverArgs.hasArgNoClaim(options::OPT_faligned_allocation,
31                                 options::OPT_fno_aligned_allocation))
32     CC1Args.push_back("-faligned-alloc-unavailable");
33 }
34