Skip to content

Commit c862ea2

Browse files
committed
[NFC][pstl] Remove unused utility code
llvm-svn: 365346
1 parent 498687b commit c862ea2

File tree

1 file changed

+0
-84
lines changed

1 file changed

+0
-84
lines changed

pstl/include/pstl/internal/parallel_backend_utils.h

-84
Original file line numberDiff line numberDiff line change
@@ -136,90 +136,6 @@ struct __serial_move_merge
136136
}
137137
};
138138

139-
template <typename _RandomAccessIterator1, typename _OutputIterator>
140-
void
141-
__init_buf(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _OutputIterator __zs, bool __bMove)
142-
{
143-
const _OutputIterator __ze = __zs + (__xe - __xs);
144-
typedef typename std::iterator_traits<_OutputIterator>::value_type _ValueType;
145-
if (__bMove)
146-
{
147-
// Initialize the temporary buffer and move keys to it.
148-
for (; __zs != __ze; ++__xs, ++__zs)
149-
new (&*__zs) _ValueType(std::move(*__xs));
150-
}
151-
else
152-
{
153-
// Initialize the temporary buffer
154-
for (; __zs != __ze; ++__zs)
155-
new (&*__zs) _ValueType;
156-
}
157-
}
158-
159-
// TODO is this actually used anywhere?
160-
template <typename _Buf>
161-
class __stack
162-
{
163-
typedef typename std::iterator_traits<decltype(_Buf(0).get())>::value_type _ValueType;
164-
typedef typename std::iterator_traits<_ValueType*>::difference_type _DifferenceType;
165-
166-
_Buf _M_buf;
167-
_ValueType* _M_ptr;
168-
_DifferenceType _M_maxsize;
169-
170-
__stack(const __stack&) = delete;
171-
void
172-
operator=(const __stack&) = delete;
173-
174-
public:
175-
__stack(_DifferenceType __max_size) : _M_buf(__max_size), _M_maxsize(__max_size) { _M_ptr = _M_buf.get(); }
176-
177-
~__stack()
178-
{
179-
assert(size() <= _M_maxsize);
180-
while (!empty())
181-
pop();
182-
}
183-
184-
const _Buf&
185-
buffer() const
186-
{
187-
return _M_buf;
188-
}
189-
size_t
190-
size() const
191-
{
192-
assert(_M_ptr - _M_buf.get() <= _M_maxsize);
193-
assert(_M_ptr - _M_buf.get() >= 0);
194-
return _M_ptr - _M_buf.get();
195-
}
196-
bool
197-
empty() const
198-
{
199-
assert(_M_ptr >= _M_buf.get());
200-
return _M_ptr == _M_buf.get();
201-
}
202-
void
203-
push(const _ValueType& __v)
204-
{
205-
assert(size() < _M_maxsize);
206-
new (_M_ptr) _ValueType(__v);
207-
++_M_ptr;
208-
}
209-
const _ValueType&
210-
top() const
211-
{
212-
return *(_M_ptr - 1);
213-
}
214-
void
215-
pop()
216-
{
217-
assert(_M_ptr > _M_buf.get());
218-
--_M_ptr;
219-
(*_M_ptr).~_ValueType();
220-
}
221-
};
222-
223139
} // namespace __utils
224140
} // namespace __pstl
225141

0 commit comments

Comments
 (0)