From: Daniel Dunbar Date: Mon, 2 Aug 2010 05:43:51 +0000 (+0000) Subject: Driver: Give Build{Universal,}Actions access to the default host tool chain. I X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74edcea3db1f85ba73ad0fede2ed5e2f096cac4b;p=clang Driver: Give Build{Universal,}Actions access to the default host tool chain. I 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 --- diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h index 1dff8b3b10..28eff4f1d7 100644 --- a/include/clang/Driver/Driver.h +++ b/include/clang/Driver/Driver.h @@ -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. diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 98ac6ccec5..e28b2bc6ed 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -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.