| 2102 | : LiteralBase(), root_piece_(&literal.piece(view_root)) {} |
| 2103 | |
| 2104 | void BorrowingLiteral::BuildPieceSubtree(const Shape& shape, Piece* piece) { |
| 2105 | CHECK(shape.IsTuple()); |
| 2106 | for (int i = 0; i < ShapeUtil::TupleElementCount(shape); ++i) { |
| 2107 | const Shape& subshape = shape.tuple_shapes(i); |
| 2108 | |
| 2109 | auto child_piece = Piece(); |
| 2110 | child_piece.set_subshape(&subshape); |
| 2111 | |
| 2112 | if (subshape.IsTuple()) { |
| 2113 | BuildPieceSubtree(subshape, &child_piece); |
| 2114 | } |
| 2115 | |
| 2116 | piece->emplace_back(std::move(child_piece)); |
| 2117 | } |
| 2118 | } |
| 2119 | |
| 2120 | BorrowingLiteral::BorrowingLiteral(const char* src_buf_ptr, const Shape& shape) |
| 2121 | : LiteralBase(), shape_(absl::make_unique<Shape>(shape)) { |
nothing calls this directly
no test coverage detected