Fill the values of a constant array. This is either called by \c InitListExpr (which may contain an offset, as the user already provided certain values) or by \c GetValueOfValueInit.
| 1934 | /// This is either called by \c InitListExpr (which may contain an offset, as the user already provided certain |
| 1935 | /// values) or by \c GetValueOfValueInit. |
| 1936 | std::string |
| 1937 | CodeGenerator::FillConstantArray(const ConstantArrayType* ct, const std::string& value, const uint64_t startAt) |
| 1938 | { |
| 1939 | OutputFormatHelper ret{}; |
| 1940 | |
| 1941 | if(ct) { |
| 1942 | const auto size{std::clamp(GetSize(ct), uint64_t{0}, MAX_FILL_VALUES_FOR_ARRAYS)}; |
| 1943 | |
| 1944 | OnceFalse needsComma{uint64_t{0} != startAt}; |
| 1945 | for_each(startAt, size, [&](auto) { |
| 1946 | ret.AppendComma(needsComma); |
| 1947 | ret.Append(value); |
| 1948 | }); |
| 1949 | } |
| 1950 | |
| 1951 | return ret.GetString(); |
| 1952 | } |
| 1953 | //----------------------------------------------------------------------------- |
| 1954 | |
| 1955 | void CodeGenerator::InsertArg(const InitListExpr* stmt) |
nothing calls this directly
no test coverage detected