diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-03-17 20:45:45 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-17 20:45:45 +0000 |
| commit | 52e0c70868f94600e5048c8a8031df1f8767eace (patch) | |
| tree | 42acf54745cfd69bfa74ee892a8c53ae45b09970 /clang/include | |
| parent | 62ca7d23ce139b4e6eaf00296efccd2058dc72a8 (diff) | |
| download | bcm5719-llvm-52e0c70868f94600e5048c8a8031df1f8767eace.tar.gz bcm5719-llvm-52e0c70868f94600e5048c8a8031df1f8767eace.zip | |
Driver: Pass Driver reference down into Host info, which will need it
to pass to ToolChains, which may need Driver specific information (for
example, to form search paths).
llvm-svn: 67102
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/Driver/Driver.h | 2 | ||||
| -rw-r--r-- | clang/include/clang/Driver/HostInfo.h | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h index bf953257579..b0e6976ea75 100644 --- a/clang/include/clang/Driver/Driver.h +++ b/clang/include/clang/Driver/Driver.h @@ -220,7 +220,7 @@ public: /// GetHostInfo - Construct a new host info object for the given /// host triple. - static const HostInfo *GetHostInfo(const char *HostTriple); + const HostInfo *GetHostInfo(const char *HostTriple) const; /// @} }; diff --git a/clang/include/clang/Driver/HostInfo.h b/clang/include/clang/Driver/HostInfo.h index dfa3f75f89c..10ad2f9fe91 100644 --- a/clang/include/clang/Driver/HostInfo.h +++ b/clang/include/clang/Driver/HostInfo.h @@ -15,6 +15,7 @@ namespace clang { namespace driver { class ArgList; + class Driver; class ToolChain; /// HostInfo - Config information about a particular host which may @@ -25,14 +26,17 @@ namespace driver { /// being run from. For testing purposes, the HostInfo used by the /// driver may differ from the actual host. class HostInfo { + const Driver &TheDriver; std::string Arch, Platform, OS; protected: - HostInfo(const char *Arch, const char *Platform, const char *OS); + HostInfo(const Driver &D, const char *Arch, + const char *Platform, const char *OS); public: virtual ~HostInfo(); + const Driver &getDriver() const { return TheDriver; } const std::string &getArchName() const { return Arch; } const std::string &getPlatformName() const { return Platform; } const std::string &getOSName() const { return OS; } @@ -56,10 +60,10 @@ public: const char *ArchName=0) const = 0; }; -const HostInfo *createDarwinHostInfo(const char *Arch, const char *Platform, - const char *OS); -const HostInfo *createUnknownHostInfo(const char *Arch, const char *Platform, - const char *OS); +const HostInfo *createDarwinHostInfo(const Driver &D, const char *Arch, + const char *Platform, const char *OS); +const HostInfo *createUnknownHostInfo(const Driver &D, const char *Arch, + const char *Platform, const char *OS); } // end namespace driver } // end namespace clang |

