]> granicus.if.org Git - clang/commitdiff
Driver: Introduce ActionList typedef, tweak some constness.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 12 Mar 2009 18:24:49 +0000 (18:24 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 12 Mar 2009 18:24:49 +0000 (18:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66809 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 1dcb8af8f1eb2ff63aa86f7e86875a7d217c06a1..dc1814cb6d143db9469056f2f07861835bebbdea 100644 (file)
 
 #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 @@ public:
   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 @@ public:
   ///
   /// \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
index eb5d2471c82765896d646f96bea4f2759392bdd4..465d81a1f383d9bcb158ee89eb46f09e668d199d 100644 (file)
 #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
 
index 61cc89545cc6c80509bc5597f4d3ee4ee3ac4477..2b763c6ae57274b2bc602f648cfff1733b6fae17 100644 (file)
@@ -132,7 +132,7 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) {
 
   // 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 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) {
   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::PrintOptions(const ArgList &Args) {
   }
 }
 
-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;