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