@@ -1110,6 +1110,8 @@ StringRef DeclAttribute::getAttrName() const {
1110
1110
return " differentiable" ;
1111
1111
case DAK_Derivative:
1112
1112
return " derivative" ;
1113
+ case DAK_Transpose:
1114
+ return " transpose" ;
1113
1115
case DAK_Differentiating:
1114
1116
return " differentiating" ;
1115
1117
case DAK_Transposing:
@@ -1608,45 +1610,43 @@ DerivativeAttr *DerivativeAttr::create(ASTContext &context, bool implicit,
1608
1610
std::move (originalName), indices);
1609
1611
}
1610
1612
1611
- TransposingAttr::TransposingAttr (bool implicit, SourceLoc atLoc,
1612
- SourceRange baseRange, TypeRepr *baseType,
1613
- DeclNameWithLoc originalName,
1614
- ArrayRef<ParsedAutoDiffParameter> params)
1615
- : DeclAttribute(DAK_Transposing , atLoc, baseRange, implicit),
1613
+ TransposeAttr::TransposeAttr (bool implicit, SourceLoc atLoc,
1614
+ SourceRange baseRange, TypeRepr *baseType,
1615
+ DeclNameWithLoc originalName,
1616
+ ArrayRef<ParsedAutoDiffParameter> params)
1617
+ : DeclAttribute(DAK_Transpose , atLoc, baseRange, implicit),
1616
1618
BaseType(baseType), OriginalFunctionName(std::move(originalName)),
1617
1619
NumParsedParameters(params.size()) {
1618
1620
std::uninitialized_copy (params.begin (), params.end (),
1619
1621
getTrailingObjects<ParsedAutoDiffParameter>());
1620
1622
}
1621
1623
1622
- TransposingAttr::TransposingAttr (bool implicit, SourceLoc atLoc,
1623
- SourceRange baseRange, TypeRepr *baseType,
1624
- DeclNameWithLoc originalName,
1625
- IndexSubset *indices)
1626
- : DeclAttribute(DAK_Transposing, atLoc, baseRange, implicit),
1624
+ TransposeAttr::TransposeAttr (bool implicit, SourceLoc atLoc,
1625
+ SourceRange baseRange, TypeRepr *baseType,
1626
+ DeclNameWithLoc originalName, IndexSubset *indices)
1627
+ : DeclAttribute(DAK_Transpose, atLoc, baseRange, implicit),
1627
1628
BaseType(baseType), OriginalFunctionName(std::move(originalName)),
1628
1629
ParameterIndices(indices) {}
1629
1630
1630
- TransposingAttr *
1631
- TransposingAttr::create (ASTContext &context, bool implicit, SourceLoc atLoc,
1632
- SourceRange baseRange, TypeRepr *baseType,
1633
- DeclNameWithLoc original ,
1634
- ArrayRef<ParsedAutoDiffParameter> params) {
1631
+ TransposeAttr * TransposeAttr::create (ASTContext &context, bool implicit,
1632
+ SourceLoc atLoc, SourceRange baseRange ,
1633
+ TypeRepr *baseType,
1634
+ DeclNameWithLoc originalName ,
1635
+ ArrayRef<ParsedAutoDiffParameter> params) {
1635
1636
unsigned size = totalSizeToAlloc<ParsedAutoDiffParameter>(params.size ());
1636
- void *mem = context.Allocate (size, alignof (TransposingAttr));
1637
- return new (mem) TransposingAttr (implicit, atLoc, baseRange, baseType,
1638
- std::move (original), params);
1639
- }
1640
-
1641
- TransposingAttr *
1642
- TransposingAttr::create (ASTContext &context, bool implicit, SourceLoc atLoc,
1643
- SourceRange baseRange, TypeRepr *baseType,
1644
- DeclNameWithLoc original,
1645
- IndexSubset *indices) {
1646
- void *mem =
1647
- context.Allocate (sizeof (TransposingAttr), alignof (TransposingAttr));
1648
- return new (mem) TransposingAttr (implicit, atLoc, baseRange, baseType,
1649
- std::move (original), indices);
1637
+ void *mem = context.Allocate (size, alignof (TransposeAttr));
1638
+ return new (mem) TransposeAttr (implicit, atLoc, baseRange, baseType,
1639
+ std::move (originalName), params);
1640
+ }
1641
+
1642
+ TransposeAttr *TransposeAttr::create (ASTContext &context, bool implicit,
1643
+ SourceLoc atLoc, SourceRange baseRange,
1644
+ TypeRepr *baseType,
1645
+ DeclNameWithLoc originalName,
1646
+ IndexSubset *indices) {
1647
+ void *mem = context.Allocate (sizeof (TransposeAttr), alignof (TransposeAttr));
1648
+ return new (mem) TransposeAttr (implicit, atLoc, baseRange, baseType,
1649
+ std::move (originalName), indices);
1650
1650
}
1651
1651
1652
1652
ImplementsAttr::ImplementsAttr (SourceLoc atLoc, SourceRange range,
0 commit comments