1 //===--- Myriad.h - Myriad ToolChain Implementations ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MYRIAD_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MYRIAD_H
14 #include "clang/Driver/Tool.h"
15 #include "clang/Driver/ToolChain.h"
21 /// SHAVE tools -- Directly call moviCompile and moviAsm
23 class LLVM_LIBRARY_VISIBILITY Compiler : public Tool {
25 Compiler(const ToolChain &TC) : Tool("moviCompile", "movicompile", TC) {}
27 bool hasIntegratedCPP() const override { return true; }
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;
35 class LLVM_LIBRARY_VISIBILITY Assembler : public Tool {
37 Assembler(const ToolChain &TC) : Tool("moviAsm", "moviAsm", TC) {}
39 bool hasIntegratedCPP() const override { return false; } // not sure.
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;
46 } // end namespace SHAVE
48 /// The Myriad toolchain uses tools that are in two different namespaces.
49 /// The Compiler and Assembler as defined above are in the SHAVE namespace,
50 /// whereas the linker, which accepts code for a mixture of Sparc and SHAVE,
51 /// is in the Myriad namespace.
53 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
55 Linker(const ToolChain &TC) : GnuTool("shave::Linker", "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;
63 } // end namespace Myriad
64 } // end namespace tools
66 namespace toolchains {
68 /// MyriadToolChain - A tool chain using either clang or the external compiler
69 /// installed by the Movidius SDK to perform all subcommands.
70 class LLVM_LIBRARY_VISIBILITY MyriadToolChain : public Generic_ELF {
72 MyriadToolChain(const Driver &D, const llvm::Triple &Triple,
73 const llvm::opt::ArgList &Args);
74 ~MyriadToolChain() override;
77 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
78 llvm::opt::ArgStringList &CC1Args) const override;
79 std::string findLibCxxIncludePath() const override;
80 void addLibStdCxxIncludePaths(
81 const llvm::opt::ArgList &DriverArgs,
82 llvm::opt::ArgStringList &CC1Args) const override;
83 Tool *SelectTool(const JobAction &JA) const override;
84 unsigned GetDefaultDwarfVersion() const override { return 2; }
85 SanitizerMask getSupportedSanitizers() const override;
88 Tool *buildLinker() const override;
89 bool isShaveCompilation(const llvm::Triple &T) const {
90 return T.getArch() == llvm::Triple::shave;
94 mutable std::unique_ptr<Tool> Compiler;
95 mutable std::unique_ptr<Tool> Assembler;
98 } // end namespace toolchains
99 } // end namespace driver
100 } // end namespace clang
102 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MYRIAD_H