blob: 61fd0e1455bd3d8ecf8307c90fec64f07d0c5837 [file] [log] [blame]
Anton Korobeynikov93165d62019-01-15 19:44:05 +00001//===--- MSP430.h - MSP430-specific Tool Helpers ----------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Anton Korobeynikov93165d62019-01-15 19:44:05 +00006//
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
24namespace clang {
25namespace driver {
26namespace toolchains {
27
28class LLVM_LIBRARY_VISIBILITY MSP430ToolChain : public Generic_ELF {
29public:
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
39protected:
40 Tool *buildLinker() const override;
41
42private:
43 std::string computeSysRoot() const;
44};
45
46} // end namespace toolchains
47
48namespace tools {
49namespace msp430 {
50
51class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
52public:
53 Linker(const ToolChain &TC)
54 : GnuTool("MSP430::Linker", "msp430-elf-ld", TC) {}
55 bool hasIntegratedCPP() const override { return false; }
56 bool isLinkJob() const override { return true; }
57 void ConstructJob(Compilation &C, const JobAction &JA,
58 const InputInfo &Output, const InputInfoList &Inputs,
59 const llvm::opt::ArgList &TCArgs,
60 const char *LinkingOutput) const override;
61};
62
63void getMSP430TargetFeatures(const Driver &D, const llvm::opt::ArgList &Args,
64 std::vector<llvm::StringRef> &Features);
65} // end namespace msp430
66} // end namespace tools
67} // end namespace driver
68} // end namespace clang
69
70#endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MSP430_H