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