[cfe-commits] r66809 - in /cfe/trunk: include/clang/Driver/Driver.h include/clang/Driver/Util.h lib/Driver/Driver.cpp

Daniel Dunbar daniel at zuster.org
Thu Mar 12 11:24:49 PDT 2009


Author: ddunbar
Date: Thu Mar 12 13:24:49 2009
New Revision: 66809

URL: http://llvm.org/viewvc/llvm-project?rev=66809&view=rev
Log:
Driver: Introduce ActionList typedef, tweak some constness.

Modified:
    cfe/trunk/include/clang/Driver/Driver.h
    cfe/trunk/include/clang/Driver/Util.h
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=66809&r1=66808&r2=66809&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Thu Mar 12 13:24:49 2009
@@ -12,15 +12,12 @@
 
 #include "clang/Basic/Diagnostic.h"
 
+#include "clang/Driver/Util.h"
+
 #include <list>
 #include <set>
 #include <string>
 
-namespace llvm {
-  template<typename T, unsigned N> class SmallVector;
-  class raw_ostream;
-}
-
 namespace clang {
 namespace driver {
   class Action;
@@ -103,10 +100,10 @@
   Compilation *BuildCompilation(int argc, const char **argv);
 
   /// PrintOptions - Print the list of arguments.
-  void PrintOptions(const ArgList &Args);
+  void PrintOptions(const ArgList &Args) const;
 
   /// PrintActions - Print the list of actions.
-  void PrintActions(const llvm::SmallVector<Action*, 2> &Actions);
+  void PrintActions(const ActionList &Actions) const;
 
   /// GetHostInfo - Construct a new host info object for the given
   /// host triple.
@@ -117,16 +114,14 @@
   ///
   /// \param Args - The input arguments.
   /// \param Actions - The list to store the resulting actions onto.
-  void BuildUniversalActions(const ArgList &Args, 
-                             llvm::SmallVector<Action*, 2> &Actions);
+  void BuildUniversalActions(ArgList &Args, ActionList &Actions);
 
   /// BuildActions - Construct the list of actions to perform for the
   /// given arguments, which are only done for a single architecture.
   ///
   /// \param Args - The input arguments.
   /// \param Actions - The list to store the resulting actions onto.
-  void BuildActions(const ArgList &Args, 
-                    llvm::SmallVector<Action*, 2> &Actions);
+  void BuildActions(ArgList &Args, ActionList &Actions);
 };
 
 } // end namespace driver

Modified: cfe/trunk/include/clang/Driver/Util.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Util.h?rev=66809&r1=66808&r2=66809&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/Util.h (original)
+++ cfe/trunk/include/clang/Driver/Util.h Thu Mar 12 13:24:49 2009
@@ -10,13 +10,19 @@
 #ifndef CLANG_DRIVER_UTIL_H_
 #define CLANG_DRIVER_UTIL_H_
 
-#include "llvm/ADT/SmallVector.h"
+namespace llvm {
+  template<typename T, unsigned N> class SmallVector;
+}
 
 namespace clang {
 namespace driver {
+  class Action;
+
   /// ArgStringList - Type used for constructing argv lists for subprocesses.
   typedef llvm::SmallVector<const char*, 16> ArgStringList;
 
+  /// ActionList - Type used for lists of actions.
+  typedef llvm::SmallVector<Action*, 3> ActionList;
 } // end namespace driver
 } // end namespace clang
 

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

==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Mar 12 13:24:49 2009
@@ -132,7 +132,7 @@
 
   // Construct the list of abstract actions to perform for this
   // compilation.
-  llvm::SmallVector<Action*, 2> Actions;
+  ActionList Actions;
   if (Host->useDriverDriver())
     BuildUniversalActions(*Args, Actions);
   else
@@ -149,7 +149,7 @@
   return new Compilation();
 }
 
-void Driver::PrintOptions(const ArgList &Args) {
+void Driver::PrintOptions(const ArgList &Args) const {
   unsigned i = 0;
   for (ArgList::const_iterator it = Args.begin(), ie = Args.end(); 
        it != ie; ++it, ++i) {
@@ -166,18 +166,16 @@
   }
 }
 
-void Driver::PrintActions(const llvm::SmallVector<Action*, 2> &Actions) {
+void Driver::PrintActions(const ActionList &Actions) const {
   llvm::errs() << "FIXME: Print actions.";
 }
 
-void Driver::BuildUniversalActions(const ArgList &Args, 
-                                   llvm::SmallVector<Action*, 2> &Actions) {
+void Driver::BuildUniversalActions(ArgList &Args, ActionList &Actions) {
   // FIXME: Implement
   BuildActions(Args, Actions);
 }
 
-void Driver::BuildActions(const ArgList &Args, 
-                          llvm::SmallVector<Action*, 2> &Actions) {
+void Driver::BuildActions(ArgList &Args, ActionList &Actions) {
   types::ID InputType = types::TY_INVALID;
   Arg *InputTypeArg = 0;
   





More information about the cfe-commits mailing list