Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 1 | //===--- Tools.h - Tool Implementations -------------------------*- 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 CLANG_LIB_DRIVER_TOOLS_H_ |
| 11 | #define CLANG_LIB_DRIVER_TOOLS_H_ |
| 12 | |
| 13 | #include "clang/Driver/Tool.h" |
| 14 | |
| 15 | #include "llvm/Support/Compiler.h" |
| 16 | |
| 17 | namespace clang { |
| 18 | namespace driver { |
Daniel Dunbar | 985b825 | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 19 | namespace tools { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 20 | |
Daniel Dunbar | 985b825 | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 21 | class VISIBILITY_HIDDEN Clang : public Tool { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 22 | public: |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 23 | Clang(const ToolChain &TC) : Tool("clang", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 24 | |
| 25 | virtual bool acceptsPipedInput() const { return true; } |
| 26 | virtual bool canPipeOutput() const { return true; } |
| 27 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame^] | 28 | |
| 29 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 30 | InputInfo &Output, InputInfoList &Inputs, |
| 31 | const ArgList &TCArgs, |
| 32 | const char *LinkingOutput) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 33 | }; |
| 34 | |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 35 | /// gcc - Generic GCC tool implementations. |
| 36 | namespace gcc { |
| 37 | class VISIBILITY_HIDDEN Preprocess : public Tool { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 38 | public: |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 39 | Preprocess(const ToolChain &TC) : Tool("gcc::Preprocess", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 40 | |
| 41 | virtual bool acceptsPipedInput() const { return true; } |
| 42 | virtual bool canPipeOutput() const { return true; } |
| 43 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame^] | 44 | |
| 45 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 46 | InputInfo &Output, InputInfoList &Inputs, |
| 47 | const ArgList &TCArgs, |
| 48 | const char *LinkingOutput) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 49 | }; |
| 50 | |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 51 | class VISIBILITY_HIDDEN Precompile : public Tool { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 52 | public: |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 53 | Precompile(const ToolChain &TC) : Tool("gcc::Precompile", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 54 | |
| 55 | virtual bool acceptsPipedInput() const { return true; } |
| 56 | virtual bool canPipeOutput() const { return false; } |
| 57 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame^] | 58 | |
| 59 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 60 | InputInfo &Output, InputInfoList &Inputs, |
| 61 | const ArgList &TCArgs, |
| 62 | const char *LinkingOutput) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 63 | }; |
| 64 | |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 65 | class VISIBILITY_HIDDEN Compile : public Tool { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 66 | public: |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 67 | Compile(const ToolChain &TC) : Tool("gcc::Compile", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 68 | |
| 69 | virtual bool acceptsPipedInput() const { return true; } |
| 70 | virtual bool canPipeOutput() const { return true; } |
| 71 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame^] | 72 | |
| 73 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 74 | InputInfo &Output, InputInfoList &Inputs, |
| 75 | const ArgList &TCArgs, |
| 76 | const char *LinkingOutput) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 77 | }; |
| 78 | |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 79 | class VISIBILITY_HIDDEN Assemble : public Tool { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 80 | public: |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 81 | Assemble(const ToolChain &TC) : Tool("gcc::Assemble", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 82 | |
| 83 | virtual bool acceptsPipedInput() const { return true; } |
| 84 | virtual bool canPipeOutput() const { return false; } |
| 85 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame^] | 86 | |
| 87 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 88 | InputInfo &Output, InputInfoList &Inputs, |
| 89 | const ArgList &TCArgs, |
| 90 | const char *LinkingOutput) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 91 | }; |
| 92 | |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 93 | class VISIBILITY_HIDDEN Link : public Tool { |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 94 | public: |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 95 | Link(const ToolChain &TC) : Tool("gcc::Link", TC) {} |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 96 | |
| 97 | virtual bool acceptsPipedInput() const { return false; } |
| 98 | virtual bool canPipeOutput() const { return false; } |
| 99 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 47ac7d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame^] | 100 | |
| 101 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 102 | InputInfo &Output, InputInfoList &Inputs, |
| 103 | const ArgList &TCArgs, |
| 104 | const char *LinkingOutput) const; |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 105 | }; |
Daniel Dunbar | 31b1e54 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 106 | } // end namespace gcc |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 107 | |
| 108 | } // end namespace toolchains |
| 109 | } // end namespace driver |
| 110 | } // end namespace clang |
| 111 | |
| 112 | #endif |