<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 28, 2015 at 1:47 PM, Chris Bieneman <span dir="ltr"><<a href="mailto:beanz@apple.com" target="_blank">beanz@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: cbieneman<br>
Date: Thu May 28 15:47:02 2015<br>
New Revision: 238491<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D238491-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=O2LRWXo1-kwq6mOqdQlveRTn94ck6RdmEO0Dn153HOQ&s=x1Chuc6ikjW4ISX1aMnf7gz46dnPQGdU9xMc-Aq6kxY&e=" target="_blank">http://llvm.org/viewvc/llvm-project?rev=238491&view=rev</a><br>
Log:<br>
Revert "Refactoring cl::list_storage from "is a" to "has a" std::vector."<br></blockquote><div><br>It helps to mention in the commit message why a revert is being made - for spectators and future readers who might attempt the same change.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This reverts commit 117715ca0613d3db144241499401f2ec5398f1d5.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/Support/CommandLine.h<br>
<br>
Modified: llvm/trunk/include/llvm/Support/CommandLine.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_llvm_trunk_include_llvm_Support_CommandLine.h-3Frev-3D238491-26r1-3D238490-26r2-3D238491-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=O2LRWXo1-kwq6mOqdQlveRTn94ck6RdmEO0Dn153HOQ&s=EP7eUBeKXUkLwEi0Q44X1TZ9N9ftzM5sTvUot0lJsp0&e=" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=238491&r1=238490&r2=238491&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Support/CommandLine.h (original)<br>
+++ llvm/trunk/include/llvm/Support/CommandLine.h Thu May 28 15:47:02 2015<br>
@@ -1284,61 +1284,16 @@ public:<br>
   }<br>
 };<br>
<br>
-// Define how to hold a class type object, such as a string.<br>
-// Originally this code inherited from std::vector. In transitioning to a new<br>
-// API for command line options we should change this. The new implementation<br>
-// of this list_storage specialization implements the minimum subset of the<br>
-// std::vector API required for all the current clients.<br>
+// Define how to hold a class type object, such as a string.  Since we can<br>
+// inherit from a class, we do so.  This makes us exactly compatible with the<br>
+// object in all cases that it is used.<br>
 //<br>
-// FIXME: Reduce this API to a more narrow subset of std::vector<br>
-//<br>
-template <class DataType> class list_storage<DataType, bool> {<br>
-  std::vector<DataType> Storage;<br>
-<br>
+template <class DataType><br>
+class list_storage<DataType, bool> : public std::vector<DataType> {<br>
 public:<br>
-  typedef typename std::vector<DataType>::iterator iterator;<br>
-<br>
-  iterator begin() { return Storage.begin(); }<br>
-  iterator end() { return Storage.end(); }<br>
-<br>
-  typedef typename std::vector<DataType>::const_iterator const_iterator;<br>
-  const_iterator begin() const { return Storage.begin(); }<br>
-  const_iterator end() const { return Storage.end(); }<br>
-<br>
-  typedef typename std::vector<DataType>::size_type size_type;<br>
-  size_type size() const { return Storage.size(); }<br>
-<br>
-  bool empty() const { return Storage.empty(); }<br>
-<br>
-  void push_back(const DataType &value) { Storage.push_back(value); }<br>
-  void push_back(DataType &&value) { Storage.push_back(value); }<br>
-<br>
-  typedef typename std::vector<DataType>::reference reference;<br>
-  typedef typename std::vector<DataType>::const_reference const_reference;<br>
-  reference operator[](size_type pos) { return Storage[pos]; }<br>
-  const_reference operator[](size_type pos) const { return Storage[pos]; }<br>
-<br>
-  iterator erase(const_iterator pos) { return Storage.erase(pos); }<br>
-  iterator erase(const_iterator first, const_iterator last) {<br>
-    return Storage.erase(first, last);<br>
-  }<br>
-<br>
-  iterator insert(const_iterator pos, const DataType &value) {<br>
-    return Storage.insert(pos, value);<br>
-  }<br>
-  iterator insert(const_iterator pos, DataType &&value) {<br>
-    return Storage.insert(pos, value);<br>
+  template <class T> void addValue(const T &V) {<br>
+    std::vector<DataType>::push_back(V);<br>
   }<br>
-<br>
-  reference front() { return Storage.front(); }<br>
-  const_reference front() const { return Storage.front(); }<br>
-<br>
-  operator std::vector<DataType>&() { return Storage; }<br>
-  operator ArrayRef<DataType>() { return Storage; }<br>
-  std::vector<DataType> *operator&() { return &Storage; }<br>
-  const std::vector<DataType> *operator&() const { return &Storage; }<br>
-<br>
-  template <class T> void addValue(const T &V) { Storage.push_back(V); }<br>
 };<br>
<br>
 //===----------------------------------------------------------------------===//<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>