r236926 - Factor out Hexagon code to build args.
Ikhlas Ajbar
iajbar at codeaurora.org
Fri May 8 19:13:25 PDT 2015
Author: iajbar
Date: Fri May 8 21:13:25 2015
New Revision: 236926
URL: http://llvm.org/viewvc/llvm-project?rev=236926&view=rev
Log:
Factor out Hexagon code to build args.
This patch factor out the code in hexagon::Link::ConstructJob to be reused
in other functions. No functionality change intended.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=236926&r1=236925&r2=236926&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri May 8 21:13:25 2015
@@ -5444,17 +5444,16 @@ void hexagon::Link::RenderExtraToolArgs(
// The types are (hopefully) good enough.
}
-void hexagon::Link::ConstructJob(Compilation &C, const JobAction &JA,
- const InputInfo &Output,
- const InputInfoList &Inputs,
- const ArgList &Args,
- const char *LinkingOutput) const {
+static void constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
+ const toolchains::Hexagon_TC& ToolChain,
+ const InputInfo &Output,
+ const InputInfoList &Inputs,
+ const ArgList &Args,
+ ArgStringList &CmdArgs,
+ const char *LinkingOutput) {
- const toolchains::Hexagon_TC& ToolChain =
- static_cast<const toolchains::Hexagon_TC&>(getToolChain());
const Driver &D = ToolChain.getDriver();
- ArgStringList CmdArgs;
//----------------------------------------------------------------------------
//
@@ -5600,6 +5599,20 @@ void hexagon::Link::ConstructJob(Compila
std::string finiObj = useShared ? "/finiS.o" : "/fini.o";
CmdArgs.push_back(Args.MakeArgString(StartFilesDir + finiObj));
}
+}
+
+void hexagon::Link::ConstructJob(Compilation &C, const JobAction &JA,
+ const InputInfo &Output,
+ const InputInfoList &Inputs,
+ const ArgList &Args,
+ const char *LinkingOutput) const {
+
+ const toolchains::Hexagon_TC& ToolChain =
+ static_cast<const toolchains::Hexagon_TC&>(getToolChain());
+
+ ArgStringList CmdArgs;
+ constructHexagonLinkArgs(C, JA, ToolChain, Output, Inputs, Args, CmdArgs,
+ LinkingOutput);
std::string Linker = ToolChain.GetProgramPath("hexagon-ld");
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
More information about the cfe-commits
mailing list