| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MYRIAD_H |
| 10 | #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_MYRIAD_H |
| 11 | |
| 12 | #include "Gnu.h" |
| 13 | #include "clang/Driver/Tool.h" |
| 14 | #include "clang/Driver/ToolChain.h" |
| 15 | |
| 16 | namespace clang { |
| 17 | namespace driver { |
| 18 | namespace tools { |
| 19 | |
| 20 | |
| 21 | namespace SHAVE { |
| 22 | class LLVM_LIBRARY_VISIBILITY Compiler : public Tool { |
| 23 | public: |
| 24 | Compiler(const ToolChain &TC) : Tool("moviCompile", "movicompile", TC) {} |
| 25 | |
| 26 | bool hasIntegratedCPP() const override { return true; } |
| 27 | |
| 28 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 29 | const InputInfo &Output, const InputInfoList &Inputs, |
| 30 | const llvm::opt::ArgList &TCArgs, |
| 31 | const char *LinkingOutput) const override; |
| 32 | }; |
| 33 | |
| 34 | class LLVM_LIBRARY_VISIBILITY Assembler : public Tool { |
| 35 | public: |
| 36 | Assembler(const ToolChain &TC) : Tool("moviAsm", "moviAsm", TC) {} |
| 37 | |
| 38 | bool hasIntegratedCPP() const override { return false; } |
| 39 | |
| 40 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 41 | const InputInfo &Output, const InputInfoList &Inputs, |
| 42 | const llvm::opt::ArgList &TCArgs, |
| 43 | const char *LinkingOutput) const override; |
| 44 | }; |
| 45 | } |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | namespace Myriad { |
| 52 | class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool { |
| 53 | public: |
| 54 | Linker(const ToolChain &TC) : GnuTool("shave::Linker", "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 | } |
| 63 | } |
| 64 | |
| 65 | namespace toolchains { |
| 66 | |
| 67 | |
| 68 | |
| 69 | class LLVM_LIBRARY_VISIBILITY MyriadToolChain : public Generic_ELF { |
| 70 | public: |
| 71 | MyriadToolChain(const Driver &D, const llvm::Triple &Triple, |
| 72 | const llvm::opt::ArgList &Args); |
| 73 | ~MyriadToolChain() override; |
| 74 | |
| 75 | void |
| 76 | AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, |
| 77 | llvm::opt::ArgStringList &CC1Args) const override; |
| 78 | void addLibCxxIncludePaths( |
| 79 | const llvm::opt::ArgList &DriverArgs, |
| 80 | llvm::opt::ArgStringList &CC1Args) const override; |
| 81 | void addLibStdCxxIncludePaths( |
| 82 | const llvm::opt::ArgList &DriverArgs, |
| 83 | llvm::opt::ArgStringList &CC1Args) const override; |
| 84 | Tool *SelectTool(const JobAction &JA) const override; |
| 85 | unsigned GetDefaultDwarfVersion() const override { return 2; } |
| 86 | SanitizerMask getSupportedSanitizers() const override; |
| 87 | |
| 88 | protected: |
| 89 | Tool *buildLinker() const override; |
| 90 | bool isShaveCompilation(const llvm::Triple &T) const { |
| 91 | return T.getArch() == llvm::Triple::shave; |
| 92 | } |
| 93 | |
| 94 | private: |
| 95 | mutable std::unique_ptr<Tool> Compiler; |
| 96 | mutable std::unique_ptr<Tool> Assembler; |
| 97 | }; |
| 98 | |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | #endif |
| 104 | |