1 //===--- SystemZ.cpp - SystemZ Helpers for Tools ----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 #include "clang/Driver/Options.h"
12 #include "llvm/Option/ArgList.h"
14 using namespace clang::driver;
15 using namespace clang::driver::tools;
16 using namespace clang;
17 using namespace llvm::opt;
19 const char *systemz::getSystemZTargetCPU(const ArgList &Args) {
20 if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_march_EQ))
25 void systemz::getSystemZTargetFeatures(const ArgList &Args,
26 std::vector<llvm::StringRef> &Features) {
27 // -m(no-)htm overrides use of the transactional-execution facility.
28 if (Arg *A = Args.getLastArg(options::OPT_mhtm, options::OPT_mno_htm)) {
29 if (A->getOption().matches(options::OPT_mhtm))
30 Features.push_back("+transactional-execution");
32 Features.push_back("-transactional-execution");
34 // -m(no-)vx overrides use of the vector facility.
35 if (Arg *A = Args.getLastArg(options::OPT_mvx, options::OPT_mno_vx)) {
36 if (A->getOption().matches(options::OPT_mvx))
37 Features.push_back("+vector");
39 Features.push_back("-vector");