From 6ac1e2252b1a16fd8841c4b1af8fe41b820aa41d Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 4 Mar 2009 17:10:42 +0000 Subject: [PATCH] Driver: Add ArgList implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66037 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/ArgList.h | 5 +++-- lib/Driver/ArgList.cpp | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 lib/Driver/ArgList.cpp diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index 0fc488e73e..52d4a19f79 100644 --- a/include/clang/Driver/ArgList.h +++ b/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 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 ArgMap; public: - ArgList(unsigned argc, const char **argv); + ArgList(const char **ArgBegin, const char **ArgEnd); ArgList(const ArgList &); ~ArgList(); diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp new file mode 100644 index 0000000000..a8b00bb750 --- /dev/null +++ b/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; +} -- 2.50.1