Daniel Dunbar | 5903d8c | 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" |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 14 | #include "clang/Driver/Types.h" |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 15 | #include "clang/Driver/Util.h" |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 16 | |
| 17 | #include "llvm/Support/Compiler.h" |
| 18 | |
| 19 | namespace clang { |
| 20 | namespace driver { |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 21 | class Driver; |
| 22 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 23 | namespace toolchains { |
Daniel Dunbar | f0a5b9b | 2009-09-04 18:34:51 +0000 | [diff] [blame] | 24 | class Darwin; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 25 | } |
| 26 | |
Daniel Dunbar | 15abb2e | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 27 | namespace tools { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 28 | |
Daniel Dunbar | 15abb2e | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 29 | class VISIBILITY_HIDDEN Clang : public Tool { |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 30 | void AddPreprocessingOptions(const Driver &D, |
| 31 | const ArgList &Args, |
Daniel Dunbar | d067f7f | 2009-04-08 23:54:23 +0000 | [diff] [blame] | 32 | ArgStringList &CmdArgs, |
| 33 | const InputInfo &Output, |
| 34 | const InputInfoList &Inputs) const; |
| 35 | |
Daniel Dunbar | 0f5c542 | 2009-09-10 04:57:17 +0000 | [diff] [blame] | 36 | void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Eric Christopher | 0b26a61 | 2010-03-02 02:41:08 +0000 | [diff] [blame] | 37 | void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 3b3191f | 2009-09-09 22:33:08 +0000 | [diff] [blame] | 38 | void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
| 39 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 40 | public: |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 41 | Clang(const ToolChain &TC) : Tool("clang", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 42 | |
| 43 | virtual bool acceptsPipedInput() const { return true; } |
| 44 | virtual bool canPipeOutput() const { return true; } |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 45 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | c434394 | 2010-02-03 03:07:56 +0000 | [diff] [blame] | 46 | virtual bool hasIntegratedAssembler() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 47 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 48 | |
| 49 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 04c4c2c | 2009-03-18 07:06:02 +0000 | [diff] [blame] | 50 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 51 | const InputInfo &Output, |
| 52 | const InputInfoList &Inputs, |
| 53 | const ArgList &TCArgs, |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 54 | const char *LinkingOutput) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 55 | }; |
| 56 | |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 57 | /// gcc - Generic GCC tool implementations. |
| 58 | namespace gcc { |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 59 | class VISIBILITY_HIDDEN Common : public Tool { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 60 | public: |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 61 | Common(const char *Name, const ToolChain &TC) : Tool(Name, TC) {} |
| 62 | |
| 63 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 64 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 65 | const InputInfo &Output, |
| 66 | const InputInfoList &Inputs, |
| 67 | const ArgList &TCArgs, |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 68 | const char *LinkingOutput) const; |
| 69 | |
| 70 | /// RenderExtraToolArgs - Render any arguments necessary to force |
| 71 | /// the particular tool mode. |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 72 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 73 | ArgStringList &CmdArgs) const = 0; |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 74 | }; |
| 75 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 76 | |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 77 | class VISIBILITY_HIDDEN Preprocess : public Common { |
| 78 | public: |
| 79 | Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 80 | |
| 81 | virtual bool acceptsPipedInput() const { return true; } |
| 82 | virtual bool canPipeOutput() const { return true; } |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 83 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 84 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 85 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 86 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 87 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 88 | }; |
| 89 | |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 90 | class VISIBILITY_HIDDEN Precompile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 91 | public: |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 92 | Precompile(const ToolChain &TC) : Common("gcc::Precompile", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 93 | |
| 94 | virtual bool acceptsPipedInput() const { return true; } |
| 95 | virtual bool canPipeOutput() const { return false; } |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 96 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 97 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 98 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 99 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 100 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 101 | }; |
| 102 | |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 103 | class VISIBILITY_HIDDEN Compile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 104 | public: |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 105 | Compile(const ToolChain &TC) : Common("gcc::Compile", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 106 | |
| 107 | virtual bool acceptsPipedInput() const { return true; } |
| 108 | virtual bool canPipeOutput() const { return true; } |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 109 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 110 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 111 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 112 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 113 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 114 | }; |
| 115 | |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 116 | class VISIBILITY_HIDDEN Assemble : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 117 | public: |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 118 | Assemble(const ToolChain &TC) : Common("gcc::Assemble", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 119 | |
| 120 | virtual bool acceptsPipedInput() const { return true; } |
| 121 | virtual bool canPipeOutput() const { return false; } |
| 122 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 123 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 124 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 125 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 126 | }; |
| 127 | |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 128 | class VISIBILITY_HIDDEN Link : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 129 | public: |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 130 | Link(const ToolChain &TC) : Common("gcc::Link", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 131 | |
| 132 | virtual bool acceptsPipedInput() const { return false; } |
| 133 | virtual bool canPipeOutput() const { return false; } |
| 134 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 135 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 136 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 137 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 138 | }; |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 139 | } // end namespace gcc |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 140 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 141 | namespace darwin { |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 142 | class VISIBILITY_HIDDEN DarwinTool : public Tool { |
| 143 | protected: |
| 144 | void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 145 | |
| 146 | const toolchains::Darwin &getDarwinToolChain() const { |
| 147 | return reinterpret_cast<const toolchains::Darwin&>(getToolChain()); |
| 148 | } |
| 149 | |
| 150 | public: |
Daniel Dunbar | e017ecc | 2009-12-19 17:50:07 +0000 | [diff] [blame] | 151 | DarwinTool(const char *Name, const ToolChain &TC) : Tool(Name, TC) {} |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 152 | }; |
| 153 | |
| 154 | class VISIBILITY_HIDDEN CC1 : public DarwinTool { |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 155 | public: |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 156 | static const char *getBaseInputName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 157 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 158 | static const char *getBaseInputStem(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 159 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 160 | static const char *getDependencyFileName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 161 | const InputInfoList &Inputs); |
| 162 | |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 163 | protected: |
| 164 | const char *getCC1Name(types::ID Type) const; |
| 165 | |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 166 | void AddCC1Args(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 167 | void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 168 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 169 | const ArgStringList &OutputArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 170 | void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 171 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 172 | const ArgStringList &OutputArgs) const; |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 173 | void AddCPPUniqueOptionsArgs(const ArgList &Args, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 174 | ArgStringList &CmdArgs, |
| 175 | const InputInfoList &Inputs) const; |
| 176 | void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 177 | |
| 178 | public: |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 179 | CC1(const char *Name, const ToolChain &TC) : DarwinTool(Name, TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 180 | |
| 181 | virtual bool acceptsPipedInput() const { return true; } |
| 182 | virtual bool canPipeOutput() const { return true; } |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 183 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 184 | virtual bool hasIntegratedCPP() const { return true; } |
| 185 | }; |
| 186 | |
| 187 | class VISIBILITY_HIDDEN Preprocess : public CC1 { |
| 188 | public: |
| 189 | Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess", TC) {} |
| 190 | |
| 191 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 192 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 193 | const InputInfo &Output, |
| 194 | const InputInfoList &Inputs, |
| 195 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 196 | const char *LinkingOutput) const; |
| 197 | }; |
| 198 | |
| 199 | class VISIBILITY_HIDDEN Compile : public CC1 { |
| 200 | public: |
| 201 | Compile(const ToolChain &TC) : CC1("darwin::Compile", TC) {} |
| 202 | |
| 203 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 204 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 205 | const InputInfo &Output, |
| 206 | const InputInfoList &Inputs, |
| 207 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 208 | const char *LinkingOutput) const; |
| 209 | }; |
| 210 | |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 211 | class VISIBILITY_HIDDEN Assemble : public DarwinTool { |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 212 | public: |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 213 | Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble", TC) {} |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 214 | |
| 215 | virtual bool acceptsPipedInput() const { return true; } |
| 216 | virtual bool canPipeOutput() const { return false; } |
| 217 | virtual bool hasIntegratedCPP() const { return false; } |
| 218 | |
| 219 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 220 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 221 | const InputInfo &Output, |
| 222 | const InputInfoList &Inputs, |
| 223 | const ArgList &TCArgs, |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 224 | const char *LinkingOutput) const; |
| 225 | }; |
| 226 | |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 227 | class VISIBILITY_HIDDEN Link : public DarwinTool { |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 228 | void AddLinkArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
| 229 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 230 | public: |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 231 | Link(const ToolChain &TC) : DarwinTool("darwin::Link", TC) {} |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 232 | |
| 233 | virtual bool acceptsPipedInput() const { return false; } |
| 234 | virtual bool canPipeOutput() const { return false; } |
| 235 | virtual bool hasIntegratedCPP() const { return false; } |
| 236 | |
| 237 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 238 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 239 | const InputInfo &Output, |
| 240 | const InputInfoList &Inputs, |
| 241 | const ArgList &TCArgs, |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 242 | const char *LinkingOutput) const; |
| 243 | }; |
| 244 | |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 245 | class VISIBILITY_HIDDEN Lipo : public DarwinTool { |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 246 | public: |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 247 | Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", TC) {} |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 248 | |
| 249 | virtual bool acceptsPipedInput() const { return false; } |
| 250 | virtual bool canPipeOutput() const { return false; } |
| 251 | virtual bool hasIntegratedCPP() const { return false; } |
| 252 | |
| 253 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 254 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 255 | const InputInfo &Output, |
| 256 | const InputInfoList &Inputs, |
| 257 | const ArgList &TCArgs, |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 258 | const char *LinkingOutput) const; |
| 259 | }; |
| 260 | } |
| 261 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 262 | /// openbsd -- Directly call GNU Binutils assembler and linker |
| 263 | namespace openbsd { |
| 264 | class VISIBILITY_HIDDEN Assemble : public Tool { |
| 265 | public: |
| 266 | Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", TC) {} |
| 267 | |
| 268 | virtual bool acceptsPipedInput() const { return true; } |
| 269 | virtual bool canPipeOutput() const { return true; } |
| 270 | virtual bool hasIntegratedCPP() const { return false; } |
| 271 | |
| 272 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 273 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 274 | const InputInfo &Output, |
| 275 | const InputInfoList &Inputs, |
| 276 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 277 | const char *LinkingOutput) const; |
| 278 | }; |
| 279 | class VISIBILITY_HIDDEN Link : public Tool { |
| 280 | public: |
| 281 | Link(const ToolChain &TC) : Tool("openbsd::Link", TC) {} |
| 282 | |
| 283 | virtual bool acceptsPipedInput() const { return true; } |
| 284 | virtual bool canPipeOutput() const { return true; } |
| 285 | virtual bool hasIntegratedCPP() const { return false; } |
| 286 | |
| 287 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 288 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 289 | const InputInfo &Output, |
| 290 | const InputInfoList &Inputs, |
| 291 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 292 | const char *LinkingOutput) const; |
| 293 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 294 | } // end namespace openbsd |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 295 | |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 296 | /// freebsd -- Directly call GNU Binutils assembler and linker |
| 297 | namespace freebsd { |
| 298 | class VISIBILITY_HIDDEN Assemble : public Tool { |
| 299 | public: |
| 300 | Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", TC) {} |
| 301 | |
| 302 | virtual bool acceptsPipedInput() const { return true; } |
| 303 | virtual bool canPipeOutput() const { return true; } |
| 304 | virtual bool hasIntegratedCPP() const { return false; } |
| 305 | |
| 306 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 307 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 308 | const InputInfo &Output, |
| 309 | const InputInfoList &Inputs, |
| 310 | const ArgList &TCArgs, |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 311 | const char *LinkingOutput) const; |
| 312 | }; |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 313 | class VISIBILITY_HIDDEN Link : public Tool { |
| 314 | public: |
| 315 | Link(const ToolChain &TC) : Tool("freebsd::Link", TC) {} |
| 316 | |
| 317 | virtual bool acceptsPipedInput() const { return true; } |
| 318 | virtual bool canPipeOutput() const { return true; } |
| 319 | virtual bool hasIntegratedCPP() const { return false; } |
| 320 | |
| 321 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 322 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 323 | const InputInfo &Output, |
| 324 | const InputInfoList &Inputs, |
| 325 | const ArgList &TCArgs, |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 326 | const char *LinkingOutput) const; |
| 327 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 328 | } // end namespace freebsd |
| 329 | |
| 330 | /// auroraux -- Directly call GNU Binutils assembler and linker |
| 331 | namespace auroraux { |
| 332 | class VISIBILITY_HIDDEN Assemble : public Tool { |
| 333 | public: |
| 334 | Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", TC) {} |
| 335 | |
| 336 | virtual bool acceptsPipedInput() const { return true; } |
| 337 | virtual bool canPipeOutput() const { return true; } |
| 338 | virtual bool hasIntegratedCPP() const { return false; } |
| 339 | |
| 340 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 341 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 342 | const InputInfo &Output, |
| 343 | const InputInfoList &Inputs, |
| 344 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 345 | const char *LinkingOutput) const; |
| 346 | }; |
| 347 | class VISIBILITY_HIDDEN Link : public Tool { |
| 348 | public: |
| 349 | Link(const ToolChain &TC) : Tool("auroraux::Link", TC) {} |
| 350 | |
| 351 | virtual bool acceptsPipedInput() const { return true; } |
| 352 | virtual bool canPipeOutput() const { return true; } |
| 353 | virtual bool hasIntegratedCPP() const { return false; } |
| 354 | |
| 355 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 356 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 357 | const InputInfo &Output, |
| 358 | const InputInfoList &Inputs, |
| 359 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 360 | const char *LinkingOutput) const; |
| 361 | }; |
| 362 | } // end namespace auroraux |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 363 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 364 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
| 365 | namespace dragonfly { |
| 366 | class VISIBILITY_HIDDEN Assemble : public Tool { |
| 367 | public: |
| 368 | Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", TC) {} |
| 369 | |
| 370 | virtual bool acceptsPipedInput() const { return true; } |
| 371 | virtual bool canPipeOutput() const { return true; } |
| 372 | virtual bool hasIntegratedCPP() const { return false; } |
| 373 | |
| 374 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 375 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 376 | const InputInfo &Output, |
| 377 | const InputInfoList &Inputs, |
| 378 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 379 | const char *LinkingOutput) const; |
| 380 | }; |
| 381 | class VISIBILITY_HIDDEN Link : public Tool { |
| 382 | public: |
| 383 | Link(const ToolChain &TC) : Tool("dragonfly::Link", TC) {} |
| 384 | |
| 385 | virtual bool acceptsPipedInput() const { return true; } |
| 386 | virtual bool canPipeOutput() const { return true; } |
| 387 | virtual bool hasIntegratedCPP() const { return false; } |
| 388 | |
| 389 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 390 | Job &Dest, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 391 | const InputInfo &Output, |
| 392 | const InputInfoList &Inputs, |
| 393 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 394 | const char *LinkingOutput) const; |
| 395 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 396 | } // end namespace dragonfly |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 397 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 398 | } // end namespace toolchains |
| 399 | } // end namespace driver |
| 400 | } // end namespace clang |
| 401 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 402 | #endif // CLANG_LIB_DRIVER_TOOLS_H_ |