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
15using namespace clang::driver;
16using namespace clang::driver::toolchains;
17using namespace llvm::opt;
18using namespace clang;
19
20ZOS::ZOS(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
21    : ToolChain(D, Triple, Args) {}
22
23ZOS::~ZOS() {}
24
25void 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