clang 10.0.0git

MSP430.h
Go to the documentation of this file.
1 //===--- MSP430.h - MSP430-specific Tool Helpers ----------------*- 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_MSP430_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MSP430_H
11
12 #include "Gnu.h"
13 #include "InputInfo.h"
14 #include "clang/Driver/Driver.h"
15 #include "clang/Driver/DriverDiagnostic.h"
16 #include "clang/Driver/Tool.h"
17 #include "clang/Driver/ToolChain.h"
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Option/Option.h"
20
21 #include <string>
22 #include <vector>
23
24 namespace clang {
25 namespace driver {
26 namespace toolchains {
27
28 class LLVM_LIBRARY_VISIBILITY MSP430ToolChain : public Generic_ELF {
29 public:
30 MSP430ToolChain(const Driver &D, const llvm::Triple &Triple,
31 const llvm::opt::ArgList &Args);
32 void
33 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
34 llvm::opt::ArgStringList &CC1Args) const override;
35 void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
36 llvm::opt::ArgStringList &CC1Args,
37 Action::OffloadKind) const override;
38
39 bool isPICDefault() const override { return false; }
40 bool isPIEDefault() const override { return false; }
41 bool isPICDefaultForced() const override { return true; }
42
43 protected:
44 Tool *buildLinker() const override;
45
46 private:
47 std::string computeSysRoot() const;
48 };
49
50 } // end namespace toolchains
51
52 namespace tools {
53 namespace msp430 {
54
55 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
56 public:
57 Linker(const ToolChain &TC)
58 : GnuTool("MSP430::Linker", "msp430-elf-ld", TC) {}
59 bool hasIntegratedCPP() const override { return false; }
60 bool isLinkJob() const override { return true; }
61 void ConstructJob(Compilation &C, const JobAction &JA,
62 const InputInfo &Output, const InputInfoList &Inputs,
63 const llvm::opt::ArgList &TCArgs,
64 const char *LinkingOutput) const override;
65 };
66
67 void getMSP430TargetFeatures(const Driver &D, const llvm::opt::ArgList &Args,
68 std::vector<llvm::StringRef> &Features);
69 } // end namespace msp430
70 } // end namespace tools
71 } // end namespace driver
72 } // end namespace clang
73
74 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MSP430_H
clang::driver::tools::msp430::Linker::hasIntegratedCPP
bool hasIntegratedCPP() const override
Definition: MSP430.h:59
Tool.h
clang::driver::JobAction
Definition: Action.h:375
clang::driver::toolchains::MSP430ToolChain
Definition: MSP430.h:28
clang::driver::InputInfo
InputInfo - Wrapper for information about an input source.
Definition: InputInfo.h:22
clang::driver::Driver
Driver - Encapsulate logic for constructing compilation processes from a set of gcc-driver-like comma...
Definition: Driver.h:59
Driver.h
clang::driver::toolchains::Generic_ELF
Definition: Gnu.h:348
clang::driver::tools::msp430::Linker::Linker
Linker(const ToolChain &TC)
Definition: MSP430.h:57
clang::driver::tools::GnuTool
Base class for all GNU tools that provide the same behavior when it comes to response files support...
Definition: Gnu.h:40
ToolChain.h
llvm::SmallVector
Definition: LLVM.h:35
clang::driver::toolchains::MSP430ToolChain::isPICDefaultForced
bool isPICDefaultForced() const override
Tests whether this toolchain forces its default for PIC, PIE or non-PIC.
Definition: MSP430.h:41
Gnu.h
clang::driver::Action::OffloadKind
OffloadKind
Definition: Action.h:84
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::driver::Tool
Tool - Information on a specific compilation tool.
Definition: Tool.h:33
InputInfo.h
clang::driver::tools::msp430::getMSP430TargetFeatures
void getMSP430TargetFeatures(const Driver &D, const llvm::opt::ArgList &Args, std::vector< llvm::StringRef > &Features)
clang::driver::Compilation
Compilation - A set of tasks to perform for a single driver invocation.
Definition: Compilation.h:45
clang::driver::toolchains::MSP430ToolChain::isPIEDefault
bool isPIEDefault() const override
Test whether this toolchain defaults to PIE.
Definition: MSP430.h:40
DriverDiagnostic.h
clang::driver::tools::msp430::Linker
Definition: MSP430.h:55
clang::driver::tools::msp430::Linker::isLinkJob
bool isLinkJob() const override
Definition: MSP430.h:60
clang::driver::toolchains::MSP430ToolChain::isPICDefault
bool isPICDefault() const override
Test whether this toolchain defaults to PIC.
Definition: MSP430.h:39
clang::driver::ToolChain
ToolChain - Access to tools for a single platform.
Definition: ToolChain.h:88