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

Daniel Dunbar daniel at zuster.org
Fri Mar 20 08:59:11 PDT 2009


Author: ddunbar
Date: Fri Mar 20 10:59:01 2009
New Revision: 67377

URL: http://llvm.org/viewvc/llvm-project?rev=67377&view=rev
Log:
Driver: Add two option overload for AddAllArgValues.

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

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

==============================================================================
--- cfe/trunk/include/clang/Driver/ArgList.h (original)
+++ cfe/trunk/include/clang/Driver/ArgList.h Fri Mar 20 10:59:01 2009
@@ -129,13 +129,16 @@
 
     /// AddAllArgs - Render all arguments matching the given ids.
     void AddAllArgs(ArgStringList &Output, options::ID Id0) const;
-    void AddAllArgs(ArgStringList &Output, options::ID Id0, options::ID Id1) const;
+    void AddAllArgs(ArgStringList &Output, options::ID Id0, 
+                    options::ID Id1) const;
     void AddAllArgs(ArgStringList &Output, options::ID Id0, options::ID Id1, 
                     options::ID Id2) const;
 
     /// AddAllArgValues - Render the argument values of all arguments
     /// matching the given ids.
     void AddAllArgValues(ArgStringList &Output, options::ID Id0) const;
+    void AddAllArgValues(ArgStringList &Output, options::ID Id0, 
+                         options::ID Id1) const;
 
     /// @}
   };

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

==============================================================================
--- cfe/trunk/lib/Driver/ArgList.cpp (original)
+++ cfe/trunk/lib/Driver/ArgList.cpp Fri Mar 20 10:59:01 2009
@@ -162,3 +162,16 @@
     }
   }
 }
+
+void ArgList::AddAllArgValues(ArgStringList &Output, options::ID Id0, 
+                              options::ID Id1) const {
+  // FIXME: Make fast.
+  for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
+    const Arg *A = *it;
+    if (A->getOption().matches(Id0) || A->getOption().matches(Id1)) {
+      A->claim();
+      for (unsigned i = 0, e = A->getNumValues(); i != e; ++i)
+        Output.push_back(A->getValue(*this, i));
+    }
+  }
+}





More information about the cfe-commits mailing list