1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | #include "SystemZ.h" |
10 | #include "clang/Driver/Options.h" |
11 | #include "llvm/Option/ArgList.h" |
12 | |
13 | using namespace clang::driver; |
14 | using namespace clang::driver::tools; |
15 | using namespace clang; |
16 | using namespace llvm::opt; |
17 | |
18 | const char *systemz::getSystemZTargetCPU(const ArgList &Args) { |
19 | if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_march_EQ)) |
20 | return A->getValue(); |
21 | return "z10"; |
22 | } |
23 | |
24 | void systemz::getSystemZTargetFeatures(const ArgList &Args, |
25 | std::vector<llvm::StringRef> &Features) { |
26 | |
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"); |
30 | else |
31 | Features.push_back("-transactional-execution"); |
32 | } |
33 | |
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"); |
37 | else |
38 | Features.push_back("-vector"); |
39 | } |
40 | } |
41 | |