[cfe-commits] r67355 - in /cfe/trunk/lib/Driver: Tools.cpp Tools.h

Daniel Dunbar daniel at zuster.org
Thu Mar 19 17:52:39 PDT 2009


Author: ddunbar
Date: Thu Mar 19 19:52:38 2009
New Revision: 67355

URL: http://llvm.org/viewvc/llvm-project?rev=67355&view=rev
Log:
Driver: Add darwin::Lipo tool.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Driver/Tools.h

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=67355&r1=67354&r2=67355&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Mar 19 19:52:38 2009
@@ -298,7 +298,8 @@
       A->render(Args, CmdArgs);
   }
 
-  Args.AddAllArgs(CmdArgs, options::OPT_clang_W_Group, options::OPT_pedantic_Group);
+  Args.AddAllArgs(CmdArgs, options::OPT_clang_W_Group, 
+                  options::OPT_pedantic_Group);
   Args.AddLastArg(CmdArgs, options::OPT_w);
   Args.AddAllArgs(CmdArgs, options::OPT_std_EQ, options::OPT_ansi, 
                   options::OPT_trigraphs);
@@ -437,3 +438,25 @@
   // The types are (hopefully) good enough.
 }
 
+
+void darwin::Lipo::ConstructJob(Compilation &C, const JobAction &JA,
+                                Job &Dest,
+                                const InputInfo &Output, 
+                                const InputInfoList &Inputs, 
+                                const ArgList &Args, 
+                                const char *LinkingOutput) const {
+  ArgStringList CmdArgs;
+
+  CmdArgs.push_back("-create");
+  assert(Output.isFilename() && "Unexpected lipo output.");
+  CmdArgs.push_back(Output.getFilename());
+  for (InputInfoList::const_iterator
+         it = Inputs.begin(), ie = Inputs.end(); it != ie; ++it) {
+    const InputInfo &II = *it;
+    assert(II.isFilename() && "Unexpected lipo input.");
+    CmdArgs.push_back(II.getFilename());
+  }
+  const char *Exec = 
+    Args.MakeArgString(getToolChain().GetProgramPath(C, "lipo").c_str());
+  Dest.addCommand(new Command(Exec, CmdArgs));
+}

Modified: cfe/trunk/lib/Driver/Tools.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=67355&r1=67354&r2=67355&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Tools.h (original)
+++ cfe/trunk/lib/Driver/Tools.h Thu Mar 19 19:52:38 2009
@@ -110,6 +110,24 @@
   };
 } // end namespace gcc
 
+namespace darwin {
+  class VISIBILITY_HIDDEN Lipo : public Tool  {
+  public:
+    Lipo(const ToolChain &TC) : Tool("gcc::Link", TC) {}
+
+    virtual bool acceptsPipedInput() const { return false; }
+    virtual bool canPipeOutput() const { return false; }
+    virtual bool hasIntegratedCPP() const { return false; }
+
+    virtual void ConstructJob(Compilation &C, const JobAction &JA,
+                              Job &Dest,
+                              const InputInfo &Output, 
+                              const InputInfoList &Inputs, 
+                              const ArgList &TCArgs, 
+                              const char *LinkingOutput) const;
+  };
+}
+
 } // end namespace toolchains
 } // end namespace driver
 } // end namespace clang





More information about the cfe-commits mailing list