diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-03-04 17:10:42 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-03-04 17:10:42 +0000 |
commit | 3e2cbc3161d975b5770979265d794bcf387a5f97 (patch) | |
tree | eddc23b0980d9da152c8eba8d324073255418892 | |
parent | 79fa6a24b76fc4ba38a11e9102ad5771f1f8b453 (diff) | |
download | bcm5719-llvm-3e2cbc3161d975b5770979265d794bcf387a5f97.tar.gz bcm5719-llvm-3e2cbc3161d975b5770979265d794bcf387a5f97.zip |
Driver: Add ArgList implementation.
llvm-svn: 66037
-rw-r--r-- | clang/include/clang/Driver/ArgList.h | 5 | ||||
-rw-r--r-- | clang/lib/Driver/ArgList.cpp | 22 |
2 files changed, 25 insertions, 2 deletions
diff --git a/clang/include/clang/Driver/ArgList.h b/clang/include/clang/Driver/ArgList.h index 0fc488e73ef..52d4a19f793 100644 --- a/clang/include/clang/Driver/ArgList.h +++ b/clang/include/clang/Driver/ArgList.h @@ -10,6 +10,7 @@ #ifndef CLANG_DRIVER_ARGLIST_H_ #define CLANG_DRIVER_ARGLIST_H_ +#include "Util.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" @@ -34,7 +35,7 @@ namespace driver { ArgStringList ArgStrings; /// The full list of arguments. - llvm::SmallVector<Arg*, 16> Args; + arglist_type Args; /// A map of arguments by option ID; in conjunction with the /// intrusive list in Arg instances this allows iterating over all @@ -42,7 +43,7 @@ namespace driver { llvm::DenseMap<unsigned, Arg*> ArgMap; public: - ArgList(unsigned argc, const char **argv); + ArgList(const char **ArgBegin, const char **ArgEnd); ArgList(const ArgList &); ~ArgList(); diff --git a/clang/lib/Driver/ArgList.cpp b/clang/lib/Driver/ArgList.cpp new file mode 100644 index 00000000000..a8b00bb750d --- /dev/null +++ b/clang/lib/Driver/ArgList.cpp @@ -0,0 +1,22 @@ +//===--- ArgList.cpp - Argument List Management -------------------------*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "clang/Driver/ArgList.h" +#include "clang/Driver/Arg.h" + +using namespace clang::driver; + +ArgList::ArgList(const char **ArgBegin, const char **ArgEnd) { + ArgStrings.append(ArgBegin, ArgEnd); +} + +ArgList::~ArgList() { + for (iterator it = begin(), ie = end(); it != ie; ++ie) + delete *it; +} |