Driver: Add darwin::Link tool.
- <rdar://problem/6717381> [driver] implement ld argument translation
in new driver
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67760 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index 7548b9e..5e7bdb5 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -56,7 +56,11 @@
/// The directory suffix for this tool chain.
std::string ToolChainDir;
- std::string getMacosxVersionMin() const;
+ /// The default macosx-version-min of this tool chain; empty until
+ /// initialized.
+ mutable std::string MacosxVersionMin;
+
+ const char *getMacosxVersionMin() const;
public:
Darwin_X86(const HostInfo &Host, const char *Arch, const char *Platform,
@@ -64,6 +68,26 @@
const unsigned (&GCCVersion)[3]);
~Darwin_X86();
+ void getDarwinVersion(unsigned (&Res)[3]) const {
+ Res[0] = DarwinVersion[0];
+ Res[1] = DarwinVersion[1];
+ Res[2] = DarwinVersion[2];
+ }
+
+ void getMacosxVersion(unsigned (&Res)[3]) const {
+ Res[0] = 10;
+ Res[1] = DarwinVersion[0] - 4;
+ Res[2] = DarwinVersion[1];
+ }
+
+ const char *getMacosxVersionStr() const {
+ return MacosxVersionMin.c_str();
+ }
+
+ const std::string &getToolChainDir() const {
+ return ToolChainDir;
+ }
+
virtual DerivedArgList *TranslateArgs(InputArgList &Args) const;
virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const;
@@ -72,9 +96,6 @@
virtual bool IsUnwindTablesDefault() const;
virtual const char *GetDefaultRelocationModel() const;
virtual const char *GetForcedPicModel() const;
-
-private:
- const std::string &getToolChainDir() const { return ToolChainDir; }
};
/// Darwin_GCC - Generic Darwin tool chain using gcc.