clang 8.0.0

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
clang::driver::tools::XCore::Linker::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: XCore.h:39
Tool.h
clang::driver::tools::XCore::Assembler::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: XCore.h:28
clang::driver::JobAction
Definition: Action.h:374
clang::driver::tools::XCore::Assembler::Assembler
Assembler(const ToolChain &TC)
Definition: XCore.h:26
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:23
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:58
clang::driver::tools::XCore::Linker
Definition: XCore.h:35
ToolChain.h
llvm::SmallVector
Definition: LLVM.h:36
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:83
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::driver::toolchains::XCoreToolChain
Definition: XCore.h:51
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:34
clang::driver::tools::XCore::Assembler
Definition: XCore.h:24
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:46
clang::driver::tools::XCore::Linker::Linker
Linker(const ToolChain &TC)
Definition: XCore.h:37
clang::driver::tools::XCore::Linker::isLinkJob
bool isLinkJob() const override
Definition: XCore.h:40
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:89