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; } |
Chad Rosier | 75dbc71 | 2013-02-01 18:30:26 +0000 | [diff] [blame] | 281 | virtual bool isDsymutilJob() const { return true; } |
Daniel Dunbar | 6e0f254 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 282 | |
| 283 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Daniel Dunbar | 6e0f254 | 2010-06-04 18:28:36 +0000 | [diff] [blame] | 284 | const InputInfo &Output, |
| 285 | const InputInfoList &Inputs, |
| 286 | const ArgList &TCArgs, |
| 287 | const char *LinkingOutput) const; |
| 288 | }; |
Eric Christopher | f857186 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 289 | |
| 290 | class LLVM_LIBRARY_VISIBILITY VerifyDebug : public DarwinTool { |
| 291 | public: |
| 292 | VerifyDebug(const ToolChain &TC) : DarwinTool("darwin::VerifyDebug", |
Eric Christopher | 27e2b98 | 2012-12-18 00:31:10 +0000 | [diff] [blame] | 293 | "dwarfdump", TC) {} |
Eric Christopher | f857186 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 294 | |
| 295 | virtual bool hasIntegratedCPP() const { return false; } |
| 296 | |
| 297 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Eric Christopher | 27e2b98 | 2012-12-18 00:31:10 +0000 | [diff] [blame] | 298 | const InputInfo &Output, |
| 299 | const InputInfoList &Inputs, |
| 300 | const ArgList &TCArgs, |
| 301 | const char *LinkingOutput) const; |
Eric Christopher | f857186 | 2011-08-23 17:56:55 +0000 | [diff] [blame] | 302 | }; |
| 303 | |
Daniel Dunbar | ff7488d | 2009-03-20 00:52:38 +0000 | [diff] [blame] | 304 | } |
| 305 | |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 306 | /// openbsd -- Directly call GNU Binutils assembler and linker |
| 307 | namespace openbsd { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 308 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 309 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 310 | Assemble(const ToolChain &TC) : Tool("openbsd::Assemble", "assembler", |
| 311 | TC) {} |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 312 | |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 313 | virtual bool hasIntegratedCPP() const { return false; } |
| 314 | |
| 315 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 316 | const InputInfo &Output, |
| 317 | const InputInfoList &Inputs, |
| 318 | const ArgList &TCArgs, |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 319 | const char *LinkingOutput) const; |
| 320 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 321 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 322 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 323 | Link(const ToolChain &TC) : Tool("openbsd::Link", "linker", TC) {} |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 324 | |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 325 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 326 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 327 | |
| 328 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 329 | const InputInfo &Output, |
| 330 | const InputInfoList &Inputs, |
| 331 | const ArgList &TCArgs, |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 332 | const char *LinkingOutput) const; |
| 333 | }; |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 334 | } // end namespace openbsd |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 335 | |
Eli Friedman | 42f74f2 | 2012-08-08 23:57:20 +0000 | [diff] [blame] | 336 | /// bitrig -- Directly call GNU Binutils assembler and linker |
| 337 | namespace bitrig { |
| 338 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 339 | public: |
| 340 | Assemble(const ToolChain &TC) : Tool("bitrig::Assemble", "assembler", |
| 341 | TC) {} |
| 342 | |
| 343 | virtual bool hasIntegratedCPP() const { return false; } |
| 344 | |
| 345 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 346 | const InputInfo &Output, |
| 347 | const InputInfoList &Inputs, |
| 348 | const ArgList &TCArgs, |
| 349 | const char *LinkingOutput) const; |
| 350 | }; |
| 351 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 352 | public: |
| 353 | Link(const ToolChain &TC) : Tool("bitrig::Link", "linker", TC) {} |
| 354 | |
| 355 | virtual bool hasIntegratedCPP() const { return false; } |
| 356 | virtual bool isLinkJob() const { return true; } |
| 357 | |
| 358 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 359 | const InputInfo &Output, |
| 360 | const InputInfoList &Inputs, |
| 361 | const ArgList &TCArgs, |
| 362 | const char *LinkingOutput) const; |
| 363 | }; |
| 364 | } // end namespace bitrig |
| 365 | |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 366 | /// freebsd -- Directly call GNU Binutils assembler and linker |
| 367 | namespace freebsd { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 368 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 369 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 370 | Assemble(const ToolChain &TC) : Tool("freebsd::Assemble", "assembler", |
| 371 | TC) {} |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 372 | |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 373 | virtual bool hasIntegratedCPP() const { return false; } |
| 374 | |
| 375 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 376 | const InputInfo &Output, |
| 377 | const InputInfoList &Inputs, |
| 378 | const ArgList &TCArgs, |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 379 | const char *LinkingOutput) const; |
| 380 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 381 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 382 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 383 | Link(const ToolChain &TC) : Tool("freebsd::Link", "linker", TC) {} |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 384 | |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 385 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 386 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 387 | |
| 388 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 389 | const InputInfo &Output, |
| 390 | const InputInfoList &Inputs, |
| 391 | const ArgList &TCArgs, |
Daniel Dunbar | 008f54a | 2009-04-01 19:36:32 +0000 | [diff] [blame] | 392 | const char *LinkingOutput) const; |
| 393 | }; |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 394 | } // end namespace freebsd |
| 395 | |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 396 | /// netbsd -- Directly call GNU Binutils assembler and linker |
| 397 | namespace netbsd { |
| 398 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Joerg Sonnenberger | 182564c | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 399 | |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 400 | public: |
Joerg Sonnenberger | 1bd9137 | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 401 | Assemble(const ToolChain &TC) |
| 402 | : Tool("netbsd::Assemble", "assembler", TC) {} |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 403 | |
| 404 | virtual bool hasIntegratedCPP() const { return false; } |
| 405 | |
| 406 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 407 | const InputInfo &Output, |
| 408 | const InputInfoList &Inputs, |
| 409 | const ArgList &TCArgs, |
| 410 | const char *LinkingOutput) const; |
| 411 | }; |
| 412 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Joerg Sonnenberger | 182564c | 2011-05-16 13:35:02 +0000 | [diff] [blame] | 413 | |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 414 | public: |
Joerg Sonnenberger | 1bd9137 | 2012-01-26 22:27:52 +0000 | [diff] [blame] | 415 | Link(const ToolChain &TC) |
| 416 | : Tool("netbsd::Link", "linker", TC) {} |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 417 | |
| 418 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 419 | virtual bool isLinkJob() const { return true; } |
Benjamin Kramer | 8e50a96 | 2011-02-02 18:59:27 +0000 | [diff] [blame] | 420 | |
| 421 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 422 | const InputInfo &Output, |
| 423 | const InputInfoList &Inputs, |
| 424 | const ArgList &TCArgs, |
| 425 | const char *LinkingOutput) const; |
| 426 | }; |
| 427 | } // end namespace netbsd |
| 428 | |
Rafael Espindola | ba30bbe | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 429 | /// linux -- Directly call GNU Binutils assembler and linker |
| 430 | namespace linuxtools { |
| 431 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 432 | public: |
| 433 | Assemble(const ToolChain &TC) : Tool("linux::Assemble", "assembler", |
| 434 | TC) {} |
| 435 | |
| 436 | virtual bool hasIntegratedCPP() const { return false; } |
| 437 | |
| 438 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 439 | const InputInfo &Output, |
| 440 | const InputInfoList &Inputs, |
| 441 | const ArgList &TCArgs, |
| 442 | const char *LinkingOutput) const; |
| 443 | }; |
Rafael Espindola | c1da981 | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 444 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 445 | public: |
| 446 | Link(const ToolChain &TC) : Tool("linux::Link", "linker", TC) {} |
| 447 | |
| 448 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 449 | virtual bool isLinkJob() const { return true; } |
Rafael Espindola | c1da981 | 2010-11-07 20:14:31 +0000 | [diff] [blame] | 450 | |
| 451 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 452 | const InputInfo &Output, |
| 453 | const InputInfoList &Inputs, |
| 454 | const ArgList &TCArgs, |
| 455 | const char *LinkingOutput) const; |
| 456 | }; |
Rafael Espindola | ba30bbe | 2010-08-10 00:25:48 +0000 | [diff] [blame] | 457 | } |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 458 | /// minix -- Directly call GNU Binutils assembler and linker |
| 459 | namespace minix { |
| 460 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 461 | public: |
| 462 | Assemble(const ToolChain &TC) : Tool("minix::Assemble", "assembler", |
| 463 | TC) {} |
| 464 | |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 465 | virtual bool hasIntegratedCPP() const { return false; } |
| 466 | |
| 467 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 468 | const InputInfo &Output, |
| 469 | const InputInfoList &Inputs, |
| 470 | const ArgList &TCArgs, |
| 471 | const char *LinkingOutput) const; |
| 472 | }; |
| 473 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 474 | public: |
| 475 | Link(const ToolChain &TC) : Tool("minix::Link", "linker", TC) {} |
| 476 | |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 477 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 478 | virtual bool isLinkJob() const { return true; } |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 479 | |
| 480 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Chris Lattner | 38e317d | 2010-07-07 16:01:42 +0000 | [diff] [blame] | 481 | const InputInfo &Output, |
| 482 | const InputInfoList &Inputs, |
| 483 | const ArgList &TCArgs, |
| 484 | const char *LinkingOutput) const; |
| 485 | }; |
| 486 | } // end namespace minix |
| 487 | |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 488 | /// solaris -- Directly call Solaris assembler and linker |
| 489 | namespace solaris { |
| 490 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
| 491 | public: |
| 492 | Assemble(const ToolChain &TC) : Tool("solaris::Assemble", "assembler", |
| 493 | TC) {} |
| 494 | |
| 495 | virtual bool hasIntegratedCPP() const { return false; } |
| 496 | |
| 497 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 498 | const InputInfo &Output, |
| 499 | const InputInfoList &Inputs, |
| 500 | const ArgList &TCArgs, |
| 501 | const char *LinkingOutput) const; |
| 502 | }; |
| 503 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 504 | public: |
| 505 | Link(const ToolChain &TC) : Tool("solaris::Link", "linker", TC) {} |
| 506 | |
| 507 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 508 | virtual bool isLinkJob() const { return true; } |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 509 | |
| 510 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 511 | const InputInfo &Output, |
| 512 | const InputInfoList &Inputs, |
| 513 | const ArgList &TCArgs, |
| 514 | const char *LinkingOutput) const; |
| 515 | }; |
David Chisnall | badb6cd | 2012-02-15 16:25:46 +0000 | [diff] [blame] | 516 | } // end namespace solaris |
David Chisnall | 31c4690 | 2012-02-15 13:39:01 +0000 | [diff] [blame] | 517 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 518 | /// auroraux -- Directly call GNU Binutils assembler and linker |
| 519 | namespace auroraux { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 520 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 521 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 522 | Assemble(const ToolChain &TC) : Tool("auroraux::Assemble", "assembler", |
| 523 | TC) {} |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 524 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 525 | virtual bool hasIntegratedCPP() const { return false; } |
| 526 | |
| 527 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 528 | const InputInfo &Output, |
| 529 | const InputInfoList &Inputs, |
| 530 | const ArgList &TCArgs, |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 531 | const char *LinkingOutput) const; |
| 532 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 533 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 534 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 535 | Link(const ToolChain &TC) : Tool("auroraux::Link", "linker", TC) {} |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 536 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 537 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 538 | virtual bool isLinkJob() const { return true; } |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 539 | |
| 540 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 541 | const InputInfo &Output, |
| 542 | const InputInfoList &Inputs, |
| 543 | const ArgList &TCArgs, |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 544 | const char *LinkingOutput) const; |
| 545 | }; |
| 546 | } // end namespace auroraux |
Daniel Dunbar | 68a31d4 | 2009-03-31 17:45:15 +0000 | [diff] [blame] | 547 | |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 548 | /// dragonfly -- Directly call GNU Binutils assembler and linker |
| 549 | namespace dragonfly { |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 550 | class LLVM_LIBRARY_VISIBILITY Assemble : public Tool { |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 551 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 552 | Assemble(const ToolChain &TC) : Tool("dragonfly::Assemble", "assembler", |
| 553 | TC) {} |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 554 | |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 555 | virtual bool hasIntegratedCPP() const { return false; } |
| 556 | |
| 557 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 558 | const InputInfo &Output, |
| 559 | const InputInfoList &Inputs, |
| 560 | const ArgList &TCArgs, |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 561 | const char *LinkingOutput) const; |
| 562 | }; |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame] | 563 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 564 | public: |
Daniel Dunbar | 3038204 | 2010-05-22 00:37:18 +0000 | [diff] [blame] | 565 | Link(const ToolChain &TC) : Tool("dragonfly::Link", "linker", TC) {} |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 566 | |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 567 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 568 | virtual bool isLinkJob() const { return true; } |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 569 | |
| 570 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 571 | const InputInfo &Output, |
| 572 | const InputInfoList &Inputs, |
| 573 | const ArgList &TCArgs, |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 574 | const char *LinkingOutput) const; |
| 575 | }; |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 576 | } // end namespace dragonfly |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 577 | |
Michael J. Spencer | ff58e36 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 578 | /// Visual studio tools. |
| 579 | namespace visualstudio { |
| 580 | class LLVM_LIBRARY_VISIBILITY Link : public Tool { |
| 581 | public: |
| 582 | Link(const ToolChain &TC) : Tool("visualstudio::Link", "linker", TC) {} |
| 583 | |
| 584 | virtual bool hasIntegratedCPP() const { return false; } |
Chad Rosier | 8ba9a62 | 2012-03-07 00:30:40 +0000 | [diff] [blame] | 585 | virtual bool isLinkJob() const { return true; } |
Michael J. Spencer | ff58e36 | 2010-08-21 21:55:07 +0000 | [diff] [blame] | 586 | |
| 587 | virtual void ConstructJob(Compilation &C, const JobAction &JA, |
| 588 | const InputInfo &Output, |
| 589 | const InputInfoList &Inputs, |
| 590 | const ArgList &TCArgs, |
| 591 | const char *LinkingOutput) const; |
| 592 | }; |
| 593 | } // end namespace visualstudio |
| 594 | |
Daniel Dunbar | 9c073ff | 2009-03-17 22:07:58 +0000 | [diff] [blame] | 595 | } // end namespace toolchains |
| 596 | } // end namespace driver |
| 597 | } // end namespace clang |
| 598 | |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 599 | #endif // CLANG_LIB_DRIVER_TOOLS_H_ |