1 //===--- SystemZ.cpp - SystemZ Helpers for Tools ----------------*- 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 //===----------------------------------------------------------------------===//
10 #include "clang/Driver/Options.h"
11 #include "llvm/Option/ArgList.h"
13 using namespace clang::driver;
14 using namespace clang::driver::tools;
15 using namespace clang;
16 using namespace llvm::opt;
18 const char *systemz::getSystemZTargetCPU(const ArgList &Args) {
19 if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_march_EQ))
24 void systemz::getSystemZTargetFeatures(const ArgList &Args,
25 std::vector<llvm::StringRef> &Features) {
26 // -m(no-)htm overrides use of the transactional-execution facility.
27 if (Arg *A = Args.getLastArg(options::OPT_mhtm, options::OPT_mno_htm)) {
28 if (A->getOption().matches(options::OPT_mhtm))
29 Features.push_back("+transactional-execution");
31 Features.push_back("-transactional-execution");
33 // -m(no-)vx overrides use of the vector facility.
34 if (Arg *A = Args.getLastArg(options::OPT_mvx, options::OPT_mno_vx)) {
35 if (A->getOption().matches(options::OPT_mvx))
36 Features.push_back("+vector");
38 Features.push_back("-vector");