Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Driver/ToolChains/XCore.h
Line
Count
Source (jump to first uncovered line)
1
//===--- XCore.h - XCore ToolChain Implementations --------------*- 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
#ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H
10
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H
11
12
#include "clang/Driver/Tool.h"
13
#include "clang/Driver/ToolChain.h"
14
15
namespace clang {
16
namespace driver {
17
namespace tools {
18
19
namespace XCore {
20
// For XCore, we do not need to instantiate tools for PreProcess, PreCompile and
21
// Compile.
22
// We simply use "clang -cc1" for those actions.
23
class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
24
public:
25
5
  Assembler(const ToolChain &TC) : Tool("XCore::Assembler", "XCore-as", TC) {}
26
27
5
  bool hasIntegratedCPP() const override { return false; }
28
  void ConstructJob(Compilation &C, const JobAction &JA,
29
                    const InputInfo &Output, const InputInfoList &Inputs,
30
                    const llvm::opt::ArgList &TCArgs,
31
                    const char *LinkingOutput) const override;
32
};
33
34
class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
35
public:
36
4
  Linker(const ToolChain &TC) : Tool("XCore::Linker", "XCore-ld", TC) {}
37
38
4
  bool hasIntegratedCPP() const override { return false; }
39
0
  bool isLinkJob() const override { return true; }
40
  void ConstructJob(Compilation &C, const JobAction &JA,
41
                    const InputInfo &Output, const InputInfoList &Inputs,
42
                    const llvm::opt::ArgList &TCArgs,
43
                    const char *LinkingOutput) const override;
44
};
45
} // end namespace XCore.
46
} // end namespace tools
47
48
namespace toolchains {
49
50
class LLVM_LIBRARY_VISIBILITY XCoreToolChain : public ToolChain {
51
public:
52
  XCoreToolChain(const Driver &D, const llvm::Triple &Triple,
53
                 const llvm::opt::ArgList &Args);
54
55
protected:
56
  Tool *buildAssembler() const override;
57
  Tool *buildLinker() const override;
58
59
public:
60
  bool isPICDefault() const override;
61
  bool isPIEDefault() const override;
62
  bool isPICDefaultForced() const override;
63
  bool SupportsProfiling() const override;
64
  bool hasBlocksRuntime() const override;
65
  void
66
  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
67
                            llvm::opt::ArgStringList &CC1Args) const override;
68
  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
69
                             llvm::opt::ArgStringList &CC1Args,
70
                             Action::OffloadKind DeviceOffloadKind) const override;
71
  void AddClangCXXStdlibIncludeArgs(
72
      const llvm::opt::ArgList &DriverArgs,
73
      llvm::opt::ArgStringList &CC1Args) const override;
74
  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
75
                           llvm::opt::ArgStringList &CmdArgs) const override;
76
};
77
78
} // end namespace toolchains
79
} // end namespace driver
80
} // end namespace clang
81
82
#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H