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 | |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 17 | #include "llvm/ADT/Triple.h" |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 18 | #include "llvm/Support/Compiler.h" |
| 19 | |
| 20 | namespace clang { |
John McCall | 5fb5df9 | 2012-06-20 06:18:46 +0000 | [diff] [blame^] | 21 | class ObjCRuntime; |
| 22 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 23 | namespace driver { |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 24 | class Driver; |
| 25 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 26 | namespace toolchains { |
Daniel Dunbar | f0a5b9b | 2009-09-04 18:34:51 +0000 | [diff] [blame] | 27 | class Darwin; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 28 | } |
| 29 | |
Daniel Dunbar | 15abb2e | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 30 | namespace tools { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 31 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 32 | /// \brief Clang compiler tool. |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 33 | class LLVM_LIBRARY_VISIBILITY Clang : public Tool { |
Peter Collingbourne | 9b515cb | 2011-11-06 00:40:05 +0000 | [diff] [blame] | 34 | void AddPreprocessingOptions(Compilation &C, |
| 35 | const Driver &D, |
Douglas Gregor | 111af7d | 2009-04-18 00:34:01 +0000 | [diff] [blame] | 36 | const ArgList &Args, |
Daniel Dunbar | d067f7f | 2009-04-08 23:54:23 +0000 | [diff] [blame] | 37 | ArgStringList &CmdArgs, |
| 38 | const InputInfo &Output, |
| 39 | const InputInfoList &Inputs) const; |
| 40 | |
Daniel Dunbar | c9388c1 | 2011-03-17 17:10:06 +0000 | [diff] [blame] | 41 | void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 42 | bool KernelOrKext) const; |
Eric Christopher | 0b26a61 | 2010-03-02 02:41:08 +0000 | [diff] [blame] | 43 | void AddMIPSTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Hal Finkel | 8eb5928 | 2012-06-11 22:35:19 +0000 | [diff] [blame] | 44 | void AddPPCTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Bruno Cardoso Lopes | e7f211c | 2010-11-09 17:21:19 +0000 | [diff] [blame] | 45 | void AddSparcTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 3b3191f | 2009-09-09 22:33:08 +0000 | [diff] [blame] | 46 | void AddX86TargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 47 | void AddHexagonTargetArgs (const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 3b3191f | 2009-09-09 22:33:08 +0000 | [diff] [blame] | 48 | |
John McCall | 5fb5df9 | 2012-06-20 06:18:46 +0000 | [diff] [blame^] | 49 | enum RewriteKind { RK_None, RK_Fragile, RK_NonFragile }; |
| 50 | |
| 51 | ObjCRuntime AddObjCRuntimeArgs(const ArgList &args, ArgStringList &cmdArgs, |
| 52 | RewriteKind rewrite) const; |
| 53 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 54 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 55 | Clang(const ToolChain &TC) : Tool("clang", "clang frontend", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 56 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 57 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | c434394 | 2010-02-03 03:07:56 +0000 | [diff] [blame] | 58 | virtual bool hasIntegratedAssembler() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 59 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 60 | |
| 61 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 62 | const InputInfo &Output, |
| 63 | const InputInfoList &Inputs, |
| 64 | const ArgList &TCArgs, |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 65 | const char *LinkingOutput) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 66 | }; |
| 67 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 68 | /// \brief Clang integrated assembler tool. |
| 69 | class LLVM_LIBRARY_VISIBILITY ClangAs : public Tool { |
Jim Grosbach | 576452b | 2012-02-10 20:37:10 +0000 | [diff] [blame] | 70 | void AddARMTargetArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 71 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 72 | ClangAs(const ToolChain &TC) : Tool("clang::as", |
| 73 | "clang integrated assembler", TC) {} |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 74 | |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 75 | virtual bool hasGoodDiagnostics() const { return true; } |
| 76 | virtual bool hasIntegratedAssembler() const { return false; } |
| 77 | virtual bool hasIntegratedCPP() const { return false; } |
| 78 | |
| 79 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 4f5e79c | 2010-05-20 21:30:13 +0000 | [diff] [blame] | 80 | const InputInfo &Output, |
| 81 | const InputInfoList &Inputs, |
| 82 | const ArgList &TCArgs, |
| 83 | const char *LinkingOutput) const; |
| 84 | }; |
| 85 | |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 86 | /// gcc - Generic GCC tool implementations. |
| 87 | namespace gcc { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 88 | class LLVM_LIBRARY_VISIBILITY Common : public Tool { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 89 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 90 | Common(const char *Name, const char *ShortName, |
| 91 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 92 | |
| 93 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 94 | const InputInfo &Output, |
| 95 | const InputInfoList &Inputs, |
| 96 | const ArgList &TCArgs, |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 97 | const char *LinkingOutput) const; |
| 98 | |
| 99 | /// RenderExtraToolArgs - Render any arguments necessary to force |
| 100 | /// the particular tool mode. |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 101 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 102 | ArgStringList &CmdArgs) const = 0; |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 103 | }; |
| 104 | |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 105 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 106 | class LLVM_LIBRARY_VISIBILITY Preprocess : public Common { |
Daniel Dunbar | a3246a0 | 2009-03-18 08:07:30 +0000 | [diff] [blame] | 107 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 108 | Preprocess(const ToolChain &TC) : Common("gcc::Preprocess", |
| 109 | "gcc preprocessor", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 110 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 111 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 112 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 113 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 114 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 115 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 116 | }; |
| 117 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 118 | class LLVM_LIBRARY_VISIBILITY Precompile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 119 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 120 | Precompile(const ToolChain &TC) : Common("gcc::Precompile", |
| 121 | "gcc precompile", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 122 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 123 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 124 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 125 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 126 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 127 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 128 | }; |
| 129 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 130 | class LLVM_LIBRARY_VISIBILITY Compile : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 131 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 132 | Compile(const ToolChain &TC) : Common("gcc::Compile", |
| 133 | "gcc frontend", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 134 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 135 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 136 | virtual bool hasIntegratedCPP() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 137 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 138 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 139 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 140 | }; |
| 141 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 142 | class LLVM_LIBRARY_VISIBILITY Assemble : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 143 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 144 | Assemble(const ToolChain &TC) : Common("gcc::Assemble", |
| 145 | "assembler (via gcc)", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 146 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 147 | virtual bool hasIntegratedCPP() const { return false; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 148 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 149 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 150 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 151 | }; |
| 152 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 153 | class LLVM_LIBRARY_VISIBILITY Link : public Common { |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 154 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 155 | Link(const ToolChain &TC) : Common("gcc::Link", |
| 156 | "linker (via gcc)", TC) {} |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 157 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 158 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 159 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 1a093d2 | 2009-03-18 06:00:36 +0000 | [diff] [blame] | 160 | |
Daniel Dunbar | 4e29505 | 2010-01-25 22:35:08 +0000 | [diff] [blame] | 161 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 162 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 163 | }; |
Daniel Dunbar | 82116f8 | 2009-03-17 22:45:24 +0000 | [diff] [blame] | 164 | } // end namespace gcc |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 165 | |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 166 | namespace hexagon { |
| 167 | // For Hexagon, we do not need to instantiate tools for PreProcess, PreCompile and Compile. |
| 168 | // We simply use "clang -cc1" for those actions. |
| 169 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 170 | public: |
| 171 | Assemble(const ToolChain &TC) : Tool("hexagon::Assemble", |
| 172 | "hexagon-as", TC) {} |
| 173 | |
| 174 | virtual bool hasIntegratedCPP() const { return false; } |
| 175 | |
| 176 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 177 | ArgStringList &CmdArgs) const; |
| 178 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 179 | const InputInfo &Output, |
| 180 | const InputInfoList &Inputs, |
| 181 | const ArgList &TCArgs, |
| 182 | const char *LinkingOutput) const; |
| 183 | }; |
| 184 | |
| 185 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 186 | public: |
| 187 | Link(const ToolChain &TC) : Tool("hexagon::Link", |
| 188 | "hexagon-ld", TC) {} |
| 189 | |
| 190 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 191 | virtual bool isLinkJob() const { return true; } |
Tony Linthicum | 76329bf | 2011-12-12 21:14:55 +0000 | [diff] [blame] | 192 | |
| 193 | virtual void RenderExtraToolArgs(const JobAction &JA, |
| 194 | ArgStringList &CmdArgs) const; |
| 195 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 196 | const InputInfo &Output, |
| 197 | const InputInfoList &Inputs, |
| 198 | const ArgList &TCArgs, |
| 199 | const char *LinkingOutput) const; |
| 200 | }; |
| 201 | } // end namespace hexagon. |
| 202 | |
| 203 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 204 | namespace darwin { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 205 | class LLVM_LIBRARY_VISIBILITY DarwinTool : public Tool { |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 206 | virtual void anchor(); |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 207 | protected: |
| 208 | void AddDarwinArch(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 209 | |
| 210 | const toolchains::Darwin &getDarwinToolChain() const { |
| 211 | return reinterpret_cast<const toolchains::Darwin&>(getToolChain()); |
| 212 | } |
| 213 | |
| 214 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 215 | DarwinTool(const char *Name, const char *ShortName, |
| 216 | const ToolChain &TC) : Tool(Name, ShortName, TC) {} |
Daniel Dunbar | e9ded43 | 2009-09-09 18:36:20 +0000 | [diff] [blame] | 217 | }; |
| 218 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 219 | class LLVM_LIBRARY_VISIBILITY CC1 : public DarwinTool { |
David Blaikie | 68e081d | 2011-12-20 02:48:34 +0000 | [diff] [blame] | 220 | virtual void anchor(); |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 221 | public: |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 222 | static const char *getBaseInputName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 223 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 224 | static const char *getBaseInputStem(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 225 | const InputInfoList &Input); |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 226 | static const char *getDependencyFileName(const ArgList &Args, |
Daniel Dunbar | 52e96cc | 2009-03-30 00:34:04 +0000 | [diff] [blame] | 227 | const InputInfoList &Inputs); |
| 228 | |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 229 | protected: |
| 230 | const char *getCC1Name(types::ID Type) const; |
| 231 | |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 232 | void AddCC1Args(const ArgList &Args, ArgStringList &CmdArgs) const; |
Chad Rosier | bc5ea3d | 2011-08-17 18:24:55 +0000 | [diff] [blame] | 233 | void RemoveCC1UnsupportedArgs(ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 234 | void AddCC1OptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 235 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 236 | const ArgStringList &OutputArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 237 | void AddCPPOptionsArgs(const ArgList &Args, ArgStringList &CmdArgs, |
| 238 | const InputInfoList &Inputs, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 239 | const ArgStringList &OutputArgs) const; |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 240 | void AddCPPUniqueOptionsArgs(const ArgList &Args, |
Daniel Dunbar | afec1f5 | 2009-03-29 18:40:18 +0000 | [diff] [blame] | 241 | ArgStringList &CmdArgs, |
| 242 | const InputInfoList &Inputs) const; |
| 243 | void AddCPPArgs(const ArgList &Args, ArgStringList &CmdArgs) const; |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 244 | |
| 245 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 246 | CC1(const char *Name, const char *ShortName, |
| 247 | const ToolChain &TC) : DarwinTool(Name, ShortName, TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 248 | |
Daniel Dunbar | 3d45e17 | 2010-04-06 17:07:49 +0000 | [diff] [blame] | 249 | virtual bool hasGoodDiagnostics() const { return true; } |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 250 | virtual bool hasIntegratedCPP() const { return true; } |
| 251 | }; |
| 252 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 253 | class LLVM_LIBRARY_VISIBILITY Preprocess : public CC1 { |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 254 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 255 | Preprocess(const ToolChain &TC) : CC1("darwin::Preprocess", |
| 256 | "gcc preprocessor", TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 257 | |
| 258 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 259 | const InputInfo &Output, |
| 260 | const InputInfoList &Inputs, |
| 261 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 262 | const char *LinkingOutput) const; |
| 263 | }; |
| 264 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 265 | class LLVM_LIBRARY_VISIBILITY Compile : public CC1 { |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 266 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 267 | Compile(const ToolChain &TC) : CC1("darwin::Compile", "gcc frontend", TC) {} |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 268 | |
| 269 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 270 | const InputInfo &Output, |
| 271 | const InputInfoList &Inputs, |
| 272 | const ArgList &TCArgs, |
Daniel Dunbar | e6adeee | 2009-03-29 17:08:39 +0000 | [diff] [blame] | 273 | const char *LinkingOutput) const; |
| 274 | }; |
| 275 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 276 | class LLVM_LIBRARY_VISIBILITY Assemble : public DarwinTool { |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 277 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 278 | Assemble(const ToolChain &TC) : DarwinTool("darwin::Assemble", |
| 279 | "assembler", TC) {} |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 280 | |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 281 | virtual bool hasIntegratedCPP() const { return false; } |
| 282 | |
| 283 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 284 | const InputInfo &Output, |
| 285 | const InputInfoList &Inputs, |
| 286 | const ArgList &TCArgs, |
Daniel Dunbar | be22084 | 2009-03-20 16:06:39 +0000 | [diff] [blame] | 287 | const char *LinkingOutput) const; |
| 288 | }; |
| 289 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 290 | class LLVM_LIBRARY_VISIBILITY Link : public DarwinTool { |
Daniel Dunbar | ccbc452 | 2010-09-09 21:51:05 +0000 | [diff] [blame] | 291 | void AddLinkArgs(Compilation &C, const ArgList &Args, |
| 292 | ArgStringList &CmdArgs) const; |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 293 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 294 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 295 | Link(const ToolChain &TC) : DarwinTool("darwin::Link", "linker", TC) {} |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 296 | |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 297 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 298 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 299 | |
| 300 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 301 | const InputInfo &Output, |
| 302 | const InputInfoList &Inputs, |
| 303 | const ArgList &TCArgs, |
Daniel Dunbar | c196421 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 304 | const char *LinkingOutput) const; |
| 305 | }; |
| 306 | |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 307 | class LLVM_LIBRARY_VISIBILITY Lipo : public DarwinTool { |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 308 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 309 | Lipo(const ToolChain &TC) : DarwinTool("darwin::Lipo", "lipo", TC) {} |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 310 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 311 | virtual bool hasIntegratedCPP() const { return false; } |
| 312 | |
| 313 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 314 | const InputInfo &Output, |
| 315 | const InputInfoList &Inputs, |
| 316 | const ArgList &TCArgs, |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 317 | const char *LinkingOutput) const; |
| 318 | }; |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 319 | |
| 320 | class LLVM_LIBRARY_VISIBILITY Dsymutil : public DarwinTool { |
| 321 | public: |
| 322 | Dsymutil(const ToolChain &TC) : DarwinTool("darwin::Dsymutil", |
| 323 | "dsymutil", TC) {} |
| 324 | |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 325 | virtual bool hasIntegratedCPP() const { return false; } |
| 326 | |
| 327 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 8829962 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 328 | const InputInfo &Output, |
| 329 | const InputInfoList &Inputs, |
| 330 | const ArgList &TCArgs, |
| 331 | const char *LinkingOutput) const; |
| 332 | }; |
Eric Christopher | 551ef45 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 333 | |
| 334 | class LLVM_LIBRARY_VISIBILITY VerifyDebug : public DarwinTool { |
| 335 | public: |
| 336 | VerifyDebug(const ToolChain &TC) : DarwinTool("darwin::VerifyDebug", |
| 337 | "dwarfdump", TC) {} |
| 338 | |
| 339 | virtual bool hasIntegratedCPP() const { return false; } |
| 340 | |
| 341 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 342 | const InputInfo &Output, |
| 343 | const InputInfoList &Inputs, |
| 344 | const ArgList &TCArgs, |
| 345 | const char *LinkingOutput) const; |
| 346 | }; |
| 347 | |
Daniel Dunbar | 64ed5e3 | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 348 | } |
| 349 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 350 | /// openbsd -- Directly call GNU Binutils assembler and linker |
| 351 | namespace openbsd { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 352 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 353 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 354 | Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler", |
| 355 | TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 356 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 357 | virtual bool hasIntegratedCPP() const { return false; } |
| 358 | |
| 359 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 360 | const InputInfo &Output, |
| 361 | const InputInfoList &Inputs, |
| 362 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 363 | const char *LinkingOutput) const; |
| 364 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 365 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 366 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 367 | Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {} |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 368 | |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 369 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 370 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 371 | |
| 372 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 373 | const InputInfo &Output, |
| 374 | const InputInfoList &Inputs, |
| 375 | const ArgList &TCArgs, |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 376 | const char *LinkingOutput) const; |
| 377 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 378 | } // end namespace openbsd |
Daniel Dunbar | 10de9e6 | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 379 | |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 380 | /// freebsd -- Directly call GNU Binutils assembler and linker |
| 381 | namespace freebsd { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 382 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 383 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 384 | Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler", |
| 385 | TC) {} |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 386 | |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 387 | virtual bool hasIntegratedCPP() const { return false; } |
| 388 | |
| 389 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 390 | const InputInfo &Output, |
| 391 | const InputInfoList &Inputs, |
| 392 | const ArgList &TCArgs, |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 393 | const char *LinkingOutput) const; |
| 394 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 395 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 396 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 397 | Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {} |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 398 | |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 399 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 400 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 401 | |
| 402 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 403 | const InputInfo &Output, |
| 404 | const InputInfoList &Inputs, |
| 405 | const ArgList &TCArgs, |
Daniel Dunbar | d854c8d | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 406 | const char *LinkingOutput) const; |
| 407 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 408 | } // end namespace freebsd |
| 409 | |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 410 | /// netbsd -- Directly call GNU Binutils assembler and linker |
| 411 | namespace netbsd { |
| 412 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 413 | |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 414 | public: |
Joerg Sonnenberger | d64c60e | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 415 | Assemble(const ToolChain &TC) |
| 416 | : Tool("netbsd::Assemble", "assembler", TC) {} |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 417 | |
| 418 | virtual bool hasIntegratedCPP() const { return false; } |
| 419 | |
| 420 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 421 | const InputInfo &Output, |
| 422 | const InputInfoList &Inputs, |
| 423 | const ArgList &TCArgs, |
| 424 | const char *LinkingOutput) const; |
| 425 | }; |
| 426 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Joerg Sonnenberger | 637603a | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 427 | |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 428 | public: |
Joerg Sonnenberger | d64c60e | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 429 | Link(const ToolChain &TC) |
| 430 | : Tool("netbsd::Link", "linker", TC) {} |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 431 | |
| 432 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 433 | virtual bool isLinkJob() const { return true; } |
Benjamin Kramer | 24f1d3e | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 434 | |
| 435 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 436 | const InputInfo &Output, |
| 437 | const InputInfoList &Inputs, |
| 438 | const ArgList &TCArgs, |
| 439 | const char *LinkingOutput) const; |
| 440 | }; |
| 441 | } // end namespace netbsd |
| 442 | |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 443 | /// linux -- Directly call GNU Binutils assembler and linker |
| 444 | namespace linuxtools { |
| 445 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 446 | public: |
| 447 | Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler", |
| 448 | TC) {} |
| 449 | |
| 450 | virtual bool hasIntegratedCPP() const { return false; } |
| 451 | |
| 452 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 453 | const InputInfo &Output, |
| 454 | const InputInfoList &Inputs, |
| 455 | const ArgList &TCArgs, |
| 456 | const char *LinkingOutput) const; |
| 457 | }; |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 458 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 459 | public: |
| 460 | Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {} |
| 461 | |
| 462 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 463 | virtual bool isLinkJob() const { return true; } |
Rafael Espindola | c8f008f | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 464 | |
| 465 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 466 | const InputInfo &Output, |
| 467 | const InputInfoList &Inputs, |
| 468 | const ArgList &TCArgs, |
| 469 | const char *LinkingOutput) const; |
| 470 | }; |
Rafael Espindola | 92b0093 | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 471 | } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 472 | /// minix -- Directly call GNU Binutils assembler and linker |
| 473 | namespace minix { |
| 474 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 475 | public: |
| 476 | Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler", |
| 477 | TC) {} |
| 478 | |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 479 | virtual bool hasIntegratedCPP() const { return false; } |
| 480 | |
| 481 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 482 | const InputInfo &Output, |
| 483 | const InputInfoList &Inputs, |
| 484 | const ArgList &TCArgs, |
| 485 | const char *LinkingOutput) const; |
| 486 | }; |
| 487 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 488 | public: |
| 489 | Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {} |
| 490 | |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 491 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 492 | virtual bool isLinkJob() const { return true; } |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 493 | |
| 494 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 3e2ee14 | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 495 | const InputInfo &Output, |
| 496 | const InputInfoList &Inputs, |
| 497 | const ArgList &TCArgs, |
| 498 | const char *LinkingOutput) const; |
| 499 | }; |
| 500 | } // end namespace minix |
| 501 | |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 502 | /// solaris -- Directly call Solaris assembler and linker |
| 503 | namespace solaris { |
| 504 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 505 | public: |
| 506 | Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler", |
| 507 | TC) {} |
| 508 | |
| 509 | virtual bool hasIntegratedCPP() const { return false; } |
| 510 | |
| 511 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 512 | const InputInfo &Output, |
| 513 | const InputInfoList &Inputs, |
| 514 | const ArgList &TCArgs, |
| 515 | const char *LinkingOutput) const; |
| 516 | }; |
| 517 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 518 | public: |
| 519 | Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {} |
| 520 | |
| 521 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 522 | virtual bool isLinkJob() const { return true; } |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 523 | |
| 524 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 525 | const InputInfo &Output, |
| 526 | const InputInfoList &Inputs, |
| 527 | const ArgList &TCArgs, |
| 528 | const char *LinkingOutput) const; |
| 529 | }; |
David Chisnall | a9ed5d7 | 2012-02-15 16:25:46 +0000 | [diff] [blame] | 530 | } // end namespace solaris |
David Chisnall | f571cde | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 531 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 532 | /// auroraux -- Directly call GNU Binutils assembler and linker |
| 533 | namespace auroraux { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 534 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 535 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 536 | Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler", |
| 537 | TC) {} |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 538 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 539 | virtual bool hasIntegratedCPP() const { return false; } |
| 540 | |
| 541 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 542 | const InputInfo &Output, |
| 543 | const InputInfoList &Inputs, |
| 544 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 545 | const char *LinkingOutput) const; |
| 546 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 547 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 548 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 549 | Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {} |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 550 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 551 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 552 | virtual bool isLinkJob() const { return true; } |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 553 | |
| 554 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 555 | const InputInfo &Output, |
| 556 | const InputInfoList &Inputs, |
| 557 | const ArgList &TCArgs, |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 558 | const char *LinkingOutput) const; |
| 559 | }; |
| 560 | } // end namespace auroraux |
Daniel Dunbar | 8eb473c | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 561 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 562 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
| 563 | namespace dragonfly { |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 564 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 565 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 566 | Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler", |
| 567 | TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 568 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 569 | virtual bool hasIntegratedCPP() const { return false; } |
| 570 | |
| 571 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 572 | const InputInfo &Output, |
| 573 | const InputInfoList &Inputs, |
| 574 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 575 | const char *LinkingOutput) const; |
| 576 | }; |
Duncan Sands | af260b9 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 577 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 578 | public: |
Daniel Dunbar | 1cb532c | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 579 | Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {} |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 580 | |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 581 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 582 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 583 | |
| 584 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 11289f4 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 585 | const InputInfo &Output, |
| 586 | const InputInfoList &Inputs, |
| 587 | const ArgList &TCArgs, |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 588 | const char *LinkingOutput) const; |
| 589 | }; |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 590 | } // end namespace dragonfly |
Daniel Dunbar | cc91234 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 591 | |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 592 | /// Visual studio tools. |
| 593 | namespace visualstudio { |
| 594 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 595 | public: |
| 596 | Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {} |
| 597 | |
| 598 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | bee5a1d | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 599 | virtual bool isLinkJob() const { return true; } |
Michael J. Spencer | b186bc3 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 600 | |
| 601 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 602 | const InputInfo &Output, |
| 603 | const InputInfoList &Inputs, |
| 604 | const ArgList &TCArgs, |
| 605 | const char *LinkingOutput) const; |
| 606 | }; |
| 607 | } // end namespace visualstudio |
| 608 | |
Daniel Dunbar | 5903d8c | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 609 | } // end namespace toolchains |
| 610 | } // end namespace driver |
| 611 | } // end namespace clang |
| 612 | |
Edward O'Callaghan | 856e4ff | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 613 | #endif // CLANG_LIB_DRIVER_TOOLS_H_ |