Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 1 | //===--- ToolChains.h - ToolChain 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_TOOLCHAINS_H_ |
| 11 | #define CLANG_LIB_DRIVER_TOOLCHAINS_H_ |
| 12 | |
Daniel Dunbar | 670b7f4 | 2009-03-17 22:07:31 +0000 | [diff] [blame] | 13 | #include "clang/Driver/Action.h" |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 14 | #include "clang/Driver/ToolChain.h" |
| 15 | |
Daniel Dunbar | 670b7f4 | 2009-03-17 22:07:31 +0000 | [diff] [blame] | 16 | #include "llvm/ADT/DenseMap.h" |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 17 | #include "llvm/Support/Compiler.h" |
| 18 | |
Daniel Dunbar | 670b7f4 | 2009-03-17 22:07:31 +0000 | [diff] [blame] | 19 | #include "Tools.h" |
| 20 | |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 21 | namespace clang { |
| 22 | namespace driver { |
Daniel Dunbar | 985b825 | 2009-03-17 22:18:43 +0000 | [diff] [blame] | 23 | namespace toolchains { |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 24 | |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 25 | /// Generic_GCC - A tool chain using the 'gcc' command to perform |
| 26 | /// all subcommands; this relies on gcc translating the majority of |
| 27 | /// command line options. |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 28 | class LLVM_LIBRARY_VISIBILITY Generic_GCC : public ToolChain { |
Daniel Dunbar | 75358d2 | 2009-03-30 21:06:03 +0000 | [diff] [blame] | 29 | protected: |
Daniel Dunbar | 670b7f4 | 2009-03-17 22:07:31 +0000 | [diff] [blame] | 30 | mutable llvm::DenseMap<unsigned, Tool*> Tools; |
| 31 | |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 32 | public: |
Daniel Dunbar | cb8ab23 | 2009-05-22 02:53:45 +0000 | [diff] [blame] | 33 | Generic_GCC(const HostInfo &Host, const llvm::Triple& Triple); |
Daniel Dunbar | 3917608 | 2009-03-20 00:20:03 +0000 | [diff] [blame] | 34 | ~Generic_GCC(); |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 35 | |
Daniel Dunbar | 0dcb9a3 | 2009-09-09 18:36:12 +0000 | [diff] [blame] | 36 | virtual DerivedArgList *TranslateArgs(InputArgList &Args, |
| 37 | const char *BoundArch) const; |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 38 | |
Daniel Dunbar | 3917608 | 2009-03-20 00:20:03 +0000 | [diff] [blame] | 39 | virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; |
Daniel Dunbar | 670b7f4 | 2009-03-17 22:07:31 +0000 | [diff] [blame] | 40 | |
Daniel Dunbar | 3917608 | 2009-03-20 00:20:03 +0000 | [diff] [blame] | 41 | virtual bool IsUnwindTablesDefault() const; |
| 42 | virtual const char *GetDefaultRelocationModel() const; |
| 43 | virtual const char *GetForcedPicModel() const; |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 44 | }; |
| 45 | |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 46 | /// Darwin - The base Darwin tool chain. |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 47 | class LLVM_LIBRARY_VISIBILITY Darwin : public ToolChain { |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 48 | mutable llvm::DenseMap<unsigned, Tool*> Tools; |
| 49 | |
Daniel Dunbar | 2603137 | 2010-01-27 00:56:25 +0000 | [diff] [blame] | 50 | /// Whether the information on the target has been initialized. |
| 51 | // |
| 52 | // FIXME: This should be eliminated. What we want to do is make this part of |
| 53 | // the "default target for arguments" selection process, once we get out of |
| 54 | // the argument translation business. |
| 55 | mutable bool TargetInitialized; |
| 56 | |
| 57 | /// Whether we are targetting iPhoneOS target. |
| 58 | mutable bool TargetIsIPhoneOS; |
| 59 | |
| 60 | /// The OS version we are targetting. |
| 61 | mutable unsigned TargetVersion[3]; |
| 62 | |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 63 | /// The default macosx-version-min of this tool chain; empty until |
| 64 | /// initialized. |
Daniel Dunbar | 816bc31 | 2010-01-26 01:45:19 +0000 | [diff] [blame] | 65 | std::string MacosxVersionMin; |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 66 | |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 67 | public: |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 68 | Darwin(const HostInfo &Host, const llvm::Triple& Triple, |
Daniel Dunbar | cc8e189 | 2010-01-27 00:56:44 +0000 | [diff] [blame] | 69 | const unsigned (&DarwinVersion)[3]); |
Daniel Dunbar | f395528 | 2009-09-04 18:34:51 +0000 | [diff] [blame] | 70 | ~Darwin(); |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 71 | |
Daniel Dunbar | 6b200b2 | 2009-09-18 08:14:36 +0000 | [diff] [blame] | 72 | /// @name Darwin Specific Toolchain API |
| 73 | /// { |
| 74 | |
Daniel Dunbar | 2603137 | 2010-01-27 00:56:25 +0000 | [diff] [blame] | 75 | // FIXME: Eliminate these ...Target functions and derive separate tool chains |
| 76 | // for these targets and put version in constructor. |
| 77 | void setTarget(bool isIPhoneOS, unsigned Major, unsigned Minor, |
| 78 | unsigned Micro) const { |
| 79 | // FIXME: For now, allow reinitialization as long as values don't |
| 80 | // change. This will go away when we move away from argument translation. |
| 81 | if (TargetInitialized && TargetIsIPhoneOS == isIPhoneOS && |
| 82 | TargetVersion[0] == Major && TargetVersion[1] == Minor && |
| 83 | TargetVersion[2] == Micro) |
| 84 | return; |
| 85 | |
| 86 | assert(!TargetInitialized && "Target already initialized!"); |
| 87 | TargetInitialized = true; |
| 88 | TargetIsIPhoneOS = isIPhoneOS; |
| 89 | TargetVersion[0] = Major; |
| 90 | TargetVersion[1] = Minor; |
| 91 | TargetVersion[2] = Micro; |
| 92 | } |
| 93 | |
| 94 | bool isTargetIPhoneOS() const { |
| 95 | assert(TargetInitialized && "Target not initialized!"); |
| 96 | return TargetIsIPhoneOS; |
| 97 | } |
| 98 | |
Daniel Dunbar | 03d87ee | 2010-03-20 00:50:21 +0000 | [diff] [blame] | 99 | bool isTargetInitialized() const { return TargetInitialized; } |
| 100 | |
Daniel Dunbar | 2603137 | 2010-01-27 00:56:25 +0000 | [diff] [blame] | 101 | void getTargetVersion(unsigned (&Res)[3]) const { |
| 102 | assert(TargetInitialized && "Target not initialized!"); |
| 103 | Res[0] = TargetVersion[0]; |
| 104 | Res[1] = TargetVersion[1]; |
| 105 | Res[2] = TargetVersion[2]; |
| 106 | } |
| 107 | |
Daniel Dunbar | eeff406 | 2010-01-22 02:04:58 +0000 | [diff] [blame] | 108 | /// getDarwinArchName - Get the "Darwin" arch name for a particular compiler |
| 109 | /// invocation. For example, Darwin treats different ARM variations as |
| 110 | /// distinct architectures. |
| 111 | llvm::StringRef getDarwinArchName(const ArgList &Args) const; |
| 112 | |
Daniel Dunbar | ce3fdf2 | 2010-01-27 00:57:03 +0000 | [diff] [blame] | 113 | static bool isVersionLT(unsigned (&A)[3], unsigned (&B)[3]) { |
Daniel Dunbar | 608d04c | 2009-09-18 08:14:55 +0000 | [diff] [blame] | 114 | for (unsigned i=0; i < 3; ++i) { |
| 115 | if (A[i] > B[i]) return false; |
| 116 | if (A[i] < B[i]) return true; |
| 117 | } |
| 118 | return false; |
| 119 | } |
| 120 | |
Daniel Dunbar | cacb0f0 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 121 | bool isIPhoneOSVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const { |
| 122 | assert(isTargetIPhoneOS() && "Unexpected call for OS X target!"); |
| 123 | unsigned B[3] = { V0, V1, V2 }; |
Daniel Dunbar | ce3fdf2 | 2010-01-27 00:57:03 +0000 | [diff] [blame] | 124 | return isVersionLT(TargetVersion, B); |
| 125 | } |
| 126 | |
| 127 | bool isMacosxVersionLT(unsigned V0, unsigned V1=0, unsigned V2=0) const { |
| 128 | assert(!isTargetIPhoneOS() && "Unexpected call for iPhoneOS target!"); |
| 129 | unsigned B[3] = { V0, V1, V2 }; |
| 130 | return isVersionLT(TargetVersion, B); |
Daniel Dunbar | cacb0f0 | 2010-01-27 00:56:56 +0000 | [diff] [blame] | 131 | } |
| 132 | |
Daniel Dunbar | 6b200b2 | 2009-09-18 08:14:36 +0000 | [diff] [blame] | 133 | /// AddLinkSearchPathArgs - Add the linker search paths to \arg CmdArgs. |
| 134 | /// |
| 135 | /// \param Args - The input argument list. |
| 136 | /// \param CmdArgs [out] - The command argument list to append the paths |
| 137 | /// (prefixed by -L) to. |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 138 | virtual void AddLinkSearchPathArgs(const ArgList &Args, |
| 139 | ArgStringList &CmdArgs) const = 0; |
Daniel Dunbar | 02633b5 | 2009-03-26 16:23:12 +0000 | [diff] [blame] | 140 | |
Daniel Dunbar | 6cd4154 | 2009-09-18 08:15:03 +0000 | [diff] [blame] | 141 | /// AddLinkRuntimeLibArgs - Add the linker arguments to link the compiler |
| 142 | /// runtime library. |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 143 | virtual void AddLinkRuntimeLibArgs(const ArgList &Args, |
| 144 | ArgStringList &CmdArgs) const = 0; |
Daniel Dunbar | 6cd4154 | 2009-09-18 08:15:03 +0000 | [diff] [blame] | 145 | |
Daniel Dunbar | 6b200b2 | 2009-09-18 08:14:36 +0000 | [diff] [blame] | 146 | /// } |
| 147 | /// @name ToolChain Implementation |
| 148 | /// { |
| 149 | |
Daniel Dunbar | 0dcb9a3 | 2009-09-09 18:36:12 +0000 | [diff] [blame] | 150 | virtual DerivedArgList *TranslateArgs(InputArgList &Args, |
| 151 | const char *BoundArch) const; |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 152 | |
| 153 | virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; |
| 154 | |
Daniel Dunbar | 9e5cc6b | 2009-11-17 08:07:36 +0000 | [diff] [blame] | 155 | virtual bool IsBlocksDefault() const { |
Daniel Dunbar | 5435fc9 | 2010-01-27 00:57:11 +0000 | [diff] [blame] | 156 | // Blocks default to on for OS X 10.6 and iPhoneOS 3.0 and beyond. |
| 157 | if (isTargetIPhoneOS()) |
| 158 | return !isIPhoneOSVersionLT(3); |
| 159 | else |
| 160 | return !isMacosxVersionLT(10, 6); |
Daniel Dunbar | 9e5cc6b | 2009-11-17 08:07:36 +0000 | [diff] [blame] | 161 | } |
| 162 | virtual bool IsObjCNonFragileABIDefault() const { |
Daniel Dunbar | f645aaa | 2010-04-24 18:37:41 +0000 | [diff] [blame] | 163 | // Non-fragile ABI is default for everything but i386. |
| 164 | return getTriple().getArch() != llvm::Triple::x86; |
Daniel Dunbar | 9e5cc6b | 2009-11-17 08:07:36 +0000 | [diff] [blame] | 165 | } |
Daniel Dunbar | 609508c | 2010-02-01 21:07:43 +0000 | [diff] [blame] | 166 | virtual bool IsObjCLegacyDispatchDefault() const { |
| 167 | // This is only used with the non-fragile ABI. |
Daniel Dunbar | f645aaa | 2010-04-24 18:37:41 +0000 | [diff] [blame] | 168 | |
| 169 | // Legacy dispatch is used everywhere except on x86_64. |
| 170 | return getTriple().getArch() != llvm::Triple::x86_64; |
Daniel Dunbar | 609508c | 2010-02-01 21:07:43 +0000 | [diff] [blame] | 171 | } |
Daniel Dunbar | f643b9b | 2010-04-24 17:56:46 +0000 | [diff] [blame] | 172 | virtual bool UseObjCMixedDispatch() const { |
Daniel Dunbar | f645aaa | 2010-04-24 18:37:41 +0000 | [diff] [blame] | 173 | // This is only used with the non-fragile ABI and non-legacy dispatch. |
| 174 | |
| 175 | // Mixed dispatch is used everywhere except OS X before 10.6. |
| 176 | return !(!isTargetIPhoneOS() && isMacosxVersionLT(10, 6)); |
Daniel Dunbar | f643b9b | 2010-04-24 17:56:46 +0000 | [diff] [blame] | 177 | } |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 178 | virtual bool IsUnwindTablesDefault() const; |
Daniel Dunbar | 9e5cc6b | 2009-11-17 08:07:36 +0000 | [diff] [blame] | 179 | virtual unsigned GetDefaultStackProtectorLevel() const { |
Daniel Dunbar | 5435fc9 | 2010-01-27 00:57:11 +0000 | [diff] [blame] | 180 | // Stack protectors default to on for 10.6 and beyond. |
| 181 | return !isTargetIPhoneOS() && !isMacosxVersionLT(10, 6); |
Daniel Dunbar | 9e5cc6b | 2009-11-17 08:07:36 +0000 | [diff] [blame] | 182 | } |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 183 | virtual const char *GetDefaultRelocationModel() const; |
| 184 | virtual const char *GetForcedPicModel() const; |
Daniel Dunbar | 6b200b2 | 2009-09-18 08:14:36 +0000 | [diff] [blame] | 185 | |
Daniel Dunbar | 43a9b32 | 2010-04-10 16:20:23 +0000 | [diff] [blame] | 186 | virtual bool SupportsObjCGC() const; |
| 187 | |
Daniel Dunbar | f2d8b9f | 2009-12-18 02:43:17 +0000 | [diff] [blame] | 188 | virtual bool UseDwarfDebugFlags() const; |
| 189 | |
Daniel Dunbar | b2987d1 | 2010-02-10 18:49:11 +0000 | [diff] [blame] | 190 | virtual bool UseSjLjExceptions() const; |
| 191 | |
Daniel Dunbar | 6b200b2 | 2009-09-18 08:14:36 +0000 | [diff] [blame] | 192 | /// } |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 193 | }; |
| 194 | |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 195 | /// DarwinClang - The Darwin toolchain used by Clang. |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 196 | class LLVM_LIBRARY_VISIBILITY DarwinClang : public Darwin { |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 197 | public: |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 198 | DarwinClang(const HostInfo &Host, const llvm::Triple& Triple, |
Daniel Dunbar | cc8e189 | 2010-01-27 00:56:44 +0000 | [diff] [blame] | 199 | const unsigned (&DarwinVersion)[3]); |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 200 | |
| 201 | /// @name Darwin ToolChain Implementation |
| 202 | /// { |
| 203 | |
| 204 | virtual void AddLinkSearchPathArgs(const ArgList &Args, |
| 205 | ArgStringList &CmdArgs) const; |
| 206 | |
| 207 | virtual void AddLinkRuntimeLibArgs(const ArgList &Args, |
| 208 | ArgStringList &CmdArgs) const; |
| 209 | |
| 210 | /// } |
| 211 | }; |
| 212 | |
| 213 | /// DarwinGCC - The Darwin toolchain used by GCC. |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 214 | class LLVM_LIBRARY_VISIBILITY DarwinGCC : public Darwin { |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 215 | /// GCC version to use. |
Ted Kremenek | 55bac53 | 2009-10-07 03:21:11 +0000 | [diff] [blame] | 216 | unsigned GCCVersion[3]; |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 217 | |
| 218 | /// The directory suffix for this tool chain. |
| 219 | std::string ToolChainDir; |
| 220 | |
| 221 | public: |
| 222 | DarwinGCC(const HostInfo &Host, const llvm::Triple& Triple, |
Daniel Dunbar | cc8e189 | 2010-01-27 00:56:44 +0000 | [diff] [blame] | 223 | const unsigned (&DarwinVersion)[3], |
| 224 | const unsigned (&GCCVersion)[3]); |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 225 | |
| 226 | /// @name Darwin ToolChain Implementation |
| 227 | /// { |
| 228 | |
| 229 | virtual void AddLinkSearchPathArgs(const ArgList &Args, |
| 230 | ArgStringList &CmdArgs) const; |
| 231 | |
| 232 | virtual void AddLinkRuntimeLibArgs(const ArgList &Args, |
| 233 | ArgStringList &CmdArgs) const; |
| 234 | |
| 235 | /// } |
| 236 | }; |
| 237 | |
| 238 | /// Darwin_Generic_GCC - Generic Darwin tool chain using gcc. |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 239 | class LLVM_LIBRARY_VISIBILITY Darwin_Generic_GCC : public Generic_GCC { |
Daniel Dunbar | 1d4612b | 2009-09-18 08:15:13 +0000 | [diff] [blame] | 240 | public: |
| 241 | Darwin_Generic_GCC(const HostInfo &Host, const llvm::Triple& Triple) |
Daniel Dunbar | cb8ab23 | 2009-05-22 02:53:45 +0000 | [diff] [blame] | 242 | : Generic_GCC(Host, Triple) {} |
Daniel Dunbar | 8eddb3f | 2009-03-20 00:57:52 +0000 | [diff] [blame] | 243 | |
| 244 | virtual const char *GetDefaultRelocationModel() const { return "pic"; } |
| 245 | }; |
| 246 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 247 | class LLVM_LIBRARY_VISIBILITY AuroraUX : public Generic_GCC { |
Edward O'Callaghan | e7925a0 | 2009-08-22 01:06:46 +0000 | [diff] [blame] | 248 | public: |
| 249 | AuroraUX(const HostInfo &Host, const llvm::Triple& Triple); |
| 250 | |
| 251 | virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; |
| 252 | }; |
| 253 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 254 | class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_GCC { |
Daniel Dunbar | f7b8eec | 2009-06-29 20:52:51 +0000 | [diff] [blame] | 255 | public: |
| 256 | OpenBSD(const HostInfo &Host, const llvm::Triple& Triple); |
| 257 | |
| 258 | virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; |
| 259 | }; |
| 260 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 261 | class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_GCC { |
Daniel Dunbar | 75358d2 | 2009-03-30 21:06:03 +0000 | [diff] [blame] | 262 | public: |
Daniel Dunbar | cb8ab23 | 2009-05-22 02:53:45 +0000 | [diff] [blame] | 263 | FreeBSD(const HostInfo &Host, const llvm::Triple& Triple, bool Lib32); |
Daniel Dunbar | 75358d2 | 2009-03-30 21:06:03 +0000 | [diff] [blame] | 264 | |
| 265 | virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; |
| 266 | }; |
| 267 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 268 | class LLVM_LIBRARY_VISIBILITY DragonFly : public Generic_GCC { |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 269 | public: |
Daniel Dunbar | cb8ab23 | 2009-05-22 02:53:45 +0000 | [diff] [blame] | 270 | DragonFly(const HostInfo &Host, const llvm::Triple& Triple); |
Daniel Dunbar | 11e1b40 | 2009-05-02 18:28:39 +0000 | [diff] [blame] | 271 | |
| 272 | virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; |
| 273 | }; |
| 274 | |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 275 | class LLVM_LIBRARY_VISIBILITY Linux : public Generic_GCC { |
Eli Friedman | 6b3454a | 2009-05-26 07:52:18 +0000 | [diff] [blame] | 276 | public: |
| 277 | Linux(const HostInfo &Host, const llvm::Triple& Triple); |
| 278 | }; |
| 279 | |
| 280 | |
Chris Lattner | 3a47c4e | 2010-03-04 21:07:38 +0000 | [diff] [blame] | 281 | /// TCEToolChain - A tool chain using the llvm bitcode tools to perform |
| 282 | /// all subcommands. See http://tce.cs.tut.fi for our peculiar target. |
Duncan Sands | 92dd191 | 2010-05-11 20:16:05 +0000 | [diff] [blame^] | 283 | class LLVM_LIBRARY_VISIBILITY TCEToolChain : public ToolChain { |
Chris Lattner | 3a47c4e | 2010-03-04 21:07:38 +0000 | [diff] [blame] | 284 | public: |
| 285 | TCEToolChain(const HostInfo &Host, const llvm::Triple& Triple); |
| 286 | ~TCEToolChain(); |
| 287 | |
| 288 | virtual DerivedArgList *TranslateArgs(InputArgList &Args, |
| 289 | const char *BoundArch) const; |
| 290 | virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const; |
| 291 | bool IsMathErrnoDefault() const; |
| 292 | bool IsUnwindTablesDefault() const; |
| 293 | const char* GetDefaultRelocationModel() const; |
| 294 | const char* GetForcedPicModel() const; |
| 295 | |
| 296 | private: |
| 297 | mutable llvm::DenseMap<unsigned, Tool*> Tools; |
| 298 | |
| 299 | }; |
| 300 | |
Daniel Dunbar | 83b08eb | 2009-03-17 21:38:00 +0000 | [diff] [blame] | 301 | } // end namespace toolchains |
| 302 | } // end namespace driver |
| 303 | } // end namespace clang |
| 304 | |
| 305 | #endif |