1 //===--- HostInfo.h - Host specific information -----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef CLANG_DRIVER_HOSTINFO_H_
11 #define CLANG_DRIVER_HOSTINFO_H_
13 #include "llvm/ADT/Triple.h"
22 /// HostInfo - Config information about a particular host which may interact
23 /// with driver behavior.
25 /// The host information is used for controlling the parts of the driver which
26 /// interact with the platform the driver is ostensibly being run from. For
27 /// testing purposes, the HostInfo used by the driver may differ from the actual
31 const Driver &TheDriver;
32 const llvm::Triple Triple;
34 HostInfo(const Driver &D, const llvm::Triple &_Triple);
39 const Driver &getDriver() const { return TheDriver; }
41 const llvm::Triple& getTriple() const { return Triple; }
42 std::string getArchName() const { return Triple.getArchName(); }
43 std::string getPlatformName() const { return Triple.getVendorName(); }
44 std::string getOSName() const { return Triple.getOSName(); }
46 /// useDriverDriver - Whether the driver should act as a driver driver for
47 /// this host and support -arch, -Xarch, etc.
48 virtual bool useDriverDriver() const = 0;
50 /// CreateToolChain - Construct the toolchain to use for this host (which the
51 /// host retains ownership of).
53 /// \param Args - The argument list, which may be used to alter the default
54 /// toolchain, for example in the presence of -m32 or -m64.
56 /// \param ArchName - The architecture to return a toolchain for, or 0 if
57 /// unspecified. This will only ever be non-zero for hosts which support a
60 // FIXME: Pin down exactly what the HostInfo is allowed to use Args
61 // for here. Currently this is for -m32 / -m64 defaulting.
62 virtual ToolChain *CreateToolChain(const ArgList &Args,
63 const char *ArchName=0) const = 0;
66 const HostInfo *createAuroraUXHostInfo(const Driver &D,
67 const llvm::Triple& Triple);
68 const HostInfo *createDarwinHostInfo(const Driver &D,
69 const llvm::Triple& Triple);
70 const HostInfo *createOpenBSDHostInfo(const Driver &D,
71 const llvm::Triple& Triple);
72 const HostInfo *createFreeBSDHostInfo(const Driver &D,
73 const llvm::Triple& Triple);
74 const HostInfo *createNetBSDHostInfo(const Driver &D,
75 const llvm::Triple& Triple);
76 const HostInfo *createMinixHostInfo(const Driver &D,
77 const llvm::Triple& Triple);
78 const HostInfo *createDragonFlyHostInfo(const Driver &D,
79 const llvm::Triple& Triple);
80 const HostInfo *createLinuxHostInfo(const Driver &D,
81 const llvm::Triple& Triple);
82 const HostInfo *createTCEHostInfo(const Driver &D,
83 const llvm::Triple& Triple);
84 const HostInfo *createWindowsHostInfo(const Driver &D,
85 const llvm::Triple &Triple);
86 const HostInfo *createMinGWHostInfo(const Driver &D,
87 const llvm::Triple &Triple);
88 const HostInfo *createUnknownHostInfo(const Driver &D,
89 const llvm::Triple& Triple);
91 } // end namespace driver
92 } // end namespace clang