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