1 //===--- SystemZ.cpp - SystemZ Helpers for Tools ----------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "SystemZ.h" 11 #include "clang/Driver/Options.h" 12 #include "llvm/Option/ArgList.h" 13 14 using namespace clang::driver; 15 using namespace clang::driver::tools; 16 using namespace clang; 17 using namespace llvm::opt; 18 getSystemZTargetCPU(const ArgList & Args)19const char *systemz::getSystemZTargetCPU(const ArgList &Args) { 20 if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_march_EQ)) 21 return A->getValue(); 22 return "z10"; 23 } 24 getSystemZTargetFeatures(const ArgList & Args,std::vector<llvm::StringRef> & Features)25void 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"); 31 else 32 Features.push_back("-transactional-execution"); 33 } 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"); 38 else 39 Features.push_back("-vector"); 40 } 41 } 42