clang  6.0.0svn
XCore.h
Go to the documentation of this file.
1 //===--- XCore.h - XCore ToolChain Implementations --------------*- 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 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H
12 
13 #include "clang/Driver/Tool.h"
14 #include "clang/Driver/ToolChain.h"
15 
16 namespace clang {
17 namespace driver {
18 namespace tools {
19 
20 namespace XCore {
21 // For XCore, we do not need to instantiate tools for PreProcess, PreCompile and
22 // Compile.
23 // We simply use "clang -cc1" for those actions.
24 class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
25 public:
26  Assembler(const ToolChain &TC) : Tool("XCore::Assembler", "XCore-as", TC) {}
27 
28  bool hasIntegratedCPP() const override { return false; }
29  void ConstructJob(Compilation &C, const JobAction &JA,
30  const InputInfo &Output, const InputInfoList &Inputs,
31  const llvm::opt::ArgList &TCArgs,
32  const char *LinkingOutput) const override;
33 };
34 
35 class LLVM_LIBRARY_VISIBILITY Linker : public Tool {
36 public:
37  Linker(const ToolChain &TC) : Tool("XCore::Linker", "XCore-ld", TC) {}
38 
39  bool hasIntegratedCPP() const override { return false; }
40  bool isLinkJob() const override { return true; }
41  void ConstructJob(Compilation &C, const JobAction &JA,
42  const InputInfo &Output, const InputInfoList &Inputs,
43  const llvm::opt::ArgList &TCArgs,
44  const char *LinkingOutput) const override;
45 };
46 } // end namespace XCore.
47 } // end namespace tools
48 
49 namespace toolchains {
50 
51 class LLVM_LIBRARY_VISIBILITY XCoreToolChain : public ToolChain {
52 public:
53  XCoreToolChain(const Driver &D, const llvm::Triple &Triple,
54  const llvm::opt::ArgList &Args);
55 
56 protected:
57  Tool *buildAssembler() const override;
58  Tool *buildLinker() const override;
59 
60 public:
61  bool isPICDefault() const override;
62  bool isPIEDefault() const override;
63  bool isPICDefaultForced() const override;
64  bool SupportsProfiling() const override;
65  bool hasBlocksRuntime() const override;
66  void
67  AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
68  llvm::opt::ArgStringList &CC1Args) const override;
69  void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
70  llvm::opt::ArgStringList &CC1Args,
71  Action::OffloadKind DeviceOffloadKind) const override;
72  void AddClangCXXStdlibIncludeArgs(
73  const llvm::opt::ArgList &DriverArgs,
74  llvm::opt::ArgStringList &CC1Args) const override;
75  void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
76  llvm::opt::ArgStringList &CmdArgs) const override;
77 };
78 
79 } // end namespace toolchains
80 } // end namespace driver
81 } // end namespace clang
82 
83 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_XCORE_H
bool hasIntegratedCPP() const override
Definition: XCore.h:39
bool hasIntegratedCPP() const override
Definition: XCore.h:28
Assembler(const ToolChain &TC)
Definition: XCore.h:26
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:65
Dataflow Directional Tag Classes.
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:34
Linker(const ToolChain &TC)
Definition: XCore.h:37
bool isLinkJob() const override
Definition: XCore.h:40
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:73