Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Driver/ToolChains/Arch/SystemZ.cpp
Line
Count
Source
1
//===--- SystemZ.cpp - SystemZ Helpers for Tools ----------------*- 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 "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
48
const char *systemz::getSystemZTargetCPU(const ArgList &Args) {
19
48
  if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_march_EQ))
20
25
    return A->getValue();
21
23
  return "z10";
22
23
}
23
24
void systemz::getSystemZTargetFeatures(const ArgList &Args,
25
45
                                       std::vector<llvm::StringRef> &Features) {
26
45
  // -m(no-)htm overrides use of the transactional-execution facility.
27
45
  if (Arg *A = Args.getLastArg(options::OPT_mhtm, options::OPT_mno_htm)) {
28
5
    if (A->getOption().matches(options::OPT_mhtm))
29
3
      Features.push_back("+transactional-execution");
30
2
    else
31
2
      Features.push_back("-transactional-execution");
32
5
  }
33
45
  // -m(no-)vx overrides use of the vector facility.
34
45
  if (Arg *A = Args.getLastArg(options::OPT_mvx, options::OPT_mno_vx)) {
35
5
    if (A->getOption().matches(options::OPT_mvx))
36
3
      Features.push_back("+vector");
37
2
    else
38
2
      Features.push_back("-vector");
39
5
  }
40
45
}