[lld] r234453 - AtomVector: Reorder member orders to use template alias in AtomRange.
Rui Ueyama
ruiu at google.com
Wed Apr 8 16:12:50 PDT 2015
Author: ruiu
Date: Wed Apr 8 18:12:48 2015
New Revision: 234453
URL: http://llvm.org/viewvc/llvm-project?rev=234453&view=rev
Log:
AtomVector: Reorder member orders to use template alias in AtomRange.
Modified:
lld/trunk/include/lld/Core/File.h
Modified: lld/trunk/include/lld/Core/File.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/File.h?rev=234453&r1=234452&r2=234453&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/File.h (original)
+++ lld/trunk/include/lld/Core/File.h Wed Apr 8 18:12:48 2015
@@ -91,25 +91,23 @@ public:
return _allocator;
}
+ /// The type of atom mutable container.
+ template <typename T> using AtomVector = std::vector<const T *>;
+
/// The range type for the atoms. It's backed by a std::vector, but hides
/// its member functions so that you can only call begin or end.
template <typename T> class AtomRange {
- typedef std::vector<const T *> VectorT;
-
public:
- AtomRange(std::vector<const T *> v) : _v(v) {}
- typename VectorT::const_iterator begin() const { return _v.begin(); }
- typename VectorT::const_iterator end() const { return _v.end(); }
- typename VectorT::iterator begin() { return _v.begin(); }
- typename VectorT::iterator end() { return _v.end(); }
+ AtomRange(AtomVector<T> v) : _v(v) {}
+ typename AtomVector<T>::const_iterator begin() const { return _v.begin(); }
+ typename AtomVector<T>::const_iterator end() const { return _v.end(); }
+ typename AtomVector<T>::iterator begin() { return _v.begin(); }
+ typename AtomVector<T>::iterator end() { return _v.end(); }
private:
- VectorT &_v;
+ AtomVector<T> &_v;
};
- /// The type of atom mutable container.
- template <typename T> using AtomVector = std::vector<const T *>;
-
/// \brief Must be implemented to return the AtomVector object for
/// all DefinedAtoms in this File.
virtual const AtomVector<DefinedAtom> &defined() const = 0;
More information about the llvm-commits
mailing list