/Users/buildslave/jenkins/workspace/coverage/llvm-project/libcxx/src/valarray.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===----------------------------------------------------------------------===// |
2 | | // |
3 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | | // See https://llvm.org/LICENSE.txt for license information. |
5 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | |
9 | | #include <valarray> |
10 | | |
11 | | _LIBCPP_BEGIN_NAMESPACE_STD |
12 | | |
13 | | // These two symbols are part of the v1 ABI but not part of the >=v2 ABI. |
14 | | #if _LIBCPP_ABI_VERSION == 1 |
15 | | template _LIBCPP_FUNC_VIS valarray<size_t>::valarray(size_t); |
16 | | template _LIBCPP_FUNC_VIS valarray<size_t>::~valarray(); |
17 | | #endif |
18 | | |
19 | | template void valarray<size_t>::resize(size_t, size_t); |
20 | | |
21 | | void |
22 | | gslice::__init(size_t __start) |
23 | 0 | { |
24 | 0 | valarray<size_t> __indices(__size_.size()); |
25 | 0 | size_t __k = __size_.size() != 0; |
26 | 0 | for (size_t __i = 0; __i < __size_.size(); ++__i) |
27 | 0 | __k *= __size_[__i]; |
28 | 0 | __1d_.resize(__k); |
29 | 0 | if (__1d_.size()) |
30 | 0 | { |
31 | 0 | __k = 0; |
32 | 0 | __1d_[__k] = __start; |
33 | 0 | while (true) |
34 | 0 | { |
35 | 0 | size_t __i = __indices.size() - 1; |
36 | 0 | while (true) |
37 | 0 | { |
38 | 0 | if (++__indices[__i] < __size_[__i]) |
39 | 0 | { |
40 | 0 | ++__k; |
41 | 0 | __1d_[__k] = __1d_[__k-1] + __stride_[__i]; |
42 | 0 | for (size_t __j = __i + 1; __j != __indices.size(); ++__j) |
43 | 0 | __1d_[__k] -= __stride_[__j] * (__size_[__j] - 1); |
44 | 0 | break; |
45 | 0 | } |
46 | 0 | else |
47 | 0 | { |
48 | 0 | if (__i == 0) |
49 | 0 | return; |
50 | 0 | __indices[__i--] = 0; |
51 | 0 | } |
52 | 0 | } |
53 | 0 | } |
54 | 0 | } |
55 | 0 | } |
56 | | |
57 | | _LIBCPP_END_NAMESPACE_STD |