]> granicus.if.org Git - clang/commitdiff
Driver: Get rid of the proxy support in DerivedArgList.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 11 Jun 2010 22:00:22 +0000 (22:00 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 11 Jun 2010 22:00:22 +0000 (22:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105841 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/ArgList.h
lib/Driver/ArgList.cpp

index 862b369feaa3bc7052e83fa75d0647a16a291c42..40f6805e7d190393840d86dacd607daca89f2d49 100644 (file)
@@ -104,11 +104,11 @@ namespace driver {
     typedef arglist_type::const_reverse_iterator const_reverse_iterator;
 
   private:
-    /// The full list of arguments.
-    arglist_type &Args;
+    /// The internal list of arguments.
+    arglist_type Args;
 
   protected:
-    ArgList(arglist_type &Args);
+    ArgList();
 
   public:
     virtual ~ArgList();
@@ -267,9 +267,6 @@ namespace driver {
     void operator=(const ArgList &); // DO NOT IMPLEMENT
 
   private:
-    /// The internal list of arguments.
-    arglist_type ActualArgs;
-
     /// List of argument strings used by the contained Args.
     ///
     /// This is mutable since we treat the ArgList as being the list
@@ -317,15 +314,9 @@ namespace driver {
   class DerivedArgList : public ArgList {
     InputArgList &BaseArgs;
 
-    /// The internal list of arguments.
-    arglist_type ActualArgs;
-
     /// The list of arguments we synthesized.
     mutable arglist_type SynthesizedArgs;
 
-    /// Is this only a proxy for the base ArgList?
-    bool OnlyProxy;
-
   public:
     /// Construct a new derived arg list from \arg BaseArgs.
     ///
index 1b6ba94400adb0377df4c5b4cdf1153f022c7b6d..63f1deec7f5834866e89cd97203fbfe62f55cfb8 100644 (file)
@@ -36,7 +36,7 @@ void arg_iterator::SkipToNextArg() {
 
 //
 
-ArgList::ArgList(arglist_type &_Args) : Args(_Args) {
+ArgList::ArgList() {
 }
 
 ArgList::~ArgList() {
@@ -205,7 +205,7 @@ const char *ArgList::GetOrMakeJoinedArgString(unsigned Index,
 //
 
 InputArgList::InputArgList(const char **ArgBegin, const char **ArgEnd)
-  : ArgList(ActualArgs), NumInputArgStrings(ArgEnd - ArgBegin) {
+  : NumInputArgStrings(ArgEnd - ArgBegin) {
   ArgStrings.append(ArgBegin, ArgEnd);
 }
 
@@ -240,9 +240,10 @@ const char *InputArgList::MakeArgString(llvm::StringRef Str) const {
 
 //
 
-DerivedArgList::DerivedArgList(InputArgList &_BaseArgs, bool _OnlyProxy)
-  : ArgList(_OnlyProxy ? _BaseArgs.getArgs() : ActualArgs),
-    BaseArgs(_BaseArgs), OnlyProxy(_OnlyProxy) {
+DerivedArgList::DerivedArgList(InputArgList &_BaseArgs, bool OnlyProxy)
+  : BaseArgs(_BaseArgs) {
+  if (OnlyProxy)
+    getArgs() = _BaseArgs.getArgs();
 }
 
 DerivedArgList::~DerivedArgList() {