[cfe-commits] r66037 - in /cfe/trunk: include/clang/Driver/ArgList.h lib/Driver/ArgList.cpp
Daniel Dunbar
daniel at zuster.org
Wed Mar 4 09:10:42 PST 2009
Author: ddunbar
Date: Wed Mar 4 11:10:42 2009
New Revision: 66037
URL: http://llvm.org/viewvc/llvm-project?rev=66037&view=rev
Log:
Driver: Add ArgList implementation.
Added:
cfe/trunk/lib/Driver/ArgList.cpp
Modified:
cfe/trunk/include/clang/Driver/ArgList.h
Modified: cfe/trunk/include/clang/Driver/ArgList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ArgList.h?rev=66037&r1=66036&r2=66037&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/ArgList.h (original)
+++ cfe/trunk/include/clang/Driver/ArgList.h Wed Mar 4 11:10:42 2009
@@ -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 @@
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 @@
llvm::DenseMap<unsigned, Arg*> ArgMap;
public:
- ArgList(unsigned argc, const char **argv);
+ ArgList(const char **ArgBegin, const char **ArgEnd);
ArgList(const ArgList &);
~ArgList();
Added: cfe/trunk/lib/Driver/ArgList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ArgList.cpp?rev=66037&view=auto
==============================================================================
--- cfe/trunk/lib/Driver/ArgList.cpp (added)
+++ cfe/trunk/lib/Driver/ArgList.cpp Wed Mar 4 11:10:42 2009
@@ -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;
+}
More information about the cfe-commits
mailing list