Skip to content

Commit 8946965

Browse files
authored
[AutoDiff] Remove unused joinElementTypes* methods. (#28598)
1 parent f28cc66 commit 8946965

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

lib/SILOptimizer/Mandatory/Differentiation.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -116,31 +116,6 @@ static void collectAllActualResultsInTypeOrder(
116116
}
117117
}
118118

119-
/// Given a range of types, joins these into a single type. If there's exactly
120-
/// one element type, returns that element type. Otherwise, creates a tuple type
121-
/// of all element types.
122-
template <typename TypeRange>
123-
static CanType joinElementTypes(TypeRange &&range, const ASTContext &ctx) {
124-
if (range.size() == 1)
125-
return range.front();
126-
auto typeElts =
127-
map<SmallVector<TupleTypeElt, 8>>(range, [&](Type type) { return type; });
128-
return TupleType::get(typeElts, ctx);
129-
}
130-
131-
/// Given a range of SIL values, retrieves the canonical types of these values,
132-
/// and joins these types into a single type.
133-
template <typename SILValueRange>
134-
static CanType joinElementTypesFromValues(SILValueRange &&range,
135-
const ASTContext &ctx) {
136-
if (range.size() == 1)
137-
return range.front()->getType().getASTType();
138-
SmallVector<TupleTypeElt, 8> elts;
139-
transform(range, elts.begin(),
140-
[&](SILValue val) { return val->getType().getASTType(); });
141-
return TupleType::get(elts, ctx)->getCanonicalType();
142-
}
143-
144119
/// Returns the "constrained" derivative generic signature given:
145120
/// - An original SIL function type.
146121
/// - A wrt parameter index subset.

0 commit comments

Comments
 (0)