blob: 560df19e25cea6bce09d5ac9c19cba5e2d3c243a [file] [log] [blame]
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +00001//===--- ToolChain.h - Collections of tools for one platform ----*- 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
Stephen Hines176edba2014-12-01 14:53:08 -080010#ifndef LLVM_CLANG_DRIVER_TOOLCHAIN_H
11#define LLVM_CLANG_DRIVER_TOOLCHAIN_H
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000012
Rafael Espindola5b222052013-03-18 20:48:54 +000013#include "clang/Driver/Action.h"
Stephen Hines651f13c2014-04-23 16:59:28 -070014#include "clang/Driver/Multilib.h"
Daniel Dunbar41800112010-08-02 05:43:56 +000015#include "clang/Driver/Types.h"
Chandler Carruth30a2e162012-12-04 09:18:49 +000016#include "clang/Driver/Util.h"
Daniel Dunbar0edefeb2009-03-18 20:26:19 +000017#include "llvm/ADT/SmallVector.h"
Daniel Dunbarcb8ab232009-05-22 02:53:45 +000018#include "llvm/ADT/Triple.h"
Michael J. Spencer03013fa2010-11-29 18:12:39 +000019#include "llvm/Support/Path.h"
Stephen Hines651f13c2014-04-23 16:59:28 -070020#include <memory>
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000021#include <string>
22
Reid Klecknerb1e25a12013-06-14 17:17:23 +000023namespace llvm {
24namespace opt {
25 class ArgList;
26 class DerivedArgList;
27 class InputArgList;
28}
29}
30
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000031namespace clang {
John McCall260611a2012-06-20 06:18:46 +000032 class ObjCRuntime;
33
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000034namespace driver {
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000035 class Compilation;
Daniel Dunbaree788e72009-12-21 18:54:17 +000036 class Driver;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000037 class JobAction;
Alexey Samsonov1b8f12d2013-08-19 09:14:21 +000038 class SanitizerArgs;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000039 class Tool;
40
41/// ToolChain - Access to tools for a single platform.
42class ToolChain {
Daniel Dunbar0edefeb2009-03-18 20:26:19 +000043public:
Stephen Hines176edba2014-12-01 14:53:08 -080044 typedef SmallVector<std::string, 16> path_list;
Daniel Dunbar0edefeb2009-03-18 20:26:19 +000045
Daniel Dunbar641b98b2010-09-14 23:12:35 +000046 enum CXXStdlibType {
Daniel Dunbar3f16c952010-09-14 23:12:40 +000047 CST_Libcxx,
Daniel Dunbar641b98b2010-09-14 23:12:35 +000048 CST_Libstdcxx
49 };
50
Daniel Dunbarc24767c2011-12-07 23:03:15 +000051 enum RuntimeLibType {
52 RLT_CompilerRT,
53 RLT_Libgcc
54 };
55
Stephen Hines0e2c34f2015-03-23 12:09:02 -070056 enum RTTIMode {
57 RM_EnabledExplicitly,
58 RM_EnabledImplicitly,
59 RM_DisabledExplicitly,
60 RM_DisabledImplicitly
61 };
62
Daniel Dunbar0edefeb2009-03-18 20:26:19 +000063private:
Chandler Carruth4d7ff6e2012-01-25 09:12:06 +000064 const Driver &D;
Daniel Dunbarcb8ab232009-05-22 02:53:45 +000065 const llvm::Triple Triple;
Reid Klecknerdd0b3c42013-06-17 13:59:19 +000066 const llvm::opt::ArgList &Args;
Stephen Hines0e2c34f2015-03-23 12:09:02 -070067 // We need to initialize CachedRTTIArg before CachedRTTIMode
68 const llvm::opt::Arg *const CachedRTTIArg;
69 const RTTIMode CachedRTTIMode;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000070
Daniel Dunbar0edefeb2009-03-18 20:26:19 +000071 /// The list of toolchain specific path prefixes to search for
72 /// files.
73 path_list FilePaths;
74
75 /// The list of toolchain specific path prefixes to search for
76 /// programs.
77 path_list ProgramPaths;
78
Stephen Hines651f13c2014-04-23 16:59:28 -070079 mutable std::unique_ptr<Tool> Clang;
80 mutable std::unique_ptr<Tool> Assemble;
81 mutable std::unique_ptr<Tool> Link;
Rafael Espindolaf48b93c2013-03-20 03:05:54 +000082 Tool *getClang() const;
83 Tool *getAssemble() const;
84 Tool *getLink() const;
85 Tool *getClangAs() const;
Rafael Espindola5b222052013-03-18 20:48:54 +000086
Stephen Hines651f13c2014-04-23 16:59:28 -070087 mutable std::unique_ptr<SanitizerArgs> SanitizerArguments;
Peter Collingbournec6911a22013-11-01 18:16:25 +000088
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000089protected:
Stephen Hines651f13c2014-04-23 16:59:28 -070090 MultilibSet Multilibs;
91
Reid Klecknerdd0b3c42013-06-17 13:59:19 +000092 ToolChain(const Driver &D, const llvm::Triple &T,
93 const llvm::opt::ArgList &Args);
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +000094
Rafael Espindolaf48b93c2013-03-20 03:05:54 +000095 virtual Tool *buildAssembler() const;
96 virtual Tool *buildLinker() const;
97 virtual Tool *getTool(Action::ActionClass AC) const;
Rafael Espindola5b222052013-03-18 20:48:54 +000098
Chandler Carruth79cbbdc2011-12-17 23:10:01 +000099 /// \name Utilities for implementing subclasses.
100 ///@{
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000101 static void addSystemInclude(const llvm::opt::ArgList &DriverArgs,
102 llvm::opt::ArgStringList &CC1Args,
Chandler Carruth79cbbdc2011-12-17 23:10:01 +0000103 const Twine &Path);
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000104 static void addExternCSystemInclude(const llvm::opt::ArgList &DriverArgs,
105 llvm::opt::ArgStringList &CC1Args,
Chandler Carruth79cbbdc2011-12-17 23:10:01 +0000106 const Twine &Path);
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000107 static void
108 addExternCSystemIncludeIfExists(const llvm::opt::ArgList &DriverArgs,
109 llvm::opt::ArgStringList &CC1Args,
110 const Twine &Path);
111 static void addSystemIncludes(const llvm::opt::ArgList &DriverArgs,
112 llvm::opt::ArgStringList &CC1Args,
Chandler Carruth79cbbdc2011-12-17 23:10:01 +0000113 ArrayRef<StringRef> Paths);
114 ///@}
115
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000116public:
117 virtual ~ToolChain();
118
119 // Accessors
120
Daniel Dunbaree788e72009-12-21 18:54:17 +0000121 const Driver &getDriver() const;
Daniel Dunbar12cfe032009-06-16 23:25:22 +0000122 const llvm::Triple &getTriple() const { return Triple; }
123
Rafael Espindolaba30bbe2010-08-10 00:25:48 +0000124 llvm::Triple::ArchType getArch() const { return Triple.getArch(); }
Chris Lattner686775d2011-07-20 06:58:45 +0000125 StringRef getArchName() const { return Triple.getArchName(); }
126 StringRef getPlatform() const { return Triple.getVendorName(); }
127 StringRef getOS() const { return Triple.getOSName(); }
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000128
Daniel Dunbard2a527e2012-11-08 03:38:26 +0000129 /// \brief Provide the default architecture name (as expected by -arch) for
130 /// this toolchain. Note t
Stephen Hines176edba2014-12-01 14:53:08 -0800131 StringRef getDefaultUniversalArchName() const;
Daniel Dunbard2a527e2012-11-08 03:38:26 +0000132
Daniel Dunbarcb8ab232009-05-22 02:53:45 +0000133 std::string getTripleString() const {
134 return Triple.getTriple();
Daniel Dunbarcd8e4c42009-03-30 06:36:42 +0000135 }
136
Daniel Dunbarbbafc5c2009-03-20 04:36:45 +0000137 path_list &getFilePaths() { return FilePaths; }
138 const path_list &getFilePaths() const { return FilePaths; }
Daniel Dunbar0edefeb2009-03-18 20:26:19 +0000139
Daniel Dunbarbbafc5c2009-03-20 04:36:45 +0000140 path_list &getProgramPaths() { return ProgramPaths; }
141 const path_list &getProgramPaths() const { return ProgramPaths; }
Daniel Dunbar0edefeb2009-03-18 20:26:19 +0000142
Stephen Hines651f13c2014-04-23 16:59:28 -0700143 const MultilibSet &getMultilibs() const { return Multilibs; }
144
Alexey Samsonov1b8f12d2013-08-19 09:14:21 +0000145 const SanitizerArgs& getSanitizerArgs() const;
146
Stephen Hines0e2c34f2015-03-23 12:09:02 -0700147 // Returns the Arg * that explicitly turned on/off rtti, or nullptr.
148 const llvm::opt::Arg *getRTTIArg() const { return CachedRTTIArg; }
149
150 // Returns the RTTIMode for the toolchain with the current arguments.
151 RTTIMode getRTTIMode() const { return CachedRTTIMode; }
152
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000153 // Tool access.
154
Daniel Dunbar0dcb9a32009-09-09 18:36:12 +0000155 /// TranslateArgs - Create a new derived argument list for any argument
Daniel Dunbar279c1db2010-06-11 22:00:26 +0000156 /// translations this ToolChain may wish to perform, or 0 if no tool chain
157 /// specific translations are needed.
Daniel Dunbar0dcb9a32009-09-09 18:36:12 +0000158 ///
159 /// \param BoundArch - The bound architecture name, or 0.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000160 virtual llvm::opt::DerivedArgList *
161 TranslateArgs(const llvm::opt::DerivedArgList &Args,
162 const char *BoundArch) const {
Stephen Hines6bcf27b2014-05-29 04:14:42 -0700163 return nullptr;
Daniel Dunbar279c1db2010-06-11 22:00:26 +0000164 }
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000165
Rafael Espindola5b222052013-03-18 20:48:54 +0000166 /// Choose a tool to use to handle the action \p JA.
Rafael Espindola29511872013-03-24 15:06:53 +0000167 Tool *SelectTool(const JobAction &JA) const;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000168
169 // Helper methods
170
Daniel Dunbar4a7e8892010-07-14 18:46:23 +0000171 std::string GetFilePath(const char *Name) const;
Simon Atanasyanfc44e882012-10-03 19:52:37 +0000172 std::string GetProgramPath(const char *Name) const;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000173
Stephen Hinesc568f1e2014-07-21 00:47:37 -0700174 /// Returns the linker path, respecting the -fuse-ld= argument to determine
175 /// the linker suffix or name.
176 std::string GetLinkerPath() const;
177
Chandler Carruth6365ab92013-07-30 17:57:09 +0000178 /// \brief Dispatch to the specific toolchain for verbose printing.
179 ///
180 /// This is used when handling the verbose option to print detailed,
181 /// toolchain-specific information useful for understanding the behavior of
182 /// the driver on a specific platform.
183 virtual void printVerboseInfo(raw_ostream &OS) const {};
184
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000185 // Platform defaults information
186
Stephen Hines176edba2014-12-01 14:53:08 -0800187 /// \brief Returns true if the toolchain is targeting a non-native
188 /// architecture.
189 virtual bool isCrossCompiling() const;
190
Daniel Dunbarb993f5d2010-09-17 00:24:52 +0000191 /// HasNativeLTOLinker - Check whether the linker and related tools have
192 /// native LLVM support.
193 virtual bool HasNativeLLVMSupport() const;
194
Daniel Dunbar41800112010-08-02 05:43:56 +0000195 /// LookupTypeForExtension - Return the default language type to use for the
196 /// given extension.
197 virtual types::ID LookupTypeForExtension(const char *Ext) const;
198
Daniel Dunbar9e5cc6b2009-11-17 08:07:36 +0000199 /// IsBlocksDefault - Does this tool chain enable -fblocks by default.
200 virtual bool IsBlocksDefault() const { return false; }
Daniel Dunbar398c6102011-02-04 02:20:39 +0000201
Daniel Dunbar8767cbc2010-02-03 03:07:56 +0000202 /// IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as
203 /// by default.
204 virtual bool IsIntegratedAssemblerDefault() const { return false; }
205
Rafael Espindola7ce8d822013-03-18 17:58:22 +0000206 /// \brief Check if the toolchain should use the integrated assembler.
Rafael Espindolaaf370e62013-03-18 18:10:27 +0000207 bool useIntegratedAs() const;
Rafael Espindola5470cd22013-03-18 17:52:57 +0000208
Benjamin Kramer769aa2d2012-05-02 14:55:48 +0000209 /// IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.
210 virtual bool IsMathErrnoDefault() const { return true; }
211
Fariborz Jahanian3d145f62012-11-15 19:02:45 +0000212 /// IsEncodeExtendedBlockSignatureDefault - Does this tool chain enable
213 /// -fencode-extended-block-signature by default.
214 virtual bool IsEncodeExtendedBlockSignatureDefault() const { return false; }
Ted Kremenekc32647d2010-12-23 21:35:43 +0000215
Daniel Dunbar9e5cc6b2009-11-17 08:07:36 +0000216 /// IsObjCNonFragileABIDefault - Does this tool chain set
217 /// -fobjc-nonfragile-abi by default.
218 virtual bool IsObjCNonFragileABIDefault() const { return false; }
219
Daniel Dunbarf643b9b2010-04-24 17:56:46 +0000220 /// UseObjCMixedDispatchDefault - When using non-legacy dispatch, should the
221 /// mixed dispatch method be used?
222 virtual bool UseObjCMixedDispatch() const { return false; }
223
Daniel Dunbar9e5cc6b2009-11-17 08:07:36 +0000224 /// GetDefaultStackProtectorLevel - Get the default stack protector level for
Stephen Hines651f13c2014-04-23 16:59:28 -0700225 /// this tool chain (0=off, 1=on, 2=strong, 3=all).
Nico Weber2fef1112011-08-23 07:38:27 +0000226 virtual unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const {
227 return 0;
228 }
Daniel Dunbar9e5cc6b2009-11-17 08:07:36 +0000229
Daniel Dunbarc24767c2011-12-07 23:03:15 +0000230 /// GetDefaultRuntimeLibType - Get the default runtime library variant to use.
231 virtual RuntimeLibType GetDefaultRuntimeLibType() const {
232 return ToolChain::RLT_Libgcc;
233 }
234
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000235 /// IsUnwindTablesDefault - Does this tool chain use -funwind-tables
236 /// by default.
Rafael Espindola03a86382012-09-23 03:05:41 +0000237 virtual bool IsUnwindTablesDefault() const;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000238
Chandler Carruth7ce816a2012-11-19 03:52:03 +0000239 /// \brief Test whether this toolchain defaults to PIC.
240 virtual bool isPICDefault() const = 0;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000241
Peter Collingbourne52ca70d2013-04-09 04:35:11 +0000242 /// \brief Test whether this toolchain defaults to PIE.
243 virtual bool isPIEDefault() const = 0;
244
245 /// \brief Tests whether this toolchain forces its default for PIC, PIE or
246 /// non-PIC. If this returns true, any PIC related flags should be ignored
247 /// and instead the results of \c isPICDefault() and \c isPIEDefault() are
248 /// used exclusively.
Chandler Carruth7ce816a2012-11-19 03:52:03 +0000249 virtual bool isPICDefaultForced() const = 0;
Daniel Dunbarf2d8b9f2009-12-18 02:43:17 +0000250
Daniel Dunbarbbe8e3e2011-03-01 18:49:30 +0000251 /// SupportsProfiling - Does this tool chain support -pg.
252 virtual bool SupportsProfiling() const { return true; }
253
Daniel Dunbar43a9b322010-04-10 16:20:23 +0000254 /// Does this tool chain support Objective-C garbage collection.
David Chisnall74a63bc2011-05-22 16:26:21 +0000255 virtual bool SupportsObjCGC() const { return true; }
Daniel Dunbar43a9b322010-04-10 16:20:23 +0000256
John McCall0a7dd782012-08-21 02:47:43 +0000257 /// Complain if this tool chain doesn't support Objective-C ARC.
258 virtual void CheckObjCARC() const {}
Argyrios Kyrtzidis5840dd92012-02-29 03:43:52 +0000259
Daniel Dunbarf2d8b9f2009-12-18 02:43:17 +0000260 /// UseDwarfDebugFlags - Embed the compile options to clang into the Dwarf
261 /// compile unit information.
262 virtual bool UseDwarfDebugFlags() const { return false; }
Daniel Dunbarb2987d12010-02-10 18:49:11 +0000263
264 /// UseSjLjExceptions - Does this tool chain use SjLj exceptions.
Benjamin Kramer8aa79942010-02-11 11:33:47 +0000265 virtual bool UseSjLjExceptions() const { return false; }
Daniel Dunbar00577ad2010-08-23 22:35:37 +0000266
Stephen Hines176edba2014-12-01 14:53:08 -0800267 /// getThreadModel() - Which thread model does this target use?
268 virtual std::string getThreadModel() const { return "posix"; }
269
Stephen Hines0e2c34f2015-03-23 12:09:02 -0700270 /// isThreadModelSupported() - Does this target support a thread model?
Stephen Hines176edba2014-12-01 14:53:08 -0800271 virtual bool isThreadModelSupported(const StringRef Model) const;
272
Daniel Dunbar00577ad2010-08-23 22:35:37 +0000273 /// ComputeLLVMTriple - Return the LLVM target triple to use, after taking
274 /// command line arguments into account.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000275 virtual std::string
276 ComputeLLVMTriple(const llvm::opt::ArgList &Args,
277 types::ID InputType = types::TY_INVALID) const;
Daniel Dunbar00577ad2010-08-23 22:35:37 +0000278
279 /// ComputeEffectiveClangTriple - Return the Clang triple to use for this
280 /// target, which may take into account the command line arguments. For
281 /// example, on Darwin the -mmacosx-version-min= command line argument (which
282 /// sets the deployment target) determines the version in the triple passed to
283 /// Clang.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000284 virtual std::string ComputeEffectiveClangTriple(
285 const llvm::opt::ArgList &Args,
286 types::ID InputType = types::TY_INVALID) const;
Daniel Dunbar641b98b2010-09-14 23:12:35 +0000287
John McCall260611a2012-06-20 06:18:46 +0000288 /// getDefaultObjCRuntime - Return the default Objective-C runtime
289 /// for this platform.
John McCall9f084a32011-07-06 00:26:06 +0000290 ///
John McCall13db5cf2011-09-09 20:41:01 +0000291 /// FIXME: this really belongs on some sort of DeploymentTarget abstraction
John McCall260611a2012-06-20 06:18:46 +0000292 virtual ObjCRuntime getDefaultObjCRuntime(bool isNonFragile) const;
John McCall9f084a32011-07-06 00:26:06 +0000293
John McCall13db5cf2011-09-09 20:41:01 +0000294 /// hasBlocksRuntime - Given that the user is compiling with
295 /// -fblocks, does this tool chain guarantee the existence of a
296 /// blocks runtime?
297 ///
298 /// FIXME: this really belongs on some sort of DeploymentTarget abstraction
299 virtual bool hasBlocksRuntime() const { return true; }
300
Chandler Carruth88491fc2011-11-04 07:12:53 +0000301 /// \brief Add the clang cc1 arguments for system include paths.
302 ///
303 /// This routine is responsible for adding the necessary cc1 arguments to
304 /// include headers from standard system header directories.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000305 virtual void
306 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
307 llvm::opt::ArgStringList &CC1Args) const;
Chandler Carruth88491fc2011-11-04 07:12:53 +0000308
Chandler Carrutha6b25812012-11-21 23:40:23 +0000309 /// \brief Add options that need to be passed to cc1 for this target.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000310 virtual void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
311 llvm::opt::ArgStringList &CC1Args) const;
Rafael Espindola8af669f2012-06-19 01:26:10 +0000312
Stephen Hines651f13c2014-04-23 16:59:28 -0700313 /// \brief Add warning options that need to be passed to cc1 for this target.
314 virtual void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const;
315
Daniel Dunbarc24767c2011-12-07 23:03:15 +0000316 // GetRuntimeLibType - Determine the runtime library type to use with the
317 // given compilation arguments.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000318 virtual RuntimeLibType
319 GetRuntimeLibType(const llvm::opt::ArgList &Args) const;
Daniel Dunbarc24767c2011-12-07 23:03:15 +0000320
Daniel Dunbar641b98b2010-09-14 23:12:35 +0000321 // GetCXXStdlibType - Determine the C++ standard library type to use with the
322 // given compilation arguments.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000323 virtual CXXStdlibType GetCXXStdlibType(const llvm::opt::ArgList &Args) const;
Daniel Dunbar641b98b2010-09-14 23:12:35 +0000324
325 /// AddClangCXXStdlibIncludeArgs - Add the clang -cc1 level arguments to set
326 /// the include paths to use for the given C++ standard library type.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000327 virtual void
328 AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
329 llvm::opt::ArgStringList &CC1Args) const;
Daniel Dunbar641b98b2010-09-14 23:12:35 +0000330
Daniel Dunbar132e35d2010-09-17 01:20:05 +0000331 /// AddCXXStdlibLibArgs - Add the system specific linker arguments to use
Daniel Dunbar641b98b2010-09-14 23:12:35 +0000332 /// for the given C++ standard library type.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000333 virtual void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
334 llvm::opt::ArgStringList &CmdArgs) const;
Shantonu Sen7433fed2010-09-17 18:39:08 +0000335
336 /// AddCCKextLibArgs - Add the system specific linker arguments to use
337 /// for kernel extensions (Darwin-specific).
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000338 virtual void AddCCKextLibArgs(const llvm::opt::ArgList &Args,
339 llvm::opt::ArgStringList &CmdArgs) const;
Benjamin Kramere20e5082012-10-04 19:42:20 +0000340
341 /// AddFastMathRuntimeIfAvailable - If a runtime library exists that sets
342 /// global flags for unsafe floating point math, add it and return true.
343 ///
Stephen Hines651f13c2014-04-23 16:59:28 -0700344 /// This checks for presence of the -Ofast, -ffast-math or -funsafe-math flags.
Reid Klecknerdd0b3c42013-06-17 13:59:19 +0000345 virtual bool
346 AddFastMathRuntimeIfAvailable(const llvm::opt::ArgList &Args,
347 llvm::opt::ArgStringList &CmdArgs) const;
Daniel Dunbar2ba38ba2009-03-16 05:25:36 +0000348};
349
350} // end namespace driver
351} // end namespace clang
352
353#endif