[PATCH] Move DWARFUnitSection from inheriting SmallVector to holding an instance.

Alexey Samsonov vonosmas at gmail.com
Mon Sep 15 10:42:51 PDT 2014


Are you sure you need all these methods? For instance, can you introduce
  iterator_range units() {
    return iterator_range(Units.begin(), Units.end());
  }
and use this method in DWARFContext methods getNumCompileUnits(), getNumTypeUnits(), etc. In this case there will be no need for exposing begin()/end() methods directly. Same for operator[] - IMO it makes more sense to have a method "UnitType* getUnitAtIndex()" than "std::unique_ptr<UnitType>& operator[]", and make caller call get().

http://reviews.llvm.org/D5352






More information about the llvm-commits mailing list