]> granicus.if.org Git - clang/commitdiff
Driver: Give Build{Universal,}Actions access to the default host tool chain. I
authorDaniel Dunbar <daniel@zuster.org>
Mon, 2 Aug 2010 05:43:51 +0000 (05:43 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 2 Aug 2010 05:43:51 +0000 (05:43 +0000)
avoided this originally to enforce that the driver actions aren't toolchain
dependent, but it isn't worth the cumbersone additional hostinfo split.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110023 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Driver.h
lib/Driver/Driver.cpp

index 1dff8b3b101e9c4cee25106ad5faf56cb2af855d..28eff4f1d71d69ecfab87c3798aa3363e8a3eb6b 100644 (file)
@@ -206,16 +206,20 @@ public:
   /// BuildActions - Construct the list of actions to perform for the
   /// given arguments, which are only done for a single architecture.
   ///
+  /// \param TC - The default host tool chain.
   /// \param Args - The input arguments.
   /// \param Actions - The list to store the resulting actions onto.
-  void BuildActions(const ArgList &Args, ActionList &Actions) const;
+  void BuildActions(const ToolChain &TC, const ArgList &Args,
+                    ActionList &Actions) const;
 
   /// BuildUniversalActions - Construct the list of actions to perform
   /// for the given arguments, which may require a universal build.
   ///
+  /// \param TC - The default host tool chain.
   /// \param Args - The input arguments.
   /// \param Actions - The list to store the resulting actions onto.
-  void BuildUniversalActions(const ArgList &Args, ActionList &Actions) const;
+  void BuildUniversalActions(const ToolChain &TC, const ArgList &Args,
+                             ActionList &Actions) const;
 
   /// BuildJobs - Bind actions to concrete tools and translate
   /// arguments to form the list of jobs to run.
index 98ac6ccec557e14b93656f31a2c6c1b00458f3cc..e28b2bc6ed84774d5fc971faf225625df91bf51e 100644 (file)
@@ -250,14 +250,12 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) {
   if (!HandleImmediateArgs(*C))
     return C;
 
-  // Construct the list of abstract actions to perform for this compilation. We
-  // avoid passing a Compilation here simply to enforce the abstraction that
-  // pipelining is not host or toolchain dependent (other than the driver driver
-  // test).
+  // Construct the list of abstract actions to perform for this compilation.
   if (Host->useDriverDriver())
-    BuildUniversalActions(C->getArgs(), C->getActions());
+    BuildUniversalActions(C->getDefaultToolChain(), C->getArgs(),
+                          C->getActions());
   else
-    BuildActions(C->getArgs(), C->getActions());
+    BuildActions(C->getDefaultToolChain(), C->getArgs(), C->getActions());
 
   if (CCCPrintActions) {
     PrintActions(*C);
@@ -527,7 +525,8 @@ static bool ContainsCompileAction(const Action *A) {
   return false;
 }
 
-void Driver::BuildUniversalActions(const ArgList &Args,
+void Driver::BuildUniversalActions(const ToolChain &TC,
+                                   const ArgList &Args,
                                    ActionList &Actions) const {
   llvm::PrettyStackTraceString CrashInfo("Building universal build actions");
   // Collect the list of architectures. Duplicates are allowed, but should only
@@ -572,7 +571,7 @@ void Driver::BuildUniversalActions(const ArgList &Args,
   }
 
   ActionList SingleActions;
-  BuildActions(Args, SingleActions);
+  BuildActions(TC, Args, SingleActions);
 
   // Add in arch bindings for every top level action, as well as lipo and
   // dsymutil steps if needed.
@@ -622,7 +621,8 @@ void Driver::BuildUniversalActions(const ArgList &Args,
   }
 }
 
-void Driver::BuildActions(const ArgList &Args, ActionList &Actions) const {
+void Driver::BuildActions(const ToolChain &TC, const ArgList &Args,
+                          ActionList &Actions) const {
   llvm::PrettyStackTraceString CrashInfo("Building compilation actions");
   // Start by constructing the list of inputs and their types.