]> granicus.if.org Git - clang/commitdiff
Driver: Pull intrusive list out of Arg; this isn't going to suffice. I
authorDaniel Dunbar <daniel@zuster.org>
Wed, 4 Mar 2009 21:17:31 +0000 (21:17 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 4 Mar 2009 21:17:31 +0000 (21:17 +0000)
will make this efficient later (if it even matters)...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66071 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Arg.h
include/clang/Driver/ArgList.h

index 317af97ea54d22f4c90856b71936e5893a4608f0..8d8f0942a0539d2984de4c423f07b52f6ee28bfc 100644 (file)
@@ -11,7 +11,6 @@
 #define CLANG_DRIVER_ARG_H_
 
 #include "Util.h"
-#include "llvm/ADT/ilist_node.h"
 
 namespace clang {
 namespace driver {
@@ -25,7 +24,7 @@ namespace driver {
   /// instances have an intrusive double linked list which is used by
   /// ArgList to provide efficient iteration over all instances of a
   /// particular option.
-  class Arg : public llvm::ilist_node<Arg> {
+  class Arg {
   private:
     enum ArgClass {
       PositionalArg = 0,
index 52d4a19f7935b445145bf57e03d59aad15970b93..9eefa8a127449fb387c9a06af38e0004b8ebf0da 100644 (file)
@@ -11,7 +11,6 @@
 #define CLANG_DRIVER_ARGLIST_H_
 
 #include "Util.h"
-#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 
 namespace clang {
@@ -37,11 +36,6 @@ namespace driver {
     /// The full list of arguments.
     arglist_type Args;
 
-    /// A map of arguments by option ID; in conjunction with the
-    /// intrusive list in Arg instances this allows iterating over all
-    /// arguments for a particular option.
-    llvm::DenseMap<unsigned, Arg*> ArgMap;
-
   public:
     ArgList(const char **ArgBegin, const char **ArgEnd);
     ArgList(const ArgList &);
@@ -54,13 +48,6 @@ namespace driver {
 
     const_iterator begin() const { return Args.begin(); }
     const_iterator end() const { return Args.end(); }
-
-    Arg *getArgForID(unsigned ID) const { 
-      llvm::DenseMap<unsigned, Arg*>::iterator it = ArgMap.find(ID);
-      if (it != ArgMap.end())
-        return it->second;
-      return 0;
-    }
   };
 } // end namespace driver
 } // end namespace clang