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