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